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

Restrict VanillaExtract plugin to playroom's source .css.ts files only #377

Merged

Conversation

AntoLepejian
Copy link
Contributor

@AntoLepejian AntoLepejian commented Nov 7, 2024

Problem

Playroom uses VanillaExtract to extract and process CSS files, specifically .css.ts files. While the webpack loader rule correctly limits the scope of this loader on playroom's own source code, the plugin itself isn't scoped, and as such, it sends up processing every single .css.[t|j]s file it can find, including those from the consumer's codebase, node_modules, etc..

This problematic, and leads to a whole range of issues, making Playroom unusable if your UI Library has .css.[j|t]s files, or even if one of your dependencies has it.

I haven't found any mention of the plugin being scoped to the entire project by default, as their documentation page is non-exhaustive, however I can confirm this to be the case.

Solution

Correctly scope the plugin to Playroom's own .css.ts files only.

Copy link

changeset-bot bot commented Nov 7, 2024

🦋 Changeset detected

Latest commit: f48d80d

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

This PR includes changesets to release 1 package
Name Type
playroom 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

@AntoLepejian AntoLepejian marked this pull request as ready for review November 7, 2024 12:33
@AntoLepejian AntoLepejian requested a review from a team as a code owner November 7, 2024 12:33
@AntoLepejian
Copy link
Contributor Author

@askoufis I have one more here :)

.changeset/slow-plums-bake.md Outdated Show resolved Hide resolved
lib/makeWebpackConfig.js Outdated Show resolved Hide resolved
lib/makeWebpackConfig.js Outdated Show resolved Hide resolved
lib/makeWebpackConfig.js Outdated Show resolved Hide resolved
lib/makeWebpackConfig.js Outdated Show resolved Hide resolved
Copy link
Contributor

@askoufis askoufis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've never had any issues using playroom alongside a library that contains .css.ts files. However, this change seems sensible regardless of that fact. Thanks.

@askoufis askoufis enabled auto-merge (squash) November 18, 2024 04:40
@askoufis askoufis merged commit fb14616 into seek-oss:master Nov 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants