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: dependency processing race condition #565

Merged
merged 10 commits into from Feb 9, 2019

Conversation

Projects
None yet
2 participants
@tivac
Copy link
Owner

commented Feb 9, 2019

Description

Ensure that walking the tree has completed before allowing exports/dependency information to be flattened.

Motivation and Context

If you called processor.string() or processor.file() on two files with shared dependencies w/o waiting for the first file to complete it's walk of the tree you could get random errors that made no sense.

How Has This Been Tested?

Added a svelte & non-svelte test for it.

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 Feb 8, 2019

test: fix a typo
(still fails though, fortunately)
fix: wait for files to be fully walked
Instead of just waiting for the first postcss pass.
test: add another test for this w/o svelte
Since the bug isn't technically *in* the svelte preprocessor

@tivac tivac self-assigned this Feb 9, 2019

@codecov

This comment has been minimized.

Copy link

commented Feb 9, 2019

Codecov Report

Merging #565 into master will decrease coverage by 0.08%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #565      +/-   ##
==========================================
- Coverage   99.06%   98.97%   -0.09%     
==========================================
  Files          49       49              
  Lines        1173     1176       +3     
  Branches      183      183              
==========================================
+ Hits         1162     1164       +2     
- Misses         11       12       +1
Impacted Files Coverage Δ
packages/processor/processor.js 100% <100%> (ø) ⬆️
packages/svelte/svelte.js 100% <100%> (ø) ⬆️
packages/webpack/loader.js 91.66% <0%> (-4.17%) ⬇️

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 a4a6cf6...10f7c9f. Read the comment docs.

@tivac tivac merged commit 436c1c8 into master Feb 9, 2019

6 of 9 checks passed

Header rules No header rules processed
Details
Pages changed 3 new files uploaded
Details
Redirect rules No redirect rules processed
Details
Mixed content No mixed content detected
Details
codecov/patch 100% of diff hit (target 99.06%)
Details
codecov/project Absolute coverage decreased by -0.08% but relative coverage increased by +0.93% compared to a4a6cf6
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 svelte-race-condition branch Feb 9, 2019

@deflock

This comment has been minimized.

Copy link

commented Mar 2, 2019

I'm not sure if this is related, but sometimes I get Error: Use process(css).then(cb) to work with async plugins when using postcss-import in before.

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.