flex-plugin-builder icon indicating copy to clipboard operation
flex-plugin-builder copied to clipboard

[FEATURE REQUEST] Add React hooks support for latest beta version of plugins-cli (v4.3.5-beta.0)

Open chase2981 opened this issue 5 years ago • 2 comments

Feature Request

I'm frustrated the latest version of the plugins-cli doesn't allow you to serve locally using any version of react/react-dom other than 16.5.2--even if you pass along the SKIP_PREFLIGHT_CHECK=true UNBUNDLED_REACT=true npm install flag when installing and when trying to run the SKIP_PREFLIGHT_CHECK=true twilio flex:plugins:start -l debug command after successful installation--it still won't let me serve locally. I previously joined your guys' beta program so we could develop our flex app using hooks and it doesn't seem to work with your latest recommended plugins-cli/plugins dashboard.

Description of Solution

I want to be able to serve my plugin locally, build my plugin locally, and deploy my built plugin remotely so that I can manage my plugins using your new plugins admin dashboard. I want to be able to do all these things even though we are currently opted in to using [email protected] & [email protected]. (or greater react version even)

Additional Context

twilio-cli version: 2.7.0
"@twilio/flex-ui": "1.23.0",
"flex-plugin-scripts": "4.3.5-beta.0",
"react": "16.13.1",
"react-dom": "16.13.1"
MacBook-Pro:flex-plugins lightning$ UNBUNDLED_REACT=true npm install

> [email protected] postinstall /Users/lightning/code/rd/contact-center-flex/flex-plugins
> flex-plugin pre-script-check

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN @material-ui/[email protected] requires a peer of @date-io/core@^1.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN @octokit/[email protected] requires a peer of @octokit/core@>=3 but none is installed. You must install peer dependencies yourself.
npm WARN @material-ui/[email protected] requires a peer of @material-ui/core@^1.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of jss@^9.7.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of jss@^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of jss@^9.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of jss@^9.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of jss@^9.7.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of jss@^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of jss@^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of jss@^9.7.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of jss@^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of jss@^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of jss@^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^16.14.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of redux@^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] || 4.0.x but none is installed. You must install peer dependencies yourself.

audited 3700 packages in 13.511s

174 packages are looking for funding
  run `npm fund` for details

found 17 vulnerabilities (12 low, 5 high)
  run `npm audit fix` to fix them, or `npm audit` for details
MacBook-Pro:flex-plugins lightning$ SKIP_PREFLIGHT_CHECK=true twilio flex:plugins:start -l debug
 ›   Warning: twilio-cli update available from 2.7.0 to 2.12.0.
[DEBUG] Config File: /Users/lightning/.twilio-cli/config.json
[DEBUG] Using profile: rd-flex-dev
[DEBUG] Using Flex Plugins Config File: /Users/lightning/.twilio-cli/flex/plugins.json
Using profile rd-flex-dev (X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0)


There might be a problem with your project dependency tree.

The @twilio/flex-ui requires the following package:

         "react": "16.5.2"

However, a different version of this package was detected: 16.13.1.
Do not try to install this manually; flex-plugin-scripts manages that for you.
Managing this package yourself is known to cause issues in production environments.

Please follow these steps to possibly fix this issue:

         1. Delete your node_modules directory
         2. Delete package-lock.json and/or yarn.lock
         3. Remove react from your package.json file
         4. Run npm install or yarn install again

If you like to skip this and proceed anyway, use SKIP_PREFLIGHT_CHECK=true environment variable.
This will disable checks and allow you to run your application.

MacBook-Pro:flex-plugins lightning$ 
Screen Shot 2020-11-09 at 11 01 20 PM

chase2981 avatar Nov 10 '20 06:11 chase2981

@chase2981 you still need to pass the UNBUNDLED_REACT=true when running all Twilio CLI commands if you are using higher versions of React. So UNBUNDLED_REACT=true twilio flex:plugins:start is required.

ktalebian avatar Nov 10 '20 16:11 ktalebian

Can you add the UNBUNDLED_REACT=true to an .env file to avoid needing to write it in every command?

qborreda avatar Dec 24 '20 13:12 qborreda

Hi,

This is a long open item more than a year now, hence closing it. Feel free to reopen it if still required.

anjha91 avatar Oct 04 '23 08:10 anjha91