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

fix: avoid using prefixIdenntifier in esm #519

Merged
merged 2 commits into from
Apr 5, 2021

Conversation

elevatebart
Copy link
Contributor

When using VTU within vite, the version used is esm-bundler.
This version imports the esm-bundler of the compiler-core.

This version does not support prefixIdentifier.

I tried to make a conditional build of VTU.

@elevatebart elevatebart requested a review from lmiller1990 April 3, 2021 21:32
Copy link
Member

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

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

Cool, once this is approved and all passing, we can merge.

@@ -15,10 +15,13 @@ export function processSlot(source = '', Vue = vue) {
`<SlotWrapper v-bind="$attrs">${template}</SlotWrapper>`,
{
mode: 'function',
prefixIdentifiers: true
prefixIdentifiers: __BROWSER__
Copy link
Member

Choose a reason for hiding this comment

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

I think you may need to update tsconfig (or somewhere else?) to make this compile.

@lmiller1990
Copy link
Member

Thanks @elevatebart, is there some way I can test this out to make sure it's going to work how we want it to? Do you have some way of testing (assuming you did with Vite etc)?

@elevatebart
Copy link
Contributor Author

We could create a playground-like environment to run VTU in a vite/ESM environment.
I think I would like to call the environment variable with another name than __BROWSER__. Maybe ESM ? I called it this way because it is called this way in vue-next but I find it confusing.
We use __BROWSER__ in node and !__BROWSER__ in vite with in-browser testing.

The good news is there is no emergency right now as I found an "unclean" workaround.

@lmiller1990
Copy link
Member

I will release this within 24h.

@lmiller1990 lmiller1990 merged commit e1e4776 into vuejs:master Apr 5, 2021
@elevatebart
Copy link
Contributor Author

thank you !!!

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