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): provide compat fallback for idle callback #11935

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

Conversation

GalacticHypernova
Copy link
Contributor

This PR provides a compatibility polyfill for idle callback, which is not supported in Safari. The implementation is taken straight from Nuxt's.

Copy link

netlify bot commented Sep 15, 2024

Deploy Preview for vue-next-template-explorer failed.

Name Link
🔨 Latest commit b98eaa1
🔍 Latest deploy log https://app.netlify.com/sites/vue-next-template-explorer/deploys/66ea84871e6e6e0008b8a3c3

Copy link

netlify bot commented Sep 15, 2024

Deploy Preview for vue-sfc-playground failed.

Name Link
🔨 Latest commit b98eaa1
🔍 Latest deploy log https://app.netlify.com/sites/vue-sfc-playground/deploys/66ea848772b17400082cd537

@GalacticHypernova GalacticHypernova marked this pull request as draft September 15, 2024 22:23
Copy link

github-actions bot commented Sep 15, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 101 kB (+72 B) 37.9 kB (+47 B) 34.1 kB (+9 B)
vue.global.prod.js 159 kB (+72 B) 57.8 kB (+30 B) 51.3 kB (+2 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 48.9 kB (+102 B) 18.9 kB (+52 B) 17.2 kB (-17 B)
createApp 55.5 kB (+102 B) 21.4 kB (+59 B) 19.5 kB (+52 B)
createSSRApp 59.5 kB (+102 B) 23.1 kB (+57 B) 21 kB (+68 B)
defineCustomElement 60.3 kB (+102 B) 22.9 kB (+61 B) 20.9 kB (+55 B)
overall 69.2 kB (+102 B) 26.4 kB (+45 B) 24 kB (+50 B)

Copy link

pkg-pr-new bot commented Sep 15, 2024

Open in Stackblitz

@vue/compiler-core

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/compiler-dom

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 8d28ac7

@GalacticHypernova GalacticHypernova marked this pull request as ready for review September 15, 2024 22:31
import { DOMNodeTypes, isComment } from './hydration'

const globalThis = getGlobalThis()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this into the functions where it's needed and call it inline (it's cached) so that this can be treeshaken with the functions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typescript appears to have issues with this approach

packages/runtime-core/src/hydrationStrategies.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants