web icon indicating copy to clipboard operation
web copied to clipboard

fix: keep order of script tags

Open aigan opened this issue 2 years ago • 5 comments

fixes #2466 fixes #2456

What I did

  • rollup-plugin-html getInputData.ts was adding the inlineModules at the end of the list. I changed it to keep the original order and then used that order in getEntrypointBundles.ts when creating the list of entrypoints.

  • added another test for the order of script tags

  • fixed filename case in rollup-plugin-html mpa demo

  • updated snapshots in rollup-plugin-polyfills-loader tests for the corrected order of the script tags

aigan avatar Dec 05 '23 21:12 aigan

🦋 Changeset detected

Latest commit: 4aa5c4ec429b0899291a08abc86b55332e823851

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@web/rollup-plugin-polyfills-loader Patch
@web/rollup-plugin-html Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Dec 05 '23 21:12 changeset-bot[bot]

Feels like it's going in a good direction to start. There are more failures that expected (there are often flakes, but they don't cover the number of failures above) in the Window tests above, can you look into that?

Westbrook avatar Dec 05 '23 21:12 Westbrook

Feels like it's going in a good direction to start. There are more failures that expected (there are often flakes, but they don't cover the number of failures above) in the Window tests above, can you look into that?

Most failures are - "sub\sub-a.svg" + "sub/sub-a.svg"

That's not directly related. Not sure how to easily test windows from Linux.

But some of them are similarly the result of script tags now in correct order.

aigan avatar Dec 05 '23 22:12 aigan

Feels like it's going in a good direction to start. There are more failures that expected (there are often flakes, but they don't cover the number of failures above) in the Window tests above, can you look into that?

actually. It's the flakes this PR is intended to fix. It seems that rollup-plugin-copy has an error similar to the one I fixed in rollup-plugin-html regarding the ordering

aigan avatar Dec 05 '23 22:12 aigan

Latest checks failed from new bugs in another package, not related to this PR.

/home/runner/work/web/web/packages/browser-logs/test/serialize-deserialize.test.ts:1 import { expect } from 'chai';

aigan avatar Dec 18 '23 15:12 aigan