-
Notifications
You must be signed in to change notification settings - Fork 296
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
feat: integration callbacks #942
base: master
Are you sure you want to change the base?
feat: integration callbacks #942
Conversation
feat: onEvaluated pass filePath as 3rd arg
… using processVanillaFile feat(vite-plugin): forceEmitCssInSsrBuild option types(vite-plugin): export VanillaExtractPluginOptions feat(processVanillaFile): add filePath as arg to serializeVanillaModule
🦋 Changeset detectedLatest commit: dab0f25 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 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 |
vanilla-extract-css/vanilla-extract#942 & inline ve/vite-plugin (since it's not working with the tgz, no idea why)
You should add a changeset, it will likely be brought up when maintainers get to this so having it done beforehand is best. |
news about this ? |
hey ! i'll try to summarize from my side:
but that approach still relied on tranforming the src code to replace it with the generated class names, meaning an extra integration should be made in each bundler (vite, esbuild, webpack, etc etc). I thought of unplugin but it doesn't support everything yet, ex: nested plugins (which I relied upon a lot) still, even though it was a nice PoC of the static extraction then I received a message from a maintainer of well-known organization and I've been working these past weeks on a similar solution than tl;dr: I think it still could be of use to some people but not to me at this point so feel free to close this PR |
Sad ending then. Thank you for the updates, I hope maintainers are OK since they do not respond much :| . Can't wait to test your vanilla-wind v2. |
FWIW, Panda CSS is the new project that I was working on and that became public in the last days |
hey, I made a vite plugin that allows purging any unused style generated by vanilla-extract/sprinkles
https://twitter.com/astahmer_dev/status/1601244606133567488
it needs some minor changes (mostly onEvaluated+serializeVanillaModule callbacks for the integration package + forceEmitCssInSsrBuild option for the vite plugin)
this PR adds:
onEvaluated
callback topackages/integration/src/processVanillaFile.ts
(very similar to what was proposed here)serializeVanillaModule
callback topackages/integration/src/processVanillaFile.ts
, pretty much like the currentserializeVirtualCssPath
callback, it allows customizing the behaviourserializeVanillaModule
processVanillaFile
callProcessVanillaFileOptions
&SprinklesProperties
typeAdapterContext
(which is just a reference to the result of the adapter after theevalCode
ofprocessVanillaFile
so anyone can retrieve the generated class names / CSS rules by file scopesforceEmitCssInSsrBuild
option for the vite plugin (needed to make the HMR work with vite-plugin-ssr), would probably allow removing the hard-coded checks (['astro:build', 'solid-start-server', 'vite-plugin-qwik'].includes()
)let me know if there's any questions or things you'd like to see