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

fix(hydration): force patch dynamic props when hydrating #9083

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

baiwusanyu-c
Copy link
Member

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

@baiwusanyu-c baiwusanyu-c marked this pull request as ready for review August 30, 2023 03:33
@github-actions
Copy link

github-actions bot commented Aug 30, 2023

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB (+36 B) 37.7 kB (+23 B) 33.9 kB (-7 B)
vue.global.prod.js 159 kB (+36 B) 57.6 kB (+21 B) 51.2 kB (+10 B)

Usages

Name Size Gzip Brotli
createApp 55.2 kB 21.2 kB 19.4 kB
createSSRApp 59.2 kB (+36 B) 22.9 kB (+25 B) 20.9 kB (+14 B)
defineCustomElement 59.9 kB 22.8 kB 20.7 kB
overall 68.9 kB 26.3 kB 23.9 kB

@sxzz sxzz added the scope: ssr label Sep 1, 2023
baiwusanyu-c and others added 4 commits November 13, 2023 13:14
…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
@nobunobu
Copy link

up

…psHydrate

# Conflicts:
#	packages/runtime-core/__tests__/hydration.spec.ts

// #9033
test('force patch dynamic props when hydrating', () => {
const timestamp = Date.now()
Copy link
Contributor

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?

Copy link
Member

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.

@edison1105 edison1105 added 🐞 bug Something isn't working ready to merge The PR is ready to be merged. labels Aug 20, 2024
…psHydrate

# Conflicts:
#	packages/runtime-core/__tests__/hydration.spec.ts
#	packages/runtime-core/src/hydration.ts
Copy link

pkg-pr-new bot commented Sep 5, 2024

Open in Stackblitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@9083

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@9083

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@9083

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@9083

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@9083

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@9083

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@9083

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@9083

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@9083

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@9083

vue

pnpm add https://pkg.pr.new/vue@9083

commit: 227eaf1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working ready to merge The PR is ready to be merged. scope: ssr
Projects
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

Hydration not updating DOM of img-src and v-html with new client-side values
5 participants