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 assertions #212

Merged
merged 130 commits into from
Oct 14, 2021
Merged

Import assertions #212

merged 130 commits into from
Oct 14, 2021

Conversation

dmail
Copy link
Member

@dmail dmail commented Oct 10, 2021

Fixes #211

TODO list:

  • Do not write css file when it's only referenced by js import assertion
  • Ensure soucemap url for css inlined in js targets the css sourcemap file
  • Test inline js importing css with import assertion
  • Test inline js referencing css with import.meta.url
  • Write babel plugin replacing import assertion with the query string param
  • Update jsenv browser system to wrap server response when ?import_type is in the module url
  • Test js importing css with launchChromium and launchFirefox
  • Test with stylesheet polyfill https://github.com/calebdwilliams/construct-style-sheets
  • Add check for css import assertion at the bottom of getFeatureReport
  • Add check for json import assertion at the bottom of getFeatureReport
  • Write a test using dynamic import (https://github.com/tc39/proposal-import-assertions#dynamic-import)
    • If that's not supported for some reason (rollup or something don't like that) then we should throw an error explaining
  • Write a test where css is imported both by js and html
  • Update @jsenv/template-pwa We'll see later

Changes

  • Rename launchNode into nodeRuntime (same for browsers)
  • launch becomes runtime, launchParams -> runtimeParams
  • Support css and json import assertions
  • Compile server now detect runtimeSupport from testPlan
  • Restructure many test files
  • Improve response validation code and error messages
  • Update some deps
  • Ensure inline scripts gets a sourcemap comment as well
  • Ensure sourcemap file are properly versioned too

@dmail dmail self-assigned this Oct 10, 2021
@github-actions
Copy link

github-actions bot commented Oct 10, 2021

Performance impact

Impact on 15 metrics when merging import_type_css into master. Before drawing conclusion, keep in mind performance variability.

package metrics
Metric Before merge After merge Impact
npm tarball size 525.79 KB 544.38 KB +18.59 KB / +3.53% ↗️
npm tarball unpacked size 2.09 MB 2.16 MB +79.28 KB / +3.71% ↗️
npm tarball file count 379 387 +8 / +2.11% ↗️
dev server metrics
Metric Before merge After merge Impact
start duration 0.594 seconds 0.6 seconds +0.006 seconds / +1.01% ↗️
dev server memory heap used 8.74 MB 8.83 MB +91.27 KB / +1.02% ↗️
number of fs read operation 0 0 👻
number of fs write operation 24 24 👻
build metrics
Metric Before merge After merge Impact
build duration 1.53 seconds 1.55 seconds +0.013 seconds / +0.88% ↗️
build memory heap used 42.96 MB 43.56 MB +620.26 KB / +1.41% ↗️
number of fs read operation 0 0 👻
number of fs write operation 152 152 👻
test metrics
Metric Before merge After merge Impact
test plan duration 16.32 seconds 17.46 seconds +1.13 seconds / +6.97% ↗️
test plan memory heap used 44.88 MB 47.59 MB +2.71 MB / +6.04% ↗️
number of fs read operation 0 0 👻
number of fs write operation 8352 8432 +80 / +0.96% ↗️
Generated by @jsenv/performance-impact during performance_impact#1342708727 on 69b98b6

@codecov
Copy link

codecov bot commented Oct 14, 2021

Codecov Report

Merging #212 (138d748) into master (d1c5738) will increase coverage by 0.36%.
The diff coverage is 86.94%.

❗ Current head 138d748 differs from pull request most recent head 69b98b6. Consider uploading reports for the commit 69b98b6 to get more accurate results

@dmail dmail marked this pull request as ready for review October 14, 2021 15:55
@dmail dmail merged commit 563b8fb into master Oct 14, 2021
@dmail dmail deleted the import_type_css branch October 14, 2021 16:46
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.

import assertions (especially for CSS)
1 participant