Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

refactor: logic#19929

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
alexander-akait wants to merge1 commit intomain
base:main
Choose a base branch
Loading
frompart-of-19902
Open

refactor: logic#19929

alexander-akait wants to merge1 commit intomainfrompart-of-19902

Conversation

@alexander-akait
Copy link
Member

What kind of change does this PR introduce?

refactor code

Did you add tests for your changes?

WIP

Does this PR introduce a breaking change?

No

What needs to be documented once your changes are merged?

Nothing

@Jack-Works I think I found some incompatibilities with defer and without defer in our logic (and I think it is a bug):


Without defer:

index.js

import*asmodfrom"./module.js";varsym=Symbol.for("comet");console.log(Reflect.ownKeys(mod))console.log(mod.default[sym])console.log(mod[sym])

module.js

varsym=Symbol.for("comet");varsym2=Symbol.for("meteor");varobj={[sym]:0,str:0,773:0,0:0,[sym2]:0,"-1":0,8:0,"second str":0,};module.exports=obj;

Output:

[  '0',  '8',  '773',  'str',  '-1',  'second str',  Symbol(comet),  Symbol(meteor)]00

With defer:

index.js

importdefer*asmodfrom"./module.js";varsym=Symbol.for("comet");console.log(Reflect.ownKeys(mod))console.log(mod.default[sym])console.log(mod[sym])

module.js

varsym=Symbol.for("comet");varsym2=Symbol.for("meteor");varobj={[sym]:0,str:0,773:0,0:0,[sym2]:0,"-1":0,8:0,"second str":0,};module.exports=obj;
[  '0',  '8',  '773',  '__esModule',  'str',  '-1',  'second str',  'default',  Symbol(Symbol.toStringTag)]0undefined

I think we should change the mode6 to8 fordynamic

@codspeed-hq
Copy link

CodSpeed Performance Report

Merging#19929 willdegrade performances by 41.68%

Comparingpart-of-19902 (2dbf651) withmain (c647cf1)

Summary

❌ 1 regression
✅ 41 untouched

⚠️Please fix the performance issues oracknowledge them on CodSpeed.

Benchmarks breakdown

BenchmarkBASEHEADChange
benchmark "devtool-eval", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}'41.3 ms70.7 ms-41.68%

@Jack-Works
Copy link
Contributor

hi! I think there is nothing wrong with the current result.

A deferred namespace object is an ECMAScript module namespace object, since it's impossible to export a symbol-named entry in an ES Module (not possible toexport const [Symbol.something] = ...), reflecting symbol names in the final namespace is not correct.

@alexander-akait
Copy link
MemberAuthor

@Jack-Works I agree aboutECMAScript module namespace object, but in my example we importcommonjs module and usingmodule.exports, withoutdefer we provide compatibility (old way) like you have named export, withdefer we don't do it, it can be confusing by developers

@Jack-Works
Copy link
Contributor

@Jack-Works I agree aboutECMAScript module namespace object, but in my example we importcommonjs module and usingmodule.exports, withoutdefer we provide compatibility (old way) like you have named export, withdefer we don't do it, it can be confusing by developers

The difference of exported keys:

-Symbol(comet)-Symbol(meteor)+default

If we change the mode, that means any symbol (even non-exist one) access will also trigger the module evaluation. I'm not sure if that is what we want.

maybe cc@nicolo-ribaudo ?

@alexander-akait
Copy link
MemberAuthor

Yeah, let/s wait@nicolo-ribaudo answer

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@alexander-akait@Jack-Works

[8]ページ先頭

©2009-2025 Movatter.jp