Skip to content
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

Merged
merged 5 commits into from
Apr 11, 2020

Conversation

mischnic
Copy link
Member

@mischnic mischnic commented Apr 9, 2020

↪️ 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

@height
Copy link

height bot commented Apr 9, 2020

Link Height tasks by mentioning a task ID in the pull request title or description, commit messages, or comments.

You can also use "Close T-X" to automatically close a task when the pull request is merged.

@mischnic mischnic force-pushed the html-insert-sibling-order branch 2 times, most recently from cc02ce5 to 9af55fb Compare April 9, 2020 22:09
@mischnic mischnic force-pushed the html-insert-sibling-order branch from 9af55fb to b4fce5a Compare April 9, 2020 22:10
@parcel-benchmark
Copy link

parcel-benchmark commented Apr 9, 2020

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 5.83s -436.00ms 🚀
Cached 2.16s -16.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.d5807e82.webp 102.94kb +0.00b 231.00ms -87.00ms 🚀
dist/modern/parcel.d5807e82.webp 102.94kb +0.00b 230.00ms -95.00ms 🚀
dist/legacy/kitchen-sink.32bb4226.js 1.13kb +0.00b 1.41s -169.00ms 🚀
dist/modern/kitchen-sink.280a0cce.js 1.13kb +0.00b 508.00ms -1.07s 🚀
dist/legacy/index.html 709.00b +0.00b 1.35s +655.00ms ⚠️
dist/modern/index.html 709.00b +0.00b 1.34s +663.00ms ⚠️
dist/legacy/styles.27b3555b.css 29.00b +0.00b 1.23s -95.00ms 🚀
dist/modern/styles.27b3555b.css 29.00b +0.00b 1.23s -237.00ms 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.d5807e82.webp 102.94kb +0.00b 256.00ms -32.00ms 🚀
dist/modern/parcel.d5807e82.webp 102.94kb +0.00b 256.00ms -31.00ms 🚀
dist/legacy/kitchen-sink.32bb4226.js 1.13kb +0.00b 458.00ms -90.00ms 🚀
dist/modern/kitchen-sink.280a0cce.js 1.13kb +0.00b 457.00ms -91.00ms 🚀
dist/legacy/index.html 709.00b +0.00b 467.00ms -83.00ms 🚀
dist/modern/index.html 709.00b +0.00b 456.00ms -92.00ms 🚀
dist/legacy/styles.27b3555b.css 29.00b +0.00b 465.00ms -84.00ms 🚀
dist/modern/styles.27b3555b.css 29.00b +0.00b 457.00ms -91.00ms 🚀

React HackerNews ✅

Timings

Description Time Difference
Cold 9.43s +469.00ms
Cached 2.13s -60.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/main/index.js 66.80kb +0.00b 1.86s -94.00ms 🚀
dist/module/index.js 37.45kb +0.00b 1.85s -93.00ms 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/main/index.js 66.80kb +0.00b 239.00ms -31.00ms 🚀
dist/module/index.js 37.45kb +0.00b 237.00ms -32.00ms 🚀

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 2.71m +3.84s
Cached 4.24s -95.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/esm.0e8b43fc.js 138.52kb +0.00b 21.53s -1.13s 🚀
dist/Toolbar.6f8cd3ff.js 100.33kb +0.00b 1.60m +26.78s ⚠️
dist/component.8fbfb264.js 48.63kb +0.00b 7.25s +784.00ms ⚠️
dist/Modal.d5368b6b.js 41.16kb +0.00b 5.26s +1.06s ⚠️
dist/component.af246da6.js 40.03kb +0.00b 7.14s -576.00ms 🚀
dist/png-chunks-extract.e4f54fbb.js 25.50kb +0.00b 5.26s -2.39s 🚀
dist/js.8ac16e00.js 16.37kb +0.00b 5.24s +1.04s ⚠️
dist/workerHasher.8c8d4944.js 11.69kb +0.00b 19.52s -1.36s 🚀
dist/16.90862dcc.js 10.09kb +0.00b 6.92s +2.72s ⚠️
dist/16.60100d3f.js 9.96kb +0.00b 5.24s +1.04s ⚠️
dist/16.1694dfaa.js 9.88kb +0.00b 5.24s +1.04s ⚠️
dist/16.f8e670d6.js 9.84kb +0.00b 6.92s -730.00ms 🚀
dist/fallback.3ec9aff6.js 9.04kb -58.00b 🚀 12.08s -1.36m 🚀
dist/date.5255341c.js 8.98kb -56.00b 🚀 9.53s -1.36s 🚀
dist/images.c8c2be2c.js 8.87kb +0.00b 10.16s +1.51s ⚠️
dist/feedback.45d69297.js 8.83kb +0.00b 13.52s -1.43s 🚀
dist/list-number.d7602c84.js 8.66kb +0.00b 10.50s +897.00ms ⚠️
dist/code.832029ff.js 8.63kb -56.00b 🚀 8.98s -1.91s 🚀
dist/heading3.5743816c.js 8.54kb -40.00b 🚀 10.50s -1.39m 🚀
dist/link.242cb78d.js 8.50kb -1.00b 🚀 13.50s +4.11s ⚠️
dist/heading6.ef3d0dda.js 8.50kb -15.00b 🚀 12.48s -2.47s 🚀
dist/emoji.20d08155.js 8.48kb -56.00b 🚀 9.74s -1.21s 🚀
dist/heading5.5e9489fc.js 8.37kb +0.00b 13.12s +864.00ms ⚠️
dist/heading2.a9f3b89d.js 8.36kb -9.00b 🚀 13.52s -1.34m 🚀
dist/expand.eede30e9.js 8.35kb -36.00b 🚀 57.30s +42.35s ⚠️
dist/mention.7d593a13.js 8.26kb +45.00b ⚠️ 12.48s +2.65s ⚠️
dist/layout.8f199ec0.js 8.24kb +0.00b 10.50s +1.28s ⚠️
dist/decision.46da8344.js 8.24kb -2.00b 🚀 1.57m +1.39m ⚠️
dist/divider.b334a7db.js 8.22kb +0.00b 9.53s +983.00ms ⚠️
dist/heading1.cba60767.js 8.20kb -3.00b 🚀 8.29s -1.43m 🚀
dist/action.1eab0278.js 8.20kb -19.00b 🚀 9.53s +1.07s ⚠️
dist/panel-warning.0bfad075.js 8.18kb -30.00b 🚀 10.94s -286.00ms
dist/list.9e098d65.js 8.15kb -2.00b 🚀 12.48s +2.66s ⚠️
dist/panel-error.ff0a0ef8.js 8.08kb +56.00b ⚠️ 57.30s +46.50s ⚠️
dist/panel.40a2407b.js 8.07kb +4.00b ⚠️ 57.30s +46.07s ⚠️
dist/table.c864b6cd.js 8.06kb +8.00b ⚠️ 11.51s -327.00ms
dist/panel-success.64c8c730.js 8.02kb +44.00b ⚠️ 11.80s +1.01s ⚠️
dist/16.3330d9a9.js 5.13kb +0.00b 7.50s +379.00ms ⚠️
dist/16.9de5d381.js 5.06kb +0.00b 6.99s +934.00ms ⚠️
dist/16.48b15b02.js 4.78kb +0.00b 10.08s +3.28s ⚠️
dist/16.aaf8ad46.js 4.73kb +0.00b 6.99s +937.00ms ⚠️
dist/16.14a83caf.js 4.71kb +0.00b 8.19s +438.00ms ⚠️
dist/16.47201fe7.js 4.54kb +0.00b 7.50s +573.00ms ⚠️
dist/16.53e8f668.js 4.54kb +0.00b 6.99s +937.00ms ⚠️
dist/16.63ac673c.js 4.53kb +0.00b 10.08s +3.28s ⚠️
dist/16.a28fde19.js 4.53kb +0.00b 10.16s +3.36s ⚠️
dist/16.5e089718.js 4.53kb +0.00b 6.99s +934.00ms ⚠️
dist/16.ff0d21f0.js 4.45kb +0.00b 10.46s +2.86s ⚠️
dist/EmojiPickerComponent.11d65c6e.js 3.72kb +0.00b 21.90s -1.49s 🚀
dist/ak-editor.b0c28b13.css 3.38kb +0.00b 1.62m +26.65s ⚠️
dist/ResourcedEmojiComponent.ea3be745.js 2.21kb +0.00b 6.92s -731.00ms 🚀
dist/workerHasher.33ab7cbb.js 1.56kb +0.00b 19.52s -1.30s 🚀
dist/simpleHasher.6debc0a9.js 524.00b +0.00b 21.54s -1.12s 🚀
dist/EmojiPickerComponent.39e7a3dc.js 467.00b +0.00b 21.90s -1.52s 🚀
dist/index.html 212.00b +0.00b 1.61m +1.59m ⚠️

Cached Bundles

Bundle Size Difference Time Difference
dist/date.5255341c.js 8.98kb -5.00b 🚀 533.00ms -5.00ms
dist/fallback.e3bab85b.js 8.98kb -51.00b 🚀 533.00ms -4.00ms
dist/heading3.5743816c.js 8.54kb -40.00b 🚀 533.00ms -4.00ms
dist/link.242cb78d.js 8.50kb -1.00b 🚀 532.00ms -5.00ms
dist/heading6.ef3d0dda.js 8.50kb -15.00b 🚀 532.00ms -5.00ms
dist/emoji.20d08155.js 8.48kb -56.00b 🚀 533.00ms -4.00ms
dist/heading2.a9f3b89d.js 8.36kb -9.00b 🚀 532.00ms -5.00ms
dist/expand.eede30e9.js 8.35kb -36.00b 🚀 533.00ms -4.00ms
dist/heading4.9b8d918f.js 8.31kb -7.00b 🚀 533.00ms -4.00ms
dist/divider.3a32bdd5.js 8.28kb -19.00b 🚀 532.00ms -5.00ms
dist/mention.7d593a13.js 8.26kb -20.00b 🚀 533.00ms -5.00ms
dist/layout.8f199ec0.js 8.24kb -8.00b 🚀 533.00ms -4.00ms
dist/decision.46da8344.js 8.24kb -15.00b 🚀 533.00ms -5.00ms
dist/heading1.cba60767.js 8.20kb -3.00b 🚀 538.00ms +1.00ms
dist/action.1eab0278.js 8.20kb -19.00b 🚀 533.00ms -5.00ms
dist/panel-warning.0bfad075.js 8.18kb -30.00b 🚀 533.00ms -4.00ms
dist/list.9e098d65.js 8.15kb -2.00b 🚀 533.00ms -5.00ms
dist/panel-error.ff0a0ef8.js 8.08kb +56.00b ⚠️ 533.00ms -4.00ms
dist/panel.40a2407b.js 8.07kb +4.00b ⚠️ 533.00ms -4.00ms
dist/table.c864b6cd.js 8.06kb +8.00b ⚠️ 533.00ms -4.00ms
dist/panel-success.64c8c730.js 8.02kb +44.00b ⚠️ 533.00ms -4.00ms

Three.js x4 🚨

Timings

Description Time Difference
Cold FAILED -0.00ms
Cached FAILED -0.00ms

Cold Bundles

No bundles found, this is probably a failed build...

Cached Bundles

No bundles found, this is probably a failed build...

Click here to view a detailed benchmark overview.

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(
Copy link
Member Author

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.

@mischnic mischnic merged commit 52fd674 into v2 Apr 11, 2020
@mischnic mischnic deleted the html-insert-sibling-order branch April 11, 2020 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants