【官网已更新】Cocos Creator 3.0 rc 偷跑

感谢反馈,下个版本修复

看到NPM支持,立马光速升级, 然后Failed To resolve @xxx/xxx

提个小建议,UI渲染词不达意.最好改成2D渲染.或2D对象.针对3D.Label和RichText移到UI组件里

getUIDelta/… 类似也是值得斟酌的.可以考虑getCanvasDelta或者2d等其他.

uiredner

1赞

支持导入导出,好评。

抱歉,scoped 包解析出现了问题。我们正在紧急修复,见上面的回复。先可以用非 scoped 的包噢。

关于 NPM 的使用上有一些注意事项,比较常见的是:

  • 需要用 import default 语法来使用那些 CommonJS 模块格式的 NPM 包(大部分都是)。因此需要 import foo from "foo" 而非 import { /* foo 的导出 */ } from 'foo'。可参考 ESM 与 CommonJS 交互

  • 如果需要导入 NPM 包中的子路径,后缀是需要的。

这些注意事项大体上和 Node.js 对 ESM 导入 CommonJS 模块的要求一致。

我们正在补充这方面的详细文档,不过还未正式定稿,可参见:https://github.com/cocos-creator/creator-docs/pull/1452 (Markdown 版本:示例:使用 protobufjs模块规范

1赞

nearest在浏览器中不见起效,预览窗口包括场景窗口有效.

1

2

3

看错了,预览窗口有显示,只是浏览器预览不显示。

这里确实有问题,已经修复了,可以先参考这个 PR RichText Layer change
我们也会尽快更新版本

你好,已经修复了哈,下个版本就可用了~

你好,已经修复了哈,下个版本就可用了~ :slight_smile:

试了一下M1电脑能打开运行了 但是还是转译版本 请问正式版有考虑支持原生M1版本吗?

现在微信支持wasm了吗? 文档查不到呢

年前会发一版本吗,过年要更新大版本

大赞,以为还不支持呢

3D模型资源,gltf和fbx,在ccc里是不会直接使用的,我查看了一下library,gltf里的mesh,prefab,mat等资源都是转化成了对应的json, bin 以及png的,现在问题来了。。怎么【动态加载】这些包含在gltf里的mesh prefab mat texture等资源??

神速啊,赞:+1:
请问现在自定义渲染管线在Native层实现了吗,上次的Preview版本还不支持

如果CommonJS非default导出的(在类型声明上不是default导出)
那么,在使用时就会报错
这就很矛盾了。。。

import { App } from "egf-core" //这样使用,写的时候不会报错,但运行就取不到
import egfCore from "egf-core" //这样写类型报错,但运行可以取到值

通过调试发现

cocos为每个npm包生成了 一个systemjs的文件
image

System.register(["cce:/internal/code-quality/cr.mjs", "./index.js", "cce:/internal/ml/cjs-loader.mjs"], function (_export, _context) {
  "use strict";

  var _reporterNs, req, loader, d, _crd;

  function _reportPossibleCrUseOfreq(extras) {
    _reporterNs.report("req", "./index.js", _context.meta, extras);
  }

  function _reportPossibleCrUseOfd(extras) {
    _reporterNs.report("d", "./index.js", _context.meta, extras);
  }

  return {
    setters: [function (_cceInternalCodeQualityCrMjs) {
      _reporterNs = _cceInternalCodeQualityCrMjs;
    }, function (_indexJs) {
      req = _indexJs.__cjsMetaURL;
      d = _indexJs.default;
      var _exportObj = {};

      for (var _key in _indexJs) {
        if (_key !== "default" && _key !== "__esModule") _exportObj[_key] = _indexJs[_key];
      }

      _export(_exportObj);
    }, function (_cceInternalMlCjsLoaderMjs) {
      loader = _cceInternalMlCjsLoaderMjs.default;
    }],
    execute: function () {
      _crd = true;

      if (!(_crd && req === void 0 ? (_reportPossibleCrUseOfreq({
        error: Error()
      }), req) : req)) {
        loader.throwInvalidWrapper('./index.js', _context.meta.url);
      }

      loader.require(_crd && req === void 0 ? (_reportPossibleCrUseOfreq({
        error: Error()
      }), req) : req);

      _export("default", d);

      _crd = false;
    }
  };
});
//# sourceMappingURL=index.proxy.js.map

_export(“default”,d)的调用


给引用npm包的脚本文件编译成这样
System.register([“cce:/internal/code-quality/cr.mjs”, “cc”, “egf-core”], function (_export, _context) {
“use strict”;

var _reporterNs, _cclegacy, _decorator, Component, App, _dec, _class, _crd, ccclass, property, Abc;

function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.proto = superClass; }

function _reportPossibleCrUseOfApp(extras) {
_reporterNs.report(“App”, “egf-core”, _context.meta, extras);
}

return {
setters: [function (_cceInternalCodeQualityCrMjs) {
_reporterNs = _cceInternalCodeQualityCrMjs;
}, function (_cc) {
_cclegacy = _cc.cclegacy;
_decorator = _cc._decorator;
Component = _cc.Component;
}, function (_egfCore) {
//export(“default”,d)之后会进这个函数,
//但实际传进来的是 {default:{__esModule:true,App:()…}}
App = _egfCore.App;
}],
execute: function () {
_crd = true;

  _cclegacy._RF.push({}, "928a3KL/MVLLaIpdAlWfUw1", "abc", undefined);

  ccclass = _decorator.ccclass;
  property = _decorator.property;

  _export("Abc", Abc = (_dec = ccclass('Abc'), _dec(_class = /*#__PURE__*/function (_Component) {
    _inheritsLoose(Abc, _Component);

    function Abc() {
      return _Component.apply(this, arguments) || this;
    }

    var _proto = Abc.prototype;

    // [1]
    // dummy = '';
    // [2]
    // @property
    // serializableDummy = 0;
    _proto.start = function start() {
      // [3]
      var app = new (_crd && App === void 0 ? (_reportPossibleCrUseOfApp({
        error: Error()
      }), App) : App)();
      console.log(app);
    } // update (deltaTime: number) {
    //     // [4]
    // }
    ;

    return Abc;
  }(Component)) || _class));
  /**
   * [1] Class member could be defined like this.
   * [2] Use `property` decorator if your want the member to be serializable.
   * [3] Your initialization goes here.
   * [4] Your update function goes here.
   *
   * Learn more about scripting: https://docs.cocos.com/creator/3.0/manual/en/scripting/
   * Learn more about CCClass: https://docs.cocos.com/creator/3.0/manual/en/scripting/ccclass.html
   * Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.0/manual/en/scripting/life-cycle-callbacks.html
   */


  _cclegacy._RF.pop();

  _crd = false;
}

};
});
//# sourceMappingURL=abc.js.map

其实这个npm包有es模块规范的导出,但只识别到了commonjs模块规范的导出

cjs规范的声明我去掉了scoped的npm包,可以直接放到node_modules里去测试
egf-core.zip (45.9 KB)

补充
import * as egfCore from "egf-core"的方式也不支持(运行时报错)

确实,我也被这个搞的有点迷惑了!另外, 请开发组请尽快实现内置的tilemap编辑器功能啊!!!

根节点上只要用了UITransform这个组件,它的所有子节点都不能设置layer保存,被默认为2DUI。这个在preview版本没有问题。 是有什么新用法吗?

确实, graphics,mask, particleSystem2D,tiledMap应该放在 “2D对象”,其余的应该放在UI组件里去,