From e7f872e91e852b901cf221a5151077dec64305bf Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Tue, 29 Aug 2023 14:00:47 -0400 Subject: [PATCH] Prevent ViewTransition script from being added by mistake (#8268) (#8270) * Prevent ViewTransition script from being added by mistake * Add the 2-legacy branch to CI --- .changeset/swift-taxis-sing.md | 5 +++++ .github/workflows/release.yml | 1 + packages/astro/components/index.ts | 1 - packages/astro/test/code-component.test.js | 7 +++++++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .changeset/swift-taxis-sing.md diff --git a/.changeset/swift-taxis-sing.md b/.changeset/swift-taxis-sing.md new file mode 100644 index 000000000..9b8bdebb4 --- /dev/null +++ b/.changeset/swift-taxis-sing.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Prevent ViewTransition script from being added by mistake diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f952f6c6b..7161a0d0f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,7 @@ on: branches: - main - "1-legacy" + - "2-legacy" - next defaults: diff --git a/packages/astro/components/index.ts b/packages/astro/components/index.ts index 6bd537087..864c7cc3b 100644 --- a/packages/astro/components/index.ts +++ b/packages/astro/components/index.ts @@ -1,3 +1,2 @@ export { default as Code } from './Code.astro'; export { default as Debug } from './Debug.astro'; -export { default as ViewTransitions } from './ViewTransitions.astro'; diff --git a/packages/astro/test/code-component.test.js b/packages/astro/test/code-component.test.js index c80107681..8481e95d8 100644 --- a/packages/astro/test/code-component.test.js +++ b/packages/astro/test/code-component.test.js @@ -23,4 +23,11 @@ describe('Code component', () => { let $ = cheerio.load(html); expect($('pre').attr('is:raw')).to.equal(undefined); }); + + // ViewTransitions bug + it('No script should be added to the page', async () => { + let html = await fixture.readFile('/index.html'); + let $ = cheerio.load(html); + expect($('script')).to.have.a.lengthOf(0); + }); });