From 421cab1adf4cf2645c48676fd6d52147c50b91aa Mon Sep 17 00:00:00 2001 From: Harlan Wilton Date: Mon, 4 Sep 2023 10:12:56 +0200 Subject: [PATCH 1/2] perf(nuxt): prevent head dom from rendering twice (#22974) --- packages/nuxt/src/head/runtime/plugins/unhead.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/nuxt/src/head/runtime/plugins/unhead.ts b/packages/nuxt/src/head/runtime/plugins/unhead.ts index 50cd2eaaaf..64394f402b 100644 --- a/packages/nuxt/src/head/runtime/plugins/unhead.ts +++ b/packages/nuxt/src/head/runtime/plugins/unhead.ts @@ -26,7 +26,10 @@ export default defineNuxtPlugin({ head.hooks.hook('dom:beforeRender', (context) => { context.shouldRender = !pauseDOMUpdates }) nuxtApp.hooks.hook('page:start', () => { pauseDOMUpdates = true }) // wait for new page before unpausing dom updates (triggered after suspense resolved) - nuxtApp.hooks.hook('page:finish', syncHead) + nuxtApp.hooks.hook('page:finish', () => { + // app:suspense:resolve hook will unpause the DOM + if (!nuxtApp.isHydrating) { syncHead() } + }) // unpause on error nuxtApp.hooks.hook('app:error', syncHead) // unpause the DOM once the mount suspense is resolved From cdf9b5547e805172b6baec9a91c8428650bf7389 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 4 Sep 2023 09:16:51 +0100 Subject: [PATCH 2/2] ci: create 2.x release branch as well --- .github/workflows/changelogensets.yml | 1 + scripts/update-changelog.ts | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/changelogensets.yml b/.github/workflows/changelogensets.yml index 3ebb3ee07e..06b6b303d1 100644 --- a/.github/workflows/changelogensets.yml +++ b/.github/workflows/changelogensets.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - 2.x permissions: pull-requests: write diff --git a/scripts/update-changelog.ts b/scripts/update-changelog.ts index 56f13ba60b..69d0a5599c 100644 --- a/scripts/update-changelog.ts +++ b/scripts/update-changelog.ts @@ -4,6 +4,8 @@ import { inc } from 'semver' import { generateMarkDown, loadChangelogConfig } from 'changelogen' import { determineBumpType, getLatestCommits, loadWorkspace } from './_utils' +const releaseBranch = process.env.BRANCH || 'main' + async function main () { const workspace = await loadWorkspace(process.cwd()) const config = await loadChangelogConfig(process.cwd(), { @@ -39,7 +41,7 @@ async function main () { const releaseNotes = [ currentPR?.body.replace(/## 👉 Changelog[\s\S]*$/, '') || `> ${newVersion} is the next ${bumpType} release.\n>\n> **Timetable**: to be announced.`, '## 👉 Changelog', - changelog.replace(/^## v.*?\n/, '').replace('...main', `...v${newVersion}`) + changelog.replace(/^## v.*?\n/, '').replace(`...${releaseBranch}`, `...v${newVersion}`) ].join('\n') // Create a PR with release notes if none exists @@ -52,7 +54,7 @@ async function main () { body: { title: `v${newVersion}`, head: `v${newVersion}`, - base: 'main', + base: releaseBranch, body: releaseNotes, draft: true }