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

Import versioning #341

Merged
merged 35 commits into from
Jan 23, 2023
Merged

Import versioning #341

merged 35 commits into from
Jan 23, 2023

Conversation

dmail
Copy link
Member

@dmail dmail commented Jan 20, 2023

Fixes #339

Context:

This PR does the following:

  • When importmap are not supported build fallback to systemjs in order to prevent hash cascading while versioning urls
  • When importmap are supported build uses an importmap to version urls preventing hash cascading
  • It's possible to force script type module even when importmap are not supported by passing versioningViaImportMap: false to build

Also in this PR:

  • Better whitespace management when injecting nodes into html
  • Disable rollup minification when minification plugin is not used
  • Ensure rollup take into account runtimeCompat when generating boilerplate code
  • Better output when inspecting a string containing both single and double quotes

@github-actions
Copy link

github-actions bot commented Jan 20, 2023

File size impact

Impact on file sizes when merging import_versioning into main.

dist (+0.4%)
Files new size new gzip size
dist/main.js 878 kB (+4.8 kB / +0.6%) 184 kB (+849 B / +0.5%) ↗️
dist/js/v8_coverage.js 13.7 kB (+46 B / +0.3%) 3.5 kB (+26 B / +0.7%) ↗️
dist/js/execute_using_dynamic_import.js 28.5 kB (-20 B / -0.07%) 6.5 kB (-11 B / -0.2%) ↘️
Unmodified (109) 370 kB (0 B / +0%) 108 kB (0 B / +0%) 👻
Total (112) 1.3 MB (+4.8 kB / +0.4%) 303 kB (+864 B / +0.3%) ↗️
Generated by @jsenv/file-size-impact during file size impact#3987110338 on 0552154

@github-actions
Copy link

github-actions bot commented Jan 20, 2023

Performance impact

Impact on 32 metrics when merging import_versioning into main. Before drawing conclusion, keep in mind performance variability.

package metrics (-0.5%)
Metric Before merge After merge Impact
import duration 0.1 second 0.1 second -0.006 second / -5% ↘️
import memory heap total 4.6 MB 4.6 MB +8.2 kB / +0.2% ↗️
import memory heap used 4.9 MB 5 MB +15.3 kB / +0.3% ↗️
import fs read operations 0 0 👻
npm tarball size 473 kB 475 kB +2 kB / +0.4% ↗️
npm tarball unpacked size 2.2 MB 2.2 MB +9.8 kB / +0.4% ↗️
npm tarball file count 267 267 👻
dev server metrics (+5%)
Metric Before merge After merge Impact
start duration 0.1 second 0.1 second -0.003 second / -2% ↘️
start memory heap total 22.4 MB 22.2 MB -254 kB / -1% ↘️
start memory heap used 5.2 MB 5.2 MB -6 kB / -0.1% ↘️
start fs read 0 0 👻
start fs write 0 0 👻
time to app display 1 second 0.9 second -0.05 second / -5% ↘️
serve app memory heap total 18 MB 18.8 MB +860 kB / +5% ↗️
serve app memory heap used 14.9 MB 14.9 MB +36.4 kB / +0.2% ↗️
serve app fs read 0 0 👻
serve app fs write 0 0 👻
time to 2nd app display 0.5 second 0.5 second +0.007 second / +1% ↗️
2nd serve memory heap total 3 MB 4.1 MB +1 MB / +35% ↗️
2nd serve memory heap used 1.1 MB 1.3 MB +135 kB / +12% ↗️
2nd serve fs read 0 0 👻
2nd serve fs write 0 0 👻
build metrics (+24%)
Metric Before merge After merge Impact
build duration 0.6 second 1 second +0.4 second / +60% ↗️
build memory heap total 41.3 MB 44.1 MB +2.7 MB / +7% ↗️
build memory heap used 23.9 MB 22.6 MB -1.3 MB / -6% ↘️
number of fs read operation 0 0 👻
number of fs write operation 48 64 +16 / +33% ↗️
test metrics (+1%)
Metric Before merge After merge Impact
test plan duration 5.5 seconds 5.4 seconds -0.09 second / -2% ↘️
test plan memory heap total 73 MB 78 MB +5 MB / +7% ↗️
test plan memory heap used 32.9 MB 32.9 MB -7.3 kB / -0.02% ↘️
number of fs read operation 0 0 👻
number of fs write operation 32 32 👻
Generated by @jsenv/performance-impact during performance_impact#3987110351 on 0552154

@dmail dmail marked this pull request as ready for review January 23, 2023 11:01
@dmail dmail merged commit bde1d99 into main Jan 23, 2023
@dmail dmail deleted the import_versioning branch January 23, 2023 15:44
@dmail
Copy link
Member Author

dmail commented Jan 26, 2023

The following perf change

build duration | 0.6 second | 1 second | +0.4 second / +60%

is because now the build is using systemjs by default instead of js modules, which takes more time (more changes required on source code to obtain dist files)

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.

Static import versioning
1 participant