Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

feat: support reactivity transform #3737

Merged
merged 8 commits into from
Mar 17, 2022
Merged

feat: support reactivity transform #3737

merged 8 commits into from
Mar 17, 2022

Conversation

antfu
Copy link
Member

@antfu antfu commented Mar 17, 2022

🔗 Linked issue

nuxt/nuxt#13105

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Enable by experimental.reactivityTransform: true

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@netlify
Copy link

netlify bot commented Mar 17, 2022

✔️ Deploy Preview for nuxt3-docs canceled.

🔨 Explore the source changes: 9de1877

🔍 Inspect the deploy log: https://app.netlify.com/sites/nuxt3-docs/deploys/6233b24e367d2300099af85b

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

LGTM. Shall we also add a basic test for this flag?

@antfu
Copy link
Member Author

antfu commented Mar 17, 2022

LGTM. Shall we also add a basic test for this flag?

Since it's kinda global - do you want it to be enabled for the basic fixture or create a new fixture for it?

@pi0
Copy link
Member

pi0 commented Mar 17, 2022

It would be great to test with same fixture if possible to save CI time 😊

@pi0
Copy link
Member

pi0 commented Mar 17, 2022

Tests are still failing since @vitejs/plugin/vue is using transformWithEsbuild without respecting global esbuild options to ignore extends field...

@pi0 pi0 merged commit f69126e into main Mar 17, 2022
@pi0 pi0 deleted the feat/reactivty-transform branch March 17, 2022 22:18
@baixiaoyu2997
Copy link
Contributor

@antfu nuxt bridge error, because not set experimental config. i think should handle this code

nuxt.options.experimental.reactivityTransform

@antfu
Copy link
Member Author

antfu commented Mar 18, 2022

@baixiaoyu2997 Bridge does not support reactivityTransform currently, it's a Nuxt 3 only feature

@baixiaoyu2997
Copy link
Contributor

@baixiaoyu2997 Bridge does not support reactivityTransform currently, it's a Nuxt 3 only feature

我没有开启experimental这个配置,但是报错了:

Cannot read properties of undefined (reading 'reactivityTransform')      

from this code:

if (nuxt.options.experimental.reactivityTransform) {

如果需要复现 我可以提供在线代码

@senar9
Copy link

senar9 commented Mar 18, 2022

same problem: nuxt/bridge#84
"nuxt-edge": "^2.16.0-27358576.777a4b7f",
"@nuxt/bridge": "npm:@nuxt/bridge-edge@^3.0.0-27459267.f69126e",

@pi0
Copy link
Member

pi0 commented Mar 18, 2022

Issues with bridge should be solved by #3763

@misaon
Copy link
Contributor

misaon commented Mar 18, 2022

@pi0 @antfu $useState / $useCookie will be? ❤️

Copy link
Member

atinux commented Mar 21, 2022

Is it normal that the documentation has not been generated for the experimental option on https://v3.nuxtjs.org/docs/directory-structure/nuxt.config ?

@zanfee
Copy link

zanfee commented Jul 22, 2022

Does reactivity transform work with nitro? When importing $ref from 'vue/macros' my IDE seems to find the correct file (.../node_modules/.pnpm/vue@3.2.37/node_modules/vue/macros.d.ts) but Rollup is giving me an error, saying it could not load .../node_modules/.pnpm/vue@3.2.37/node_modules/vue/dist/vue.cjs.js/macros.

I tried explicitly installing Vue 3, as suggested in https://github.com/nuxt/framework/discussions/2028, but still got the error.

Reproduction:
https://stackblitz.com/edit/nuxt-starter-tcndrb?file=server/api/data.get.ts

@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants