-
-
Notifications
You must be signed in to change notification settings - Fork 2k
feat: make wrangler an optional peer dependency #12452
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
🦋 Changeset detectedLatest commit: 710b116 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -1,7 +1,7 @@ | |||
lockfileVersion: '9.0' | |||
|
|||
settings: | |||
autoInstallPeers: true | |||
autoInstallPeers: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this change? Is this what's causing the amp package to no longer have kit as a dependency in the lockfile? Is that a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default value for that setting was changed from false to true with pnpm 8.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without setting this wrangler will automatically be installed as a peer
As long as the tests pass, changes to the lockfile shouldn't matter since they won't be shipped to clients
is wrangler an optional peer of adapter-cloudflare and not needed for its operation during dev or build? Or is it needed but we don't have any tests covering its use? |
what are the wrangler.d.ts files for and if they are copied in from wrangler itself, how do we ensure that they align with the actual version of wrangler peered in by the user? |
It’s only used during dev at the moment but could be used for builds in the future? (prerendering with remote cloudflare data etc.) However, it’s not optional, which causes stackblitz, alpine, etc. to not work with it #11986 |
Hmm, I changed them to optional, but it still seems I need the |
|
||
let wrangler; | ||
try { | ||
wrangler = await import('wrangler'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of TLA with swallowing the error, what about lazily importing it when a feature is used that requires it and then logging a message asking the user to install wrangler to support it?
@jamesopstad will this conflict with the cloudflare adapter running the dev environment in workerd? |
closes #11986
wrangler is heavy and pulls in outdated version of esbuild, deprecated packages, etc. This allows us to avoid installing it
I'm not sure why I need the latter two eslint ignores. Feels like a bug in eslint. I'll have to follow up on that afterwards