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

Improve server index file matching #8957

Merged
merged 4 commits into from
May 12, 2023
Merged

Improve server index file matching #8957

merged 4 commits into from
May 12, 2023

Conversation

mischnic
Copy link
Member

Closes #4638
Closes #4429
Closes #4740

Makes the dev server behave more like normal servers for fallback/index files (= where there's no exact match for the complete request file path) while still supporting SPAs:
/foo/bar/xyz will try to use these files

  1. /foo/bar/xyz.html
  2. /foo/bar/index.html
  3. /foo/index.html
  4. /index.html

Some choices:

  • /foo doesn't match /foo/index.html, you need /foo/ for that (this would otherwise break relative URLs)
  • If there is only one HTML bundle, the existing behaviour of serving that HTML regardless of the request is still used.
  • Consequently, if you have multiple HTML bundles and none of them is an index somewhere up in the folder hierarchy (see list above), you still need to explicitly specify /nameOfHtmlFile or /nameOfHtmlFile.html.

Example

With these files:

packages/core/integration-tests/test/integration/html
├── index.html
├── other.html
└── foo
    ├── index.html
    └── other.html
request served file
/ /index.html
/something /index.html
/other /other.html
/foo /index.html
/foo/ /foo/index.html
/foo/bar /foo/index.html
/foo/other /foo/other.html

@parcel-benchmark
Copy link

parcel-benchmark commented Apr 21, 2023

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 1.89s -186.00ms 🚀
Cached 430.00ms +59.00ms ⚠️

Cold Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 290.00ms -19.00ms 🚀
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 291.00ms -19.00ms 🚀
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 291.00ms -19.00ms 🚀
dist/legacy/index.b8ae99ba.css 94.00b +0.00b 302.00ms -20.00ms 🚀
dist/modern/index.31cedca9.css 94.00b +0.00b 301.00ms -20.00ms 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/legacy/index.7d75205b.js 1.63kb +0.00b 482.00ms -47.00ms 🚀
dist/legacy/index.d20f91ee.js 1.19kb +0.00b 481.00ms -45.00ms 🚀
dist/modern/index.1ee30fe4.js 1.12kb +0.00b 481.00ms -45.00ms 🚀
dist/legacy/index.html 826.00b +0.00b 534.00ms -49.00ms 🚀
dist/modern/index.html 749.00b +0.00b 532.00ms -50.00ms 🚀

React HackerNews ✅

Timings

Description Time Difference
Cold 8.23s -131.00ms
Cached 538.00ms +42.00ms ⚠️

Cold Bundles

No bundle changes detected.

Cached Bundles

Bundle Size Difference Time Difference
dist/logo.8dd07848.png 244.00b +0.00b 410.00ms -25.00ms 🚀

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 1.21m -2.05s
Cached 2.61s +215.00ms ⚠️

Cold Bundles

Bundle Size Difference Time Difference
dist/pdfRenderer.4f3765de.js 1.11mb +0.00b 14.78s -807.00ms 🚀
dist/mobile-upload.35a8a8fb.js 66.63kb +0.00b 6.23s -426.00ms 🚀
dist/component-lazy.fbe36021.js 60.43kb +0.00b 6.54s -1.22s 🚀
dist/component.ed5e14de.js 58.26kb +0.00b 6.21s -428.00ms 🚀
dist/DatePicker.3a60f244.js 48.38kb +0.00b 7.28s -504.00ms 🚀
dist/Modal.5a46ad55.js 28.45kb +0.00b 6.21s -418.00ms 🚀
dist/DatePicker.b0a4d8f4.js 25.21kb +0.00b 7.28s -505.00ms 🚀
dist/component.1c22aee9.js 18.81kb +0.00b 6.21s -428.00ms 🚀
dist/js.324be058.js 17.34kb +0.00b 6.21s -419.00ms 🚀
dist/mobile-upload.93995326.js 8.08kb +0.00b 6.21s -422.00ms 🚀
dist/index.b16227d6.css 4.08kb +0.00b 13.32s -774.00ms 🚀
dist/Modal.4d03aeec.js 3.79kb +0.00b 6.21s -419.00ms 🚀
dist/component.9a535981.js 3.42kb +0.00b 6.21s -423.00ms 🚀
dist/png-chunks-extract.c54842d7.js 3.19kb +0.00b 6.21s -422.00ms 🚀
dist/ru.896915b9.js 2.94kb +0.00b 7.28s -501.00ms 🚀
dist/ResourcedEmojiComponent.14618802.js 2.68kb +0.00b 7.28s -504.00ms 🚀
dist/pl.5f36d63e.js 2.38kb +0.00b 7.28s -501.00ms 🚀
dist/cs.971d1d60.js 2.36kb +0.00b 7.28s -505.00ms 🚀
dist/de.6efbb375.js 2.30kb +0.00b 7.28s -505.00ms 🚀
dist/fr.af2c92ae.js 2.25kb +0.00b 7.28s -502.00ms 🚀
dist/es.23f0c164.js 2.25kb +0.00b 7.28s -504.00ms 🚀
dist/hu.8323f36b.js 2.23kb +0.00b 7.28s -502.00ms 🚀
dist/fi.7ed4b1b5.js 2.22kb +0.00b 7.28s -501.00ms 🚀
dist/ja.5653161c.js 2.22kb +0.00b 7.28s -501.00ms 🚀
dist/pt_BR.eccfad73.js 2.19kb +0.00b 7.28s -501.00ms 🚀
dist/ko.2cf2bbda.js 2.11kb +0.00b 7.28s -501.00ms 🚀
dist/it.601d375a.js 2.10kb +0.00b 7.28s -501.00ms 🚀
dist/nb.b300dd3e.js 2.09kb +0.00b 7.28s -502.00ms 🚀
dist/date.7b2f9581.js 2.07kb +0.00b 6.54s -422.00ms 🚀
dist/da.21385cf2.js 2.07kb +0.00b 7.28s -504.00ms 🚀
dist/nl.3999ea58.js 2.07kb +0.00b 7.28s -502.00ms 🚀
dist/images.46c877f3.js 2.03kb +0.00b 6.54s -421.00ms 🚀
dist/feedback.fd1f6260.js 1.89kb +0.00b 7.28s -503.00ms 🚀
dist/status.6f638b3d.js 1.80kb +0.00b 6.54s -422.00ms 🚀
dist/workerHasher.be59eb41.js 1.72kb +0.00b 6.21s -422.00ms 🚀
dist/code.ef3dfa9c.js 1.69kb +0.00b 6.54s -422.00ms 🚀
dist/list-number.35bc7f17.js 1.60kb +0.00b 6.54s -421.00ms 🚀
dist/heading6.974f167d.js 1.49kb +0.00b 7.28s -504.00ms 🚀
dist/16.87c743d1.js 1.48kb +0.00b 6.22s -415.00ms 🚀
dist/heading3.9ad47cbe.js 1.48kb +0.00b 6.55s -417.00ms 🚀
dist/16.dd50aef4.js 1.41kb +0.00b 6.21s -428.00ms 🚀
dist/link.542e87bf.js 1.41kb +0.00b 6.54s -421.00ms 🚀
dist/emoji.79757e2c.js 1.38kb +0.00b 6.54s -420.00ms 🚀
dist/heading5.023a8f1f.js 1.36kb +0.00b 6.55s -417.00ms 🚀
dist/expand.801fc3a0.js 1.31kb +0.00b 7.28s -503.00ms 🚀
dist/heading2.bffcdf12.js 1.30kb +0.00b 6.54s -421.00ms 🚀
dist/heading4.05995ed9.js 1.25kb +0.00b 6.55s -417.00ms 🚀
dist/mention.adafe481.js 1.21kb +0.00b 6.54s -420.00ms 🚀
dist/layout.40f6b132.js 1.17kb +0.00b 6.54s -421.00ms 🚀
dist/divider.616b37d8.js 1.17kb +0.00b 6.54s -421.00ms 🚀
dist/action.361730a6.js 1.15kb +0.00b 6.54s -421.00ms 🚀
dist/heading1.495af5dc.js 1.14kb +0.00b 6.54s -422.00ms 🚀
dist/16.9e7cc0d9.js 1.13kb +0.00b 6.22s -415.00ms 🚀
dist/list.c5ad55b6.js 1.11kb +0.00b 6.54s -421.00ms 🚀
dist/quote.235ab420.js 1.11kb +0.00b 6.54s -421.00ms 🚀
dist/decision.36a0b771.js 1.10kb +0.00b 6.54s -421.00ms 🚀
dist/16.8d078bd1.js 1.08kb +0.00b 6.21s -429.00ms 🚀
dist/16.bb53313d.js 1.08kb +0.00b 6.21s -427.00ms 🚀
dist/panel-warning.7e72ad42.js 1.07kb +0.00b 6.54s -422.00ms 🚀
dist/16.88e24f19.js 1.06kb +0.00b 6.21s -428.00ms 🚀
dist/16.0d8c3c9e.js 1.06kb +0.00b 6.54s -422.00ms 🚀
dist/table.389f0908.js 1.05kb +0.00b 6.54s -422.00ms 🚀
dist/16.db9c75f1.js 1.03kb +0.00b 6.23s -427.00ms 🚀
dist/panel.7cee1972.js 1017.00b +0.00b 6.54s -422.00ms 🚀
dist/panel-error.e46252ff.js 994.00b +0.00b 6.54s -421.00ms 🚀
dist/16.c0880b62.js 992.00b +0.00b 6.22s -427.00ms 🚀
dist/16.99296be0.js 964.00b +0.00b 6.23s -427.00ms 🚀
dist/16.c16ee42d.js 957.00b +0.00b 6.21s -428.00ms 🚀
dist/16.dcf139e7.js 951.00b +0.00b 6.54s -422.00ms 🚀
dist/panel-success.dbd2515b.js 935.00b +0.00b 6.54s -422.00ms 🚀
dist/panel-note.b6c94ff5.js 925.00b +0.00b 6.54s -422.00ms 🚀
dist/16.26c3d518.js 912.00b +0.00b 6.23s -414.00ms 🚀
dist/16.f76b9cae.js 906.00b +0.00b 6.21s -428.00ms 🚀
dist/16.fb327623.js 906.00b +0.00b 6.23s -413.00ms 🚀
dist/16.f2056258.js 905.00b +0.00b 6.22s -415.00ms 🚀
dist/16.4e7dec68.js 904.00b +0.00b 6.21s -428.00ms 🚀
dist/16.400116d9.js 903.00b +0.00b 6.21s -428.00ms 🚀
dist/16.f6395317.js 876.00b +0.00b 6.54s -421.00ms 🚀
dist/16.24326b68.js 855.00b +0.00b 6.21s -428.00ms 🚀
dist/16.0285f4b2.js 827.00b +0.00b 6.23s -427.00ms 🚀
dist/sk.101f1705.js 786.00b +0.00b 7.28s -2.99s 🚀
dist/pt_PT.402f9c4e.js 765.00b +0.00b 7.28s -501.00ms 🚀
dist/et.69382942.js 763.00b +0.00b 7.28s -503.00ms 🚀
dist/simpleHasher.395b29e6.js 687.00b +0.00b 6.21s -421.00ms 🚀
dist/is.5b945719.js 625.00b +0.00b 7.28s -502.00ms 🚀
dist/ro.a6eff34a.js 612.00b +0.00b 7.28s -501.00ms 🚀
dist/en_GB.61f7112a.js 602.00b +0.00b 7.28s -505.00ms 🚀
dist/en.41261459.js 599.00b +0.00b 7.28s -505.00ms 🚀
dist/index.html 240.00b +0.00b 6.16s -370.00ms 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/editorView.50462df3.js 622.34kb +0.00b 16.19s -1.04s 🚀
dist/EmojiPickerComponent.11881429.js 196.52kb +0.00b 9.95s -2.24s 🚀
dist/component-lazy.fbe36021.js 60.43kb +0.00b 6.85s -812.00ms 🚀
dist/codeViewerRenderer.915ef6b3.js 2.84kb +0.00b 9.95s -3.67s 🚀
dist/pt_BR.eccfad73.js 2.19kb +0.00b 9.68s +2.00s ⚠️
dist/heading4.05995ed9.js 1.25kb +0.00b 6.85s -808.00ms 🚀
dist/pt_PT.402f9c4e.js 765.00b +0.00b 7.64s -1.82s 🚀

Three.js ✅

Timings

Description Time Difference
Cold 5.74s -29.00ms
Cached 316.00ms -5.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

Bundle Size Difference Time Difference
dist/Three.js 572.22kb +0.00b 1.12s -169.00ms 🚀

Click here to view a detailed benchmark overview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants