Open smallmain opened 4 months ago
It may be related to this: https://nodejs.org/dist/latest-v17.x/docs/api/intl.html#internationalization-support
I don't understand why regular expression is related to internationalization.
它可能与此相关:https://nodejs.org/dist/latest-v17.x/docs/api/intl.html#internationalization-support
我不明白为什么正则表达式与国际化相关。
Since RegExp Unicode Property Escapes are matched in a language-aware way, which requires ICU data (International Components for Unicode), which can be optionally included in NodeJS builds, So I suspect that Cocos' V8 builds don't include this data, since it works fine on other platforms.
https://github.com/tc39/proposal-regexp-unicode-property-escapes
And, theoretically, all the functions listed in the table should not work in their entirety without including this data.
Got it, thanks.
Yep, the ICU module is not included in v8 to reduce size. We will take a look how to provide it.
Got it, thanks.
Yep, the ICU module is not included in v8 to reduce size. We will take a look how to provide it.
RegExp's Unicode support is very important. If you want to correctly segment Chinese words, Emoji, etc., this is the simplest and most correct method. If the engine does not support it, the user also needs to increase the size of the polyfill.
Hope it gets taken seriously.
Sure, we will resolve it.
I built the same v8 version used in cocos creator 3.8.3, its size will increase 4MB (zip packed in APK) or 10MB (so size, not packed). I think only some people need this functionality. So I don't suggest to include v8 with INTL
by default.
You could download the v8 with INTL support here ( https://github.com/cocos/v8/releases/tag/11.6.189.22-intl-support ) and replace the libv8_monolith.a
in engine/native/external directory.
I will write a documentation about how to enable v8 INTL support.
I built the same v8 version used in cocos creator 3.8.3, its size will increase 4MB (zip packed in APK) or 10MB (so size, not packed). I think only some people need this functionality. So I don't suggest to include
v8 with INTL
by default.You could download the v8 with INTL support here ( https://github.com/cocos/v8/releases/tag/11.6.189.22-intl-support ) and replace the
libv8_monolith.a
in engine/native/external directory.I will write a documentation about how to enable v8 INTL support.
Can you add a option to build panel?
Can you add a option to build panel?
It will be more work to do.
libv8_monolith.a
If there're many developers need this functionality, we will consider to add a radio button for easier switching v8 with or without INTL support.
@minggo What's your opinion?
I agree with @dumganhar . It may take more resource to add a new feature. Especially we should make every new feature work correctly on all platforms for every version.
I agree with @dumganhar . It may take more resource to add a new feature. Especially we should make every new feature work correctly on all platforms for every version.
@minggo @dumganhar
我们不是有扩展和实验室机制吗? Don't we have extensions and lab mechanisms?
我们既然能通过扩展发布了 shader-graph
和 l10n
这两个 BUG 非常多、可用性不高的功能,通过实验室发布几乎不可用和很难用的 原生引擎场景
,那么我觉得就应该利用这两个机制提高我们引擎特性的迭代速度,将 [testing] 环节完全简化或去除。
Now that we've been able to release 'shader-graph' and 'l10n' buggier and less usable features through extensions, and release 'native engine scenes' that are almost impossible and difficult to use through LABS, I think we should use these two mechanisms to improve the speed of feature iteration. Simplify or remove [testing] entirely.
当然,这个 Intl
貌似只有我反馈,虽然我很惊讶,但可能确实 Cocos 开发者大部分都没完善的国际化支持需求,仅提供文档我可以理解。
Of course, this' Intl 'seems to be my only feedback, and while I'm surprised, it's probably true that most Cocos developers don't need this.
Don't we have extensions and lab mechanisms?
Extension and lab mechanism is used for the feature that we want to support but it is not ready. And we want to reduce it as few as possible.
Of course, this' Intl 'seems to be my only feedback, and while I'm surprised, it's probably true that most Cocos developers don't need this.
We will support in when more developers need it.
我构建了与 cocos creator 3.8.3 中使用的相同的 v8 版本,其大小将增加 4MB(zip 打包在 APK 中)或 10MB(因此是大小,而不是打包)。我认为只有一些人需要此功能。所以我不建议默认包含
v8 with INTL
。您可以在此处下载支持 INTL 的 v8(https://github.com/cocos/v8/releases/tag/11.6.189.22-intl-support)并替换`libv8_monolith.a`engine/native/external 目录中的版本。
我将编写一份有关如何启用 v8 INTL 支持的文档。
@dumganhar 你好,麻烦问下,这个如何启用v8 Intl支持的文档在哪个地方呢?我这边需要使用Intl API ,支持国际化操作,我这边按照你上面提供的方法,我全部替换了,但是在原生Android 上还是报错提示:/3d/engine/native/cocos/bindings/jswrapper/v8/Object.cpp, 754): Invoking function failed, ReferenceError: Intl is not defined ,我把 这里所有的libv8_monolith.a全部替换了支持INTL的,然后把include/v8下面的代码也全部替换了,并切换到cocos creator3.8.2中执行了引擎编译,最终在构建原生android,还是报错,提示没有Intl
Cocos Creator version
3.8.2
System information
MacOS
Issue description
It may be related to this: https://nodejs.org/dist/latest-v17.x/docs/api/intl.html#internationalization-support
Relevant error log output
No response
Steps to reproduce
.
Minimal reproduction project
No response