fix(platform-loader): await SourceMapConsumer and destroy#1018
Open
shiftj18 wants to merge 3 commits intoraxjs:masterfrom
Open
fix(platform-loader): await SourceMapConsumer and destroy#1018shiftj18 wants to merge 3 commits intoraxjs:masterfrom
shiftj18 wants to merge 3 commits intoraxjs:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1018 +/- ##
==========================================
+ Coverage 49.76% 49.88% +0.11%
==========================================
Files 48 48
Lines 1282 1285 +3
Branches 296 297 +1
==========================================
+ Hits 638 641 +3
Misses 644 644
|
wssgcg1213
approved these changes
Sep 15, 2022
answershuto
approved these changes
Sep 16, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rax-platform-loader 修改
TypeError: Cannot read properties of undefined (reading '0')’,原因是new SourceMapConsumer()返回是 Promise,所以后续取值outputMapConsumer.sources[0]报错,source-map对应文档。用法更正为 await,并且增加用完后的 destroy() ,释放空间。import { isWeex as iw } from 'universal-env';转为了const isWeex = true;\n const iw = true;的问题。被 Alias 为iw的isWeex变量赋值后,如果模块命名空间内用户有再声明isWeex则会报错。这里去掉赋值,将其释放出来。_universalEnv = { isWeex: false }这种剔除,测试目前最新版本 0.5.2 依然不支持。故这里将写死的替换_universalEnv.isWeex为布尔值的逻辑,做成配置options.memberExpObjName(同options.name),便于用户自定义扩展支持其他分端 env 库 (比如 @ali/rxpi-env 的分端 tree-shaking)。