vuera icon indicating copy to clipboard operation
vuera copied to clipboard

Update dependencies & test for React hooks

Open akxcv opened this issue 4 years ago • 6 comments

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.

akxcv avatar Aug 11 '20 11:08 akxcv

It would be fantastic to have this merged! 🙂

mmaietta avatar Feb 26 '21 23:02 mmaietta

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

harshlele avatar Mar 01 '21 08:03 harshlele

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

mmaietta avatar Mar 01 '21 23:03 mmaietta

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.

willisplummer avatar May 16 '21 16:05 willisplummer

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...

Halu95 avatar Jun 26 '21 19:06 Halu95

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"] }, }, }

thqueiroz avatar Dec 16 '22 20:12 thqueiroz