From 3dd0a23701a48b73934540b0c2cc0d2bacbf80cb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 21 Nov 2023 17:21:15 +0000 Subject: [PATCH] [ci] release --- .changeset/three-timers-arrive.md | 5 ----- examples/framework-multiple/package.json | 2 +- examples/framework-react/package.json | 2 +- packages/integrations/react/CHANGELOG.md | 6 +++++ packages/integrations/react/package.json | 2 +- .../react/test/parsed-react-children.test.js | 22 +++++++++---------- packages/integrations/react/vnode-children.js | 9 ++++---- pnpm-lock.yaml | 4 ++-- 8 files changed, 26 insertions(+), 26 deletions(-) delete mode 100644 .changeset/three-timers-arrive.md diff --git a/.changeset/three-timers-arrive.md b/.changeset/three-timers-arrive.md deleted file mode 100644 index 619e7d8159030..0000000000000 --- a/.changeset/three-timers-arrive.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/react': patch ---- - -Fixes an issue where slotting self-closing elements (img, br, hr) into react components with `experimentalReactChildren` enabled led to an error. diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json index c530dfd55c84b..14defc50088df 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/preact": "^3.0.1", - "@astrojs/react": "^3.0.5", + "@astrojs/react": "^3.0.6", "@astrojs/solid-js": "^3.0.2", "@astrojs/svelte": "^4.0.4", "@astrojs/vue": "^3.0.4", diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json index 638c6000074f6..b772c2b0781bd 100644 --- a/examples/framework-react/package.json +++ b/examples/framework-react/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "@astrojs/react": "^3.0.5", + "@astrojs/react": "^3.0.6", "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", "astro": "^3.5.6", diff --git a/packages/integrations/react/CHANGELOG.md b/packages/integrations/react/CHANGELOG.md index 5b127b75337eb..46d3a25120675 100644 --- a/packages/integrations/react/CHANGELOG.md +++ b/packages/integrations/react/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/react +## 3.0.6 + +### Patch Changes + +- [#9141](https://github.com/withastro/astro/pull/9141) [`af43fb517`](https://github.com/withastro/astro/commit/af43fb51726fa2242cec03cb019fa4fa4a4403ef) Thanks [@lilnasy](https://github.com/lilnasy)! - Fixes an issue where slotting self-closing elements (img, br, hr) into react components with `experimentalReactChildren` enabled led to an error. + ## 3.0.5 ### Patch Changes diff --git a/packages/integrations/react/package.json b/packages/integrations/react/package.json index 100ac3baa5e80..c72005a691573 100644 --- a/packages/integrations/react/package.json +++ b/packages/integrations/react/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/react", "description": "Use React components within Astro", - "version": "3.0.5", + "version": "3.0.6", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/react/test/parsed-react-children.test.js b/packages/integrations/react/test/parsed-react-children.test.js index 876897c95f749..1c845836f37f7 100644 --- a/packages/integrations/react/test/parsed-react-children.test.js +++ b/packages/integrations/react/test/parsed-react-children.test.js @@ -1,15 +1,15 @@ import { expect } from 'chai'; -import convert from "../vnode-children.js"; +import convert from '../vnode-children.js'; describe('experimental react children', () => { - it('has undefined as children for direct children', () => { - const [ imgVNode ] = convert(''); - expect(imgVNode.props).to.deep.include({ children: undefined }); - }) + it('has undefined as children for direct children', () => { + const [imgVNode] = convert(''); + expect(imgVNode.props).to.deep.include({ children: undefined }); + }); - it('has undefined as children for nested children', () => { - const [ divVNode ] = convert('
'); - const [ imgVNode ] = divVNode.props.children; - expect(imgVNode.props).to.deep.include({ children: undefined }); - }) -}) + it('has undefined as children for nested children', () => { + const [divVNode] = convert('
'); + const [imgVNode] = divVNode.props.children; + expect(imgVNode.props).to.deep.include({ children: undefined }); + }); +}); diff --git a/packages/integrations/react/vnode-children.js b/packages/integrations/react/vnode-children.js index 5fd421e67f710..0b26ef4239af7 100644 --- a/packages/integrations/react/vnode-children.js +++ b/packages/integrations/react/vnode-children.js @@ -8,11 +8,10 @@ export default function convert(children) { let key = 0; function createReactElementFromNode(node) { - const childVnodes = Array.isArray(node.children) && node.children.length - ? node.children - .map((child) => createReactElementFromNode(child)) - .filter(Boolean) - : undefined; + const childVnodes = + Array.isArray(node.children) && node.children.length + ? node.children.map((child) => createReactElementFromNode(child)).filter(Boolean) + : undefined; if (node.type === DOCUMENT_NODE) { return createElement(Fragment, {}, childVnodes); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 33a41186bb58a..cebcd14393bc5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -185,7 +185,7 @@ importers: specifier: ^3.0.1 version: link:../../packages/integrations/preact '@astrojs/react': - specifier: ^3.0.5 + specifier: ^3.0.6 version: link:../../packages/integrations/react '@astrojs/solid-js': specifier: ^3.0.2 @@ -236,7 +236,7 @@ importers: examples/framework-react: dependencies: '@astrojs/react': - specifier: ^3.0.5 + specifier: ^3.0.6 version: link:../../packages/integrations/react '@types/react': specifier: ^18.2.21