-
Notifications
You must be signed in to change notification settings - Fork 292
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
Add createCompiler
to integration package
#1030
Conversation
🦋 Changeset detectedLatest commit: 06cb763 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
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 |
createCompiler
functioncreateCompiler
to integration package
packages/integration/src/compiler.ts
Outdated
getIdentOption: () => identifiers, | ||
onBeginFileScope: (fileScope) => { | ||
// Before evaluating a file, reset the cache for it | ||
cssByFileScope.set(fileScope.filePath, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should scope the cache to include packageName from the filescope
packages/integration/src/compiler.ts
Outdated
for (const importedModule of moduleNode.importedModules) { | ||
queue.push(importedModule); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (const importedModule of moduleNode.importedModules) { | |
queue.push(importedModule); | |
} | |
queue.push(...moduleNode.importedModules); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 🚀 🍻
This PR adds a new compiler to the integration package, powered by vite-node.
This allows us to cache results across builds which can dramatically improve build performance, particularly for esbuild consumers since it doesn't automatically manage caching of plugins.
I've also added a new esbuild plugin that makes use of the new compiler, but it's been marked as private for now. This allows us to run tests and fixtures against the new plugin without forcing us to release it immediately. In the meantime, since Remix uses
@vanilla-extract/integration
directly, Remix will be able to roll out the new Vanilla Extract compiler immediately without waiting for all official plugins to be migrated.You can run a fixture against the new compiler like this: