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

feat: add compile template options #288

Merged
merged 2 commits into from Sep 28, 2020

Conversation

FRSgit
Copy link

@FRSgit FRSgit commented Sep 28, 2020

Fixes #98.

What?

This PR is adding to the vue-jest possibility to configure the template compiler used by @vue/component-compiler-utils package.

Why?

By passing correct configuration to the template compiler we can mitigate issues like the #98 - where the problem is directly connected with the proper tool configuration (in this case - the buble library).
BTW. the graphql case was added in this PR as an e2e test.

Reproduction scenario

The problem can be reproduced by checking out the first commit in this PR and running yarn test. Then you'll see this error in the console:

FAIL ./test.js
  ● Test suite failed to run

    Tagged template strings are not supported. Use `transforms: { templateString: false }` to skip transformation and disable this error, or `transforms: { dangerousTaggedTemplateString: true }` if you know what you're doing (1:86)

      at Node.initialise (../../../node_modules/vue-template-es2015-compiler/buble.js:16016:10)
          at Array.forEach (<anonymous>)
          at Array.forEach (<anonymous>)
          at Array.forEach (<anonymous>)
          at Array.forEach (<anonymous>)

@lmiller1990
Copy link
Member

Great, sounds good.

We can release this week.

I wonder if we need something similar for Vue 3 (next branch...)

@lmiller1990 lmiller1990 merged commit 0f450a5 into vuejs:master Sep 28, 2020
@FRSgit
Copy link
Author

FRSgit commented Sep 29, 2020

@lmiller1990 No idea unfortunately - didn't have time to get a grasp of Vue 3 yet (other than reading through the breaking changes/migration guides 😄 ).

It depends if the buble is still being used anywhere in the package dependencies (on this branch the @vue/component-compiler-utils is importing vue-template-es2015-compiler which uses buble).
If there would be any way of getting rid of buble at all (I think that now only vue-template-es2015-compiler still uses it) then the configuration option added by this PR wouldn't be needed at all (babel supports configuration via .babelrc and buble doesn't have it's own .bublerc what is the biggest pain) :<

@brunomperes
Copy link

Thanks a lot for this! Was this included in any stable release? I could not find it in the releases tab

@FRSgit
Copy link
Author

FRSgit commented Nov 30, 2020

@brunomperes Unfortunately not yet - in my project I've added vue-jest dependency directly via github link https://github.com/vuejs/vue-jest.

@lmiller1990 What do you think about releasing new version?

@lmiller1990
Copy link
Member

lmiller1990 commented Dec 1, 2020

Oops, sorry! Here we go: https://github.com/vuejs/vue-jest/releases/tag/v4.0.0-rc.1

Not entirely clear where this should transition from RC to a stable 4.0.0. 🤔

@FRSgit
Copy link
Author

FRSgit commented Dec 1, 2020

Thanks!
Hard to say when there is no roadmap, are there any other missing features/bigger bugs (other than the ts-jest thing which already has a PR)?
I would probably go through the PRs/issues, triage them, add the important ones (especially ones which would need making changes to the library's API) to the 4.0.0 milestone and just release it when they're resolved. I don't find 4.0.0 unstable at this point, so the other way would be to just release it now and continue with minor/patch release cycle every time a PR/bunch of PRs gets merged to the master.
I could give you a hand with this process, but probably you would make it much faster since you know this repo much better than me 🤷

@lmiller1990
Copy link
Member

I will try to get thets-jest thing merged soon. Then do another release - that could be the final rc. Then 4.0.0 stable.

Triaging the issues is quite hard, since we have both v4 and v5 here, it's quite confusing. I am not sure how much value there is in triaging old issues - the time is better spent on other things, like merging getting 4.0 and 5.0 stable.

For now, I will focus on getting the outstanding PRs merged. Thanks for your help!

@FRSgit
Copy link
Author

FRSgit commented Dec 1, 2020

Makes sense. But well, at some point going through left-over issues is a must have - in the best case just to close them 😄 There are lots of issues on this repo and some of them are probably already outdated ;/
Nevertheless, feel free to ping me anywhere you see I could be of help!
Cheers!

@FRSgit FRSgit deleted the feat-add-compile-template-options branch December 8, 2020 02:34
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.

Tagged template strings are not supported
3 participants