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

Remove duplicate script downloads in firefox #8346

Merged
merged 1 commit into from Jul 31, 2022
Merged

Conversation

AGawrys
Copy link
Contributor

@AGawrys AGawrys commented Jul 29, 2022

↪️ Pull Request

In Firefox, we notice duplicate .js scripts being downloaded. Once from preload, and then second as the async script. Even though Firefox does support link rel=preload, removing the charset seemed to fix it. script.charset is also deprecated.

This might be a bug with mozilla, so I'll file that and link it here once created.

💻 Examples

Tested with medium sized app, will add smaller repro.

duplicate_assets

The first is a result of document.head.appendChild(preloadLink); in the jsloader and the second, from document.getElementsByTagName('head')[0].appendChild(script); also in the jsloader.

🚨 Test instructions

None of our tests test this, repro to be added. Also I didn't see any issues in Chrome with this change

✔️ PR Todo

  • Included links to related issues/PRs
  • Add repro

@parcel-benchmark
Copy link

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 1.44s +20.00ms
Cached 316.00ms -9.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

React HackerNews ✅

Timings

Description Time Difference
Cold 8.66s -55.00ms
Cached 426.00ms -15.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/index.js 486.39kb -18.00b 🚀 4.42s -30.00ms

Cached Bundles

Bundle Size Difference Time Difference
dist/index.js 486.39kb -18.00b 🚀 4.39s +1.00ms
dist/logo.c5bb83f1.png 246.00b +0.00b 4.35s +553.00ms ⚠️

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 1.45m +393.00ms
Cached 2.39s +11.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/esm.c7dc1640.js 61.96kb +0.00b 35.58s -28.57s 🚀
dist/workerHasher.e50d242f.js 1.72kb +0.00b 35.58s -28.60s 🚀
dist/16.1969624f.js 1.08kb +0.00b 32.07s -3.28s 🚀
dist/index.html 240.00b +0.00b 31.06s -3.87s 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/16.069344b7.js 905.00b +0.00b 32.86s -2.62s 🚀
dist/simpleHasher.46d6f2e5.js 742.00b +0.00b 36.32s -27.58s 🚀
dist/index.html 240.00b +0.00b 28.84s -2.25s 🚀

Three.js ✅

Timings

Description Time Difference
Cold 6.29s +9.00ms
Cached 271.00ms +12.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

@devongovett devongovett merged commit bb680cb into v2 Jul 31, 2022
@devongovett devongovett deleted the duplicate-js-in-firefox branch July 31, 2022 16:07
gorakong pushed a commit that referenced this pull request Nov 3, 2022
* upstream/v2: (22 commits)
  Cross compile toolchains are built into docker image already
  Also fix release build
  Update centos node version
  v2.7.0
  Changelog for v2.7.0
  Use placeholder expression when replacing unused symbols (#8358)
  Lint (#8359)
  Add support for errorRecovery option in @parcel/transformer-css (#8352)
  VS Code Extension for Parcel (#8139)
  Add multi module compilation for elm (#8076)
  Bump terser from 5.7.2 to 5.14.2 (#8322)
  Bump node-forge from 1.2.1 to 1.3.0 (#8271)
  allow cjs config files on type module projects (#8253)
  inject script for hmr when there is only normal script in html (#8330)
  feat: support react refresh for @emotion/react (#8205)
  Update index.d.ts (#8293)
  remove charset from jsloader script set (#8346)
  Log resolved targets in verbose log level (#8254)
  Fix missing module in large app from Experimental Bundler (#8303)
  [Symbol Propagation] Non-deterministic bundle hashes (#8212)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants