feat: add vanilla-extract support with Parcel 2.10.0 upgrade#1337
Open
flex-minhyeok wants to merge 1 commit intoPlasmoHQ:mainfrom
Open
feat: add vanilla-extract support with Parcel 2.10.0 upgrade#1337flex-minhyeok wants to merge 1 commit intoPlasmoHQ:mainfrom
flex-minhyeok wants to merge 1 commit intoPlasmoHQ:mainfrom
Conversation
771423c to
70d3c3b
Compare
Upgrade Parcel from 2.9.3 to 2.10.0 to support node: protocol imports required by vanilla-extract. Add @vanilla-extract/parcel-transformer and configure it to handle *.css.ts files. - Upgrade @parcel/* packages to 2.10.0 (except @parcel/graph and @parcel/hash which remain at 2.9.3) - Add @vanilla-extract/parcel-transformer 1.0.17 dependency - Configure *.css.ts transformer in parcel-config - Add with-vanilla-extract example
70d3c3b to
246ad40
Compare
Author
|
@louisgv plz review this PR! |
Author
|
@louisgv I'd appreciate it if you could review this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for vanilla-extract CSS-in-TypeScript library to Plasmo, enabling developers to write type-safe, zero-runtime CSS.
Changes
1. Custom Parcel Transformer (
@plasmohq/parcel-transformer-vanilla-extract)Created a new transformer package that:
@vanilla-extract/integrationfor CSS compilation.css.tsfiles at build timeImplementation:
core/parcel-transformer-vanilla-extract/2. Parcel Upgrade (2.9.3 → 2.10.0)
Upgraded Parcel to version 2.10.0 to enable
node:protocol support, which is required for vanilla-extract dependencies.Why this was necessary:
@vanilla-extract/integrationusesmllymllyimports Node.js builtins with thenode:protocol (e.g.,require('node:module'))node:prefix in module resolutionSee
PARCEL_UPGRADE.mdfor detailed documentation of the upgrade rationale.Changed packages:
@parcel/*packages upgraded from 2.9.3 to 2.10.03. Example:
with-vanilla-extractAdded a complete example demonstrating:
.parcelrcconfigurationExample structure:
4. Core Configuration Update
Modified
core/parcel-config/index.jsonto include the vanilla-extract transformer in the default Plasmo configuration:{ "transformers": { "*.css.ts": ["@plasmohq/parcel-transformer-vanilla-extract"] } }5. Example
with-vanilla-extract example PR: PlasmoHQ/examples#86
Breaking Changes
None. The Parcel upgrade is backward compatible and all existing examples continue to work.
Related
node:prefix for CJS dependencies parcel-bundler/parcel#9244node:should always be a builtin parcel-bundler/parcel#9250