Conversation
🦋 Changeset detectedLatest commit: 7923689 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| "dev": "next dev", | ||
| "integration-test": "playwright test", | ||
| "lint": "next lint", | ||
| "lint": "eslint --max-warnings=0 .", |
There was a problem hiding this comment.
next lint caused a lint-staging failure
packages/kv/src/index.ts
Outdated
| get() { | ||
| throw new Error( | ||
| '"The default export has been moved to a named export, change to import { kv }"', | ||
| ); | ||
| }, |
There was a problem hiding this comment.
| get() { | |
| throw new Error( | |
| '"The default export has been moved to a named export, change to import { kv }"', | |
| ); | |
| }, | |
| get(target, prop, receiver) { | |
| if (prop === 'then' || prop === 'parse') return Reflect.get(target, prop, receiver); | |
| throw new Error( | |
| '"The default export has been moved to a named export, change to import { kv }"', | |
| ); | |
| }, |
Since this is going to be removed for V1, we could do this to prevent it from always throwing in Vite. It's the disgusting hacky solution we didn't want to implement for the default export, but since it'll go away at 1.0, I'd be comfortable with it.
There was a problem hiding this comment.
Not positive this exact thing would work (would have to test with Vite), but something like it should.
There was a problem hiding this comment.
Why not add a console.warn to the default export, saying that
'"The default export will be moved to a named export after the beta, change to import { kv }"',
without throwing any error?
This way the npm version is a real minor (no breaking changes)
To sum up:
0.2.0adds the named export, fixes Vite using the hacky solution, warns every user about the upcoming breaking change1.0.0removes thedefaultexport as soon as we go GA
There was a problem hiding this comment.
I was able to reproduce the Vite issue in a jest test, I added a test case.
I changed the throw to a colored console.warn, but indeed it may not be that visible
|
Ahhh nice, this is perfect. No breaking change until 1, a warning, and the nasty hacky fix on top. :chef-kiss: |
|
Looks like unit tests are failing though 😬 |
oh yeah, sorry I forgot to review them! |
move
kvdefault export to a named exportCloses #107.