-
Notifications
You must be signed in to change notification settings - Fork 734
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
Disable persistence by default (unless --enable-persistence passed) #321
Disable persistence by default (unless --enable-persistence passed) #321
Conversation
🦋 Changeset detectedLatest commit: f4a3c9c 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 |
b32b364
to
4bcb4a3
Compare
This resolves #320 |
call it |
{ | ||
"printWidth": 80, | ||
"singleQuote": false, | ||
"semi": true | ||
} |
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.
Perhaps this change is something to discuss in a separate PR?
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.
Oh I see, this is to match the current settings, and override any user-level config that a developer might have...?
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.
Yeah my ~/.prettierrc
is set to the opposite of all of these, so running prettier on anything exploded the diffs. I ran npm run prettify
after adding this and it changed nothing, except the npm run check:format
on CI still failed. Not sure why...
packages/wrangler/src/dev.tsx
Outdated
// break; | ||
// } | ||
// } | ||
// ); |
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.
Is this supposed to be commented out?
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.
Damn sorry that was me trying to fix something else... Will redo and repush
packages/wrangler/src/dev.tsx
Outdated
@@ -40,6 +40,7 @@ export type DevProps = { | |||
initialMode: "local" | "remote"; | |||
jsxFactory: undefined | string; | |||
jsxFragment: undefined | string; | |||
enablePersistence: boolean; |
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.
BIKESHED: enableLocalPersistence
or localModePersistence
or something that signifies that this only affects local mode?
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.
We'll be needing a change-set too!
Run the following in the root of the project.
npx changeset
Choosing to bump the wrangler package by only a patch version (since we are in 0.x version mode)
fbc9a0a
to
a499762
Compare
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.
LGTM - the failure is a TypeScript one...
Error: [check:type ] packages/wrangler/src/__tests__/dev.test.tsx(49,6): error TS2741: Property 'enableLocalPersistence' is missing in type '{ name: string | undefined; entry: string; port: number | undefined; buildCommand: { command?: string | undefined; cwd?: string | undefined; watch_dir?: string | undefined; }; format: CfScriptFormat; ... 9 more ...; bindings: { ...; }; }' but required in type 'DevProps'.
Looks like you need to update dev.test.ts
f38b835
to
5a47d35
Compare
.changeset/two-coins-compare.md
Outdated
"wrangler": patch | ||
--- | ||
|
||
Disabled local persistence by default & added --experimental-enable-local-persistence flag |
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.
Oh last thing... Could you add a breaking changes notification here... Something like:
BREAKING CHANGE:
When running `dev` locally any data stored in KV, Durable Objects or the cache are no longer persisted between sessions by default.
To turn this back on add the `--experimental-enable-local-persistence` at the command line.
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.
Like this?
5a47d35
to
25d1d1f
Compare
feat: Added —experimental-enable-local-persistence flag to turn back on chore: added project-level .prettierrc, otherwise system-wide settings cause massive diffs chore: added changeset
25d1d1f
to
f4a3c9c
Compare
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.
@geelen - oops:
|
This fix passes the correct worker name to `syncAssets` during `wrangler dev`. This function uses the name to create the backing kv store for a Workers Sites definition, so it's important we get the name right. I also fixed the lint warning introduced in #321, to pass `props.enableLocalPersistence` as a dependency in the `useEffect` call that starts the "local" mode dev server.
fix for the lint warning included in #333 |
This fix passes the correct worker name to `syncAssets` during `wrangler dev`. This function uses the name to create the backing kv store for a Workers Sites definition, so it's important we get the name right. I also fixed the lint warning introduced in #321, to pass `props.enableLocalPersistence` as a dependency in the `useEffect` call that starts the "local" mode dev server.
Thought it was time to pull my finger out and send a PR, now that I don't have the "but I don't know Rust" defence to lean back on...