feat(vue): use vue-sfc-transformer if installed - #300
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #300 +/- ##
==========================================
+ Coverage 82.86% 83.69% +0.83%
==========================================
Files 12 12
Lines 852 969 +117
Branches 133 201 +68
==========================================
+ Hits 706 811 +105
- Misses 144 157 +13
+ Partials 2 1 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Daniel Roe <daniel@roe.dev>
| <script> | ||
|
|
||
| </script> |
There was a problem hiding this comment.
should we remove empty script block / all empty block?
Co-authored-by: Daniel Roe <daniel@roe.dev>
|
@Teages with your permission, could I extract this PR to a separate package + add you as a maintainer? |
it is ok |
|
Thank you! Now published as v0.0.1 and available at https://github.com/nuxt-contrib/vue-sfc-transformer. It would be good to add an option to mkdist that allows disabling the current vue loader implementation, and then upstream anyone that wants this better implementation (like @nuxt/module-builder!) can add it. Later on, in a new major of mkdist or unbuild we will have the option to swap/update to the new implementation. Does that sound okay to you? |
|
That is fine to me.
We now have three version:
The first two solutions both have the issue #281. If we list the latter as optional, then we will hardly participate in the transform of vue sfc (only generate the type) So I think we don't need an new option, just remove vue loader from default loaders, and anyone who need it can add it optionally. |
|
totally removing the vue loader would ultimately be ideal, but I'm trying to think of a interim solution that wouldn't require a major |
|
@danielroe seems the package didn't release with types. I pushed a commit to fix it, can you release it on npm? |
|
@cyco130 @Dunqing has developed detype, which further patched (detypes) for |
@zernoia oops it they do the same work After looking at their code, I think we will keep this PR. They have don't support for |
I think we can't avoid to release a major release if we have to considered this PR as a breaking change. The issue #289 (comment) actually quite serious because we can't access any variables exposed from |
|
Maybe we could revert back to For context, @pi0 doesn't want to add the extra weight of the vue dependencies for the uses of I also think we might need to export the types for mkdist loaders + use them to create a mkdist loader in |
|
@Teages I've now moved the vue loader from this PR into @pi0 - what would you like to do? here are some options:
|
|
@Teages okay - we're good to go with adding in next major we'll drop the current implementation |
|
@danielroe I will make a minimal transform as fallback, can you release |
|
@Teages I'm pretty sure nuxt-contrib/vue-sfc-transformer@eb7e26d doesn't solve the issue. I sent you a DM on Discord - maybe we could discuss there. |
vue-sfc-transformer if installed
resolves #281 & #289 (comment)
closes #289
The PR did:
<script setup>transformerTODO:
defineModelAfter resolving all TODOs, this should not contain any break changes. But I don't have any ideas on it yet.Now this PR should have no break changes for output behavior.