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

Vite updates & invalidation fixes #972

Merged
merged 8 commits into from
Sep 26, 2023
Merged

Vite updates & invalidation fixes #972

merged 8 commits into from
Sep 26, 2023

Conversation

tivac
Copy link
Owner

@tivac tivac commented Sep 25, 2023

Description

Working to make vite reloading more reliable, especially around dependencies. Also fixing an issue that could leave stale compositions around when re-running the processor against invalidated files.

Motivation and Context

vite reload behavior has been extremely annoying at my day job.

How Has This Been Tested?

Manual testing only so far.

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.
  • I have added a changeset for my change.

- Invalidating a file invalidates all of it's selectors _AND_ values now
- When a file is re-walked all selector and value dependencies are removed, so they can be re-added by the walk with the latest information
Handling a few edge cases
@changeset-bot
Copy link

changeset-bot bot commented Sep 25, 2023

🦋 Changeset detected

Latest commit: 811f50b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@modular-css/processor Patch
@modular-css/vite Patch
@modular-css/browserify Patch
@modular-css/cli Patch
@modular-css/css-to-js Patch
@modular-css/glob Patch
@modular-css/postcss Patch
@modular-css/rollup Patch
@modular-css/svelte Patch
@modular-css/webpack Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ghost
Copy link

ghost commented Sep 25, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@netlify
Copy link

netlify bot commented Sep 25, 2023

Deploy Preview for m-css ready!

Name Link
🔨 Latest commit 811f50b
🔍 Latest deploy log https://app.netlify.com/sites/m-css/deploys/6512337926338b000804dc11
😎 Deploy Preview https://deploy-preview-972--m-css.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (4fa842e) 99.72% compared to head (811f50b) 99.72%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #972   +/-   ##
=======================================
  Coverage   99.72%   99.72%           
=======================================
  Files          37       37           
  Lines        1441     1452   +11     
  Branches      237      240    +3     
=======================================
+ Hits         1437     1448   +11     
  Misses          4        4           
Files Coverage Δ
packages/processor/processor.js 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Was previously doing all the files _upstream_ of the changed file, but the correct direction is **downstream**.
It happens when a file is re-walked now, instead of per-selector during addSelector. This approach ensures that a) @value are cleared out and b) removed selectors are also cleared out
@tivac tivac merged commit 673df5d into main Sep 26, 2023
11 checks passed
@tivac tivac deleted the vite-updates branch September 26, 2023 01:31
@github-actions github-actions bot mentioned this pull request Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant