-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Insert sibling bundles before main script with almost empty html #4456
Conversation
|
cc02ce5
to
9af55fb
Compare
9af55fb
to
b4fce5a
Compare
Benchmark ResultsKitchen Sink ✅
Timings
Cold Bundles
Cached Bundles
React HackerNews ✅
Timings
Cold Bundles
Cached Bundles
AtlasKit Editor ✅
Timings
Cold Bundles
Cached Bundles
Three.js x4 🚨
Timings
Cold BundlesNo bundles found, this is probably a failed build... Cached BundlesNo bundles found, this is probably a failed build... |
assert( | ||
/<\/script>\s*<link rel="stylesheet" href="[/\\]{1}html-css-optional-elements\.[a-f0-9]+\.css"><h1>Hello/.test( | ||
/^<link rel="stylesheet" href="[/\\]html-css-optional-elements\.[a-f0-9]+\.css">\s*<script src="[/\\]other\.[a-f0-9]+\.js"><\/script>\s*<h1>Hello/m.test( |
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 change is to insert the sibling before the first non-metadata tag or script.
So previously
<script src="/other.7576ab85.js"></script> <!-- entry1-->
<link rel="stylesheet" href="/html-css-optional-elements.03af036d.css"> <!-- inserted -->
<h1>Hello world</h1>
<script src="/html-css-optional-elements.9d40fb57.js"></script> <!-- entry2 -->
Now:
<link rel="stylesheet" href="/html-css-optional-elements.03af036d.css"> <!-- inserted -->
<script src="/other.7576ab85.js"></script> <!-- entry1 -->
<h1>Hello world</h1>
<script src="/html-css-optional-elements.9d40fb57.js"></script> <!-- entry2 -->
I guess this is fine?
To keep the old behaviour we would need to have a different logic when a link (order doesn't matter) or a script (order is important) is inserted.
↪️ Pull Request
The sibling script could be inserted after the first script, meaning after the entry bundle
Likely a regression from #4306
Part of #4389