akxcv / vuera

:eyes: Vue in React, React in Vue. Seamless integration of the two. :dancers:
MIT License
4.3k stars 242 forks source link

Update dependencies & test for React hooks #123

Open akxcv opened 4 years ago

akxcv commented 4 years ago

A lot of development dependencies, such as Babel, were way outdated.

I am also trying to reproduce issues with React hooks, as described in #101 and #122.

mmaietta commented 3 years ago

It would be fantastic to have this merged! 🙂

harshlele commented 3 years ago

a lot of people now use react hooks and function components, it would be nice if it worked with vuera! @akxcv

mmaietta commented 3 years ago

Hmmm the build checks are passing but I'm unable to locally build the project locally in my checkout of the fix branch.

willisplummer commented 3 years ago

i'm getting local build issues with this branch too:

➜  vuera git:(updates-and-hooks) yarn build
yarn run v1.22.10
$ cross-env BABEL_ENV=rollup rollup -c

src/index.js → dist/vuera.cjs.js...
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
[!] (plugin babel) Error: /Users/willisplummer/code/wavepaths/vuera/src/index.js: Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility.If you are using @babel/plugin-external-helpers you will need to use a newer version than the one you currently have installed. If you have your own implementation, you'll want to explore using 'helperGenerator' alongside 'file.availableHelper()'.
src/index.js
Error: /Users/willisplummer/code/wavepaths/vuera/src/index.js: Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility.If you are using @babel/plugin-external-helpers you will need to use a newer version than the one you currently have installed. If you have your own implementation, you'll want to explore using 'helperGenerator' alongside 'file.availableHelper()'.
    at File.set (/Users/willisplummer/code/wavepaths/vuera/node_modules/@babel/core/lib/transformation/file/file.js:137:13)
    at PluginPass.pre (/Users/willisplummer/code/wavepaths/vuera/node_modules/babel-plugin-external-helpers/lib/index.js:10:12)
    at transformFile (/Users/willisplummer/code/wavepaths/vuera/node_modules/@babel/core/lib/transformation/index.js:96:27)
    at transformFile.next (<anonymous>)
    at run (/Users/willisplummer/code/wavepaths/vuera/node_modules/@babel/core/lib/transformation/index.js:35:12)
    at run.next (<anonymous>)
    at Object.transform (/Users/willisplummer/code/wavepaths/vuera/node_modules/@babel/core/lib/transform.js:27:41)
    at transform.next (<anonymous>)
    at evaluateSync (/Users/willisplummer/code/wavepaths/vuera/node_modules/gensync/index.js:244:28)
    at Object.sync (/Users/willisplummer/code/wavepaths/vuera/node_modules/gensync/index.js:84:14)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Halu95 commented 3 years ago

Hey @akxcv, using "@babel/plugin-external-helpers" instead of "babel-plugin-external-helpers" and adjusting the rollup plugin entry in the .babelrc file to "@babel/external-helpers" seems to have resolved the build issue for me at least, hope it helps...

thqueiroz commented 1 year ago

Hey, @Halu95 ! Can you please explain how you make it works? I am having the same problem but no solution that I saw until now worked for me. my

my babel.config.js:

module.exports = { presets: [ [ "@babel/preset-env", { es2015: { modules: false }, modules: false }, ], "@babel/preset-react" ], plugins: [ "@babel/plugin-proposal-object-rest-spread", "@babel/plugin-proposal-class-properties", "@babel/plugin-transform-runtime" ], env: { rollup: { plugins: ["@babel/external-helpers"] }, }, }