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

fix(rollup-rewriter): include static dependencies #577

Merged
merged 4 commits into from Apr 3, 2019

Conversation

Projects
None yet
2 participants
@tivac
Copy link
Owner

commented Apr 2, 2019

Description

At dayjob ™️ a coworker ran into an issue where a dynamically loaded chunk that was being rewritten to include its CSS deps some of those deps were missing. Turns out that @modular-css/rollup-rewriter didn't include the CSS required by any static imports contained within the dynamic import chunk entry point.

So now it does.

Motivation and Context

Dynamic chunk entrypoints that have static dependencies that include CSS should be properly loaded.

How Has This Been Tested?

Added specimens & a test. Verified it failed before this change, then passes afterwards.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

tivac added some commits Apr 2, 2019

test: add failing test for rewriter bug
It's not including dependencies of any static imports for the dynamic modules being found, which means that depending on your flow you can end up with incomplete styling.
fix: include static imports of dynamic deps
So every CSS file is included before the dynamic chunk is loaded
test: tweak snapshot output to match
Doesn't change functionality, which is still accurate

@tivac tivac self-assigned this Apr 2, 2019

@codecov

This comment has been minimized.

Copy link

commented Apr 2, 2019

Codecov Report

Merging #577 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #577   +/-   ##
=======================================
  Coverage   98.89%   98.89%           
=======================================
  Files          47       47           
  Lines        1178     1178           
  Branches      183      183           
=======================================
  Hits         1165     1165           
  Misses         13       13
Impacted Files Coverage Δ
packages/rollup-rewriter/rewriter.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ec746a9...b5290de. Read the comment docs.

@codecov

This comment has been minimized.

Copy link

commented Apr 2, 2019

Codecov Report

Merging #577 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #577   +/-   ##
=======================================
  Coverage   98.89%   98.89%           
=======================================
  Files          47       47           
  Lines        1178     1178           
  Branches      183      183           
=======================================
  Hits         1165     1165           
  Misses         13       13
Impacted Files Coverage Δ
packages/rollup-rewriter/rewriter.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ec746a9...bf72854. Read the comment docs.

@TravisBuddy

This comment has been minimized.

Copy link

commented Apr 3, 2019

Hey @tivac,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: c4d7a230-55d2-11e9-bc42-792bcead230c

@tivac tivac merged commit ca499c6 into master Apr 3, 2019

6 of 9 checks passed

Header rules No header rules processed
Details
Pages changed All files already uploaded
Details
Redirect rules No redirect rules processed
Details
Mixed content No mixed content detected
Details
codecov/patch 100% of diff hit (target 98.89%)
Details
codecov/project 98.89% (+0%) compared to ec746a9
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details

@tivac tivac deleted the rewriter-dependencies branch Apr 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.