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

Add onFileCompiled callback #865

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DanielHeath
Copy link

Per #864

This hook lets users supply the missing piece for integration with non-javascript backends - recording the class-name mapping used by vanilla-extract.

@DanielHeath
Copy link
Author

The primary limitation of this callback as it stands is that it's called multiple times per build for the same file (possibly because I have multiple entrypoints importing the same component).

If the classname mapping generation wasn't stable, it wouldn't be clear which one to use unless the current entrypoint was also passed in, which (AFAICT) esbuild doesn't provide to plugins.

@mattcompiles
Copy link
Contributor

Hey @DanielHeath 👋

I assume what you ultimately want to produce is some metafile containing all the Vanilla Extract exports per file? This callback seems like a very low-level way to solve that issue. It's also potentially out of sync as more export processing occurs in the stringifyExports function.

I want to run this by the rest of the team first, but would you be open to a different solution?

@DanielHeath
Copy link
Author

Yeah absolutely - this was a more of a quick hack to check I could do it.

@DanielHeath
Copy link
Author

Just wanted to check in about the timeline here - if it's likely to be more than a few months I might forge ahead and publish a plugin, but if it's being discussed currently & there's likely to be progress made I'd prefer to wait and see.

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