-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
refactor: use import to load the HMR manifest to support all ESM environments #19633
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to make it better to avoid breaking changes and broken very old platform
- Add
importAttributes
here - https://github.com/webpack/webpack/blob/main/lib/config/target.js#L99 - When add add the same for
importAttributes
- https://github.com/webpack/webpack/blob/main/lib/config/defaults.js#L1085 - When check it here - if support let's using this, if not - lets use old fetch
Import attributes is still young and I am afraid some legacy platform/application can be tests/used in old env where they are not supported
You can take support data from here - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import/with |
@alexander-akait For this PR, I went with the simplest implementation. |
CodSpeed Performance ReportMerging #19633 will degrade performances by 74.33%Comparing Summary
Benchmarks breakdown
|
@xiaoxiaojx I am fine with it too, yeah, it is more simple solution |
@xiaoxiaojx sometimes we have weird problems with benchmark: /** @type {Generator} */ (this.generator).getSize(this, type) we will need to look (and also make benchmark more stable), not related to this PR, hope we will resolve it soon |
What kind of change does this PR introduce?
refactoring
Did you add tests for your changes?
No
Does this PR introduce a breaking change?
No
What needs to be documented once your changes are merged?
No