Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.8.x] There is a need to support the output of js sourceMap files when building projects for native platforms #17196

Closed
zhefengzhang opened this issue Jun 20, 2024 · 2 comments
Assignees
Labels
Feature Request P1 Must be finished in the milestone QA: Open Issue ticket opened by QA team
Milestone

Comments

@zhefengzhang
Copy link
Contributor

Use Case

The current version of Cocos Creator records sourceMap data into the project scripts during the build process, which creates difficulties when submitting sourceMap files to crash tracking platforms. Therefore, there is a need to consider supporting the export of separate sourceMap files when building for native platforms.

当前版本的 CocosCreator 在构建时会将 souceMap 数据记录到项目脚本中,这让需要提交 souceMap 文件到崩溃跟踪平台时遇到困难。所以需要考虑支持在构建原生平台时支持输出独立的 sourceMap 文件。

80d96ca0d4c770ac0173f597608d96b3

Problem Description

Proposed Solution

No response

How it works

No response

Alternatives Considered

Additional Information

No response

@zhefengzhang zhefengzhang added Feature Request Needs Triage Needs to be assigned by the team labels Jun 20, 2024
@dumganhar dumganhar self-assigned this Jun 20, 2024
@dumganhar dumganhar added P1 Must be finished in the milestone and removed Needs Triage Needs to be assigned by the team labels Jun 20, 2024
@dumganhar dumganhar added this to the 3.8.5 milestone Jun 20, 2024
@dumganhar
Copy link
Contributor

当前编译引擎脚本和项目脚本,已经支持选择 sourceMap 的类型为“关闭”、“独立文件”、“内嵌到脚本” 三个选项。只是构建面板中的 UI 只有一个 CheckBox。如果打钩✅,原生上被写死了“内嵌到脚本”,非原生上写死了“独立文件”。

之前原生上搞成内嵌,是因为远程调试无法使用分离 sourceMap 。但是如果是发布游戏正式版,是希望sourcemap 为分离的,否则游戏源码会被泄露,而且增加了包体。

因此,应该把 Checkbox 改为 下拉框,分为 “关闭”、“独立文件”、“内嵌到脚本” 三个选项。

另外,是否叫“独立文件”,可能还得斟酌一下。“独立文件” or “独立的文件” or “分开的文件” or “分离的文件”。

关于迁移

如果用户之前启用 sourceMap,即打钩✅,那么原生平台,迁移到“内嵌到脚本”,非原生平台迁移到“独立文件”。

@dumganhar dumganhar assigned yanOO1497 and unassigned dumganhar Jun 27, 2024
@yanOO1497
Copy link
Contributor

yanOO1497 commented Jul 3, 2024

看了下历史记录,在 3.8.2 之前实际上原生平台的 sourceMaps 一直都是和其他平台一样是独立文件的。从 3.8.2 开始原生平台改成内联的,由于这个内联存在的版本时间比较短,而且之前调整时就没有维持和旧版本一致了。因而这次支持 sourceMaps 设置 inline 后,不会将旧版本原生平台的 sourceMaps 迁移为 inline ,而是常规的独立文件。如果原生平台需要 inline 的,自行去修改配置即可。

@yanOO1497 yanOO1497 added the QA: Open Issue ticket opened by QA team label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request P1 Must be finished in the milestone QA: Open Issue ticket opened by QA team
Projects
Status: Done
Development

No branches or pull requests

3 participants