Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yarn Plug'n'Play Support #8286

Closed
tgrelka opened this issue Jan 4, 2021 · 6 comments
Closed

Yarn Plug'n'Play Support #8286

tgrelka opened this issue Jan 4, 2021 · 6 comments

Comments

@tgrelka
Copy link

tgrelka commented Jan 4, 2021

Is your feature request related to a problem? Please describe.
I'm using the latest yarn (v2.4.0), currently with the node-modules linker but would like to switch to the more modern UP'n'P, which has become the default for Yarn 2.

When removing the nodeLinker: node-modules option, the getQuasarAppExecutable function fails to resolve @quasar/app since the environment is missing UP'n'P capabilities. This can, however, be fixed by adding an environment variable NODE_OPTIONS="--require <path-to-.pnp.js>" linking to the .pnp.js of the project folder. This can be done using --require .\.pnp.js and works just fine, instead of Quasar CLI help displaying, Quasar App is started and dev server is launched. However, down the line, getPackageJson seems to return undefined, likely because require('../../package.json') cannot be resolved.

Describe the solution you'd like
Yarn 2/P'n'P should work out of the box with Quasar, without needing to set environment variables manually or throwing errors.
It took me a bit until I figured out that nodeLinker: node-modules was required for Quasar to work, making the experience of using the latest yarn (always recommended) have a few hiccups.

Describe alternatives you've considered
I'm currently working on investigating all issues with Yarn 2 P'n'P and trying to resolve them, however, at work there is only so much time I can spend working on outside projects. I will look into this more in my free time, but I need to get comfortable with Quasars App code first, understanding the CLI package was easy due to its small size.
As such, any help, additional issue reports and hints are appreciated!

Additional context
image
quasar d working (instead of displaying cli help page after @quasar/app couldn't be resolved) after setting environment variable, but quickly failing due to path resolving issues.

Some Notes
Webpack v4 has no native support for UPnP, however there is pnp-webpack-plugin which adds support. If PnP is supported natively by quasar, this should be installed in quasars webpack config. Webpack 5 ships with native support for UPnP.
While that makes it easier for any version shipping with Webpack 5 (Quasar 2 hopefully 😉), even if Quasar 1 won't get Webpack 5 support, I’d still like this feature to be in App v2, since it makes using Quasar with yarn easy out of the box and is also the version we will stay on for a little while at our company, and likely will others until Vue 3 has matured. This also means I’ll be working on fixing issues with the current App version instead of working in vue3-work.

For me at least, that will make my efforts worthwhile, and I hope I'm able to resolve all issues surrounding yarn v2 (with any help greatly appreciated as my resources are limited.)

Edit: Hitting Ctrl+Enter accidentally sends the issue, oops. Finished my description now.
Edit 2: Yes, I know I’m not on latest quasar yet, just got back to work this morning and am still updating all deps, however I wanted to get this issue opened asap to see if anybody already has done some work on Yarn v2 P'n'P. Now tested: As expected it does not work on latest quasar.

@hawkeye64
Copy link
Member

@tgrelka Does moving to Webpack 5 solve this issue directly or is a plugin still needed?

@tgrelka
Copy link
Author

tgrelka commented Jan 20, 2021

It no longer needs the plugin, though I'm not yet sure what else needs changing in quasar. I haven't had much time at work lately to investigate this further, but I will try to get to it as soon as I can.

@tgrelka
Copy link
Author

tgrelka commented Jan 21, 2021

I will postpone looking into this until webpack5-branch is ready for testing using Webpack 5. Might chime in there with updating deps, though.

@hawkeye64
Copy link
Member

#8102

@pdanpdan
Copy link
Collaborator

cross ref:
#8245
#8286
#7581

@rstoenescu
Copy link
Member

For the sanity, marking as duplicate of #7581

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants