-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
fix(hydration): force patch dynamic props when hydrating #9083
base: main
Are you sure you want to change the base?
fix(hydration): force patch dynamic props when hydrating #9083
Conversation
Size ReportBundles
Usages
|
…Hydrate # Conflicts: # packages/runtime-core/__tests__/hydration.spec.ts # packages/runtime-core/src/hydration.ts
…Hydrate # Conflicts: # packages/runtime-core/__tests__/hydration.spec.ts # packages/runtime-core/src/hydration.ts
up |
…psHydrate # Conflicts: # packages/runtime-core/__tests__/hydration.spec.ts
|
||
// #9033 | ||
test('force patch dynamic props when hydrating', () => { | ||
const timestamp = Date.now() |
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 there a reason why this test needs to use Date.now()
? It may be more 'real', but it also makes the test less reliable. The two calls to Date.now()
might yield the same number, or they might not. Couldn't the same functionality be tested using fixed values instead?
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.
I have no problem with using Date.now()
, but it makes more sense to use a fixed value.
…psHydrate # Conflicts: # packages/runtime-core/__tests__/hydration.spec.ts # packages/runtime-core/src/hydration.ts
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-ssr
@vue/compiler-sfc
@vue/reactivity
@vue/runtime-dom
@vue/runtime-core
@vue/shared
@vue/server-renderer
@vue/compat
vue
commit: |
close: #9033
The same code is executed on the client and the server, but some dynamic props may be inconsistent between the two runs (such as timestamps), I think they should always be consistent with the client