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.
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
fix: keep order of script tags #2571
base: master
Are you sure you want to change the base?
fix: keep order of script tags #2571
Changes from all commits
acb3336
4aa5c4e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 can't see why these changed from upper case to lowercase letters 🤔
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.
Oh these were changed manually! Do we need to change these? I'd rather make the smallest change possible so it's easier to review. If possible I'd like to revert these changes to the HTML files even though they are probably technically correct.
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.
Can do this in a separate PR. The demo will not work without the change (on linux) because the file name is
page-b.html
.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.
So the assets in
bundle
come to us not in the order that they were parsed in? I wonder why that is. You think it's something in Rollup or in some other Modern Web code?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.
My thinking being that if we are creating this asset list incorrectly somewhere else (and not Rollup) we could delve deeper into the issue and try to fix it at it's root rather than sorting the asset/chunk list here.
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.
The entrypoints is just gathered through bundles and object values. See getEntrypointBundles in the same file. The order could be different from file to file. And on top of that, Object.values is not guaranteed to have a specific order.
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.
What is this asserting? What is the actual output?
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.
Most all of the outputs was reversed. a + b would become b + a.
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.
Can you help me understand this change? From the code changed I don't understand why these tests change.
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.
See packages/rollup-plugin-html/src/input/getInputData.ts
The order between inline and other modules was lost because they was gathered in two different lists. Then they was merged together upon return, making the inline modules always come after the other modules. I changed it to put all modules including inline modules in the sam list from the start. Thus, the moduleImports lists is no longer empty if there is inlineModules.