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(react): make children undefined with experimentalReactChildren #9141

Merged
merged 4 commits into from
Nov 21, 2023

Conversation

lilnasy
Copy link
Contributor

@lilnasy lilnasy commented Nov 20, 2023

Changes

Testing

  • add a unit test
  • add test script to package.json

Docs

Does not affect usage

Copy link

changeset-bot bot commented Nov 20, 2023

🦋 Changeset detected

Latest commit: fc44ec2

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added pkg: react Related to React (scope) pkg: integration Related to any renderer integration (scope) labels Nov 20, 2023
@github-actions github-actions bot added the pr: docs A PR that includes documentation for review label Nov 20, 2023
@lilnasy

This comment was marked as outdated.

This comment was marked as outdated.

@lilnasy

This comment was marked as outdated.

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

The logic looks good to me! Thanks for the fix.

This comment was marked as outdated.

@lilnasy

This comment was marked as resolved.

@lilnasy
Copy link
Contributor Author

lilnasy commented Nov 20, 2023

!preview self-closing-children

Copy link
Contributor

Snapshots have been released for the following packages:

  • astro@experimental--self-closing-children
  • @astrojs/react@experimental--self-closing-children
Publish Log
🦋  warn ===============================IMPORTANT!===============================
🦋  warn Packages will be released under the experimental--self-closing-children tag
🦋  warn ----------------------------------------------------------------------
🦋  info npm info astro
🦋  info npm info @astrojs/prism
🦋  info npm info @astrojs/rss
🦋  info npm info create-astro
🦋  info npm info @astrojs/alpinejs
🦋  info npm info @astrojs/lit
🦋  info npm info @astrojs/markdoc
🦋  info npm info @astrojs/mdx
🦋  info npm info @astrojs/node
🦋  info npm info @astrojs/partytown
🦋  info npm info @astrojs/preact
🦋  info npm info @astrojs/prefetch
🦋  info npm info @astrojs/react
🦋  info npm info @astrojs/sitemap
🦋  info npm info @astrojs/solid-js
🦋  info npm info @astrojs/svelte
🦋  info npm info @astrojs/tailwind
🦋  info npm info @astrojs/vercel
🦋  info npm info @astrojs/vue
🦋  info npm info @astrojs/internal-helpers
🦋  info npm info @astrojs/markdown-remark
🦋  info npm info @astrojs/telemetry
🦋  info npm info @astrojs/underscore-redirects
🦋  info astro is being published because our local version (0.0.0-self-closing-children-20231120173528) has not been published on npm
🦋  warn @astrojs/prism is not being published because version 3.0.0 is already published on npm
🦋  warn @astrojs/rss is not being published because version 3.0.0 is already published on npm
🦋  warn create-astro is not being published because version 4.5.1 is already published on npm
🦋  warn @astrojs/alpinejs is not being published because version 0.3.1 is already published on npm
🦋  warn @astrojs/lit is not being published because version 3.0.3 is already published on npm
🦋  warn @astrojs/markdoc is not being published because version 0.7.2 is already published on npm
🦋  warn @astrojs/mdx is not being published because version 1.1.5 is already published on npm
🦋  warn @astrojs/node is not being published because version 6.0.4 is already published on npm
🦋  warn @astrojs/partytown is not being published because version 2.0.2 is already published on npm
🦋  warn @astrojs/preact is not being published because version 3.0.1 is already published on npm
🦋  warn @astrojs/prefetch is not being published because version 0.4.1 is already published on npm
🦋  info @astrojs/react is being published because our local version (0.0.0-self-closing-children-20231120173528) has not been published on npm
🦋  warn @astrojs/sitemap is not being published because version 3.0.3 is already published on npm
🦋  warn @astrojs/solid-js is not being published because version 3.0.2 is already published on npm
🦋  warn @astrojs/svelte is not being published because version 4.0.4 is already published on npm
🦋  warn @astrojs/tailwind is not being published because version 5.0.2 is already published on npm
🦋  warn @astrojs/vercel is not being published because version 5.2.0 is already published on npm
🦋  warn @astrojs/vue is not being published because version 3.0.4 is already published on npm
🦋  warn @astrojs/internal-helpers is not being published because version 0.2.1 is already published on npm
🦋  warn @astrojs/markdown-remark is not being published because version 3.5.0 is already published on npm
🦋  warn @astrojs/telemetry is not being published because version 3.0.4 is already published on npm
🦋  warn @astrojs/underscore-redirects is not being published because version 0.3.3 is already published on npm
🦋  info Publishing "astro" at "0.0.0-self-closing-children-20231120173528"
🦋  info Publishing "@astrojs/react" at "0.0.0-self-closing-children-20231120173528"
🦋  success packages published successfully:
🦋  astro@0.0.0-self-closing-children-20231120173528
🦋  @astrojs/react@0.0.0-self-closing-children-20231120173528
🦋  Creating git tags...
🦋  New tag:  astro@0.0.0-self-closing-children-20231120173528
🦋  New tag:  @astrojs/react@0.0.0-self-closing-children-20231120173528
Build Log

> root@0.0.0 build /home/runner/work/astro/astro
> turbo run build --filter=astro --filter=create-astro --filter="@astrojs/*" --filter="@benchmark/*"

• Packages in scope: @astrojs/alpinejs, @astrojs/cloudflare, @astrojs/internal-helpers, @astrojs/lit, @astrojs/markdoc, @astrojs/markdown-remark, @astrojs/mdx, @astrojs/netlify, @astrojs/node, @astrojs/partytown, @astrojs/preact, @astrojs/prefetch, @astrojs/prism, @astrojs/react, @astrojs/rss, @astrojs/sitemap, @astrojs/solid-js, @astrojs/svelte, @astrojs/tailwind, @astrojs/telemetry, @astrojs/underscore-redirects, @astrojs/vercel, @astrojs/vue, @benchmark/timer, astro, create-astro
• Running build in 26 packages
• Remote caching enabled
::group::create-astro:build
cache hit, suppressing logs 8249c3444fcc9238
::endgroup::
::group::@astrojs/prism:build
cache hit, suppressing logs b021aa7133667a19
::endgroup::
::group::@astrojs/telemetry:build
cache hit, suppressing logs 2e0085a3082188a3
::endgroup::
::group::@astrojs/internal-helpers:build
cache hit, suppressing logs 5c76356420e50355
::endgroup::
::group::@astrojs/markdown-remark:build
cache hit, suppressing logs ac13886d0818db48
::endgroup::
::group::astro:build
cache miss, executing c5b5e01851c4d689

> astro@0.0.0-self-closing-children-20231120173528 build /home/runner/work/astro/astro/packages/astro
> pnpm run prebuild && astro-scripts build "src/**/*.{ts,js}" && tsc && pnpm run postbuild


> astro@0.0.0-self-closing-children-20231120173528 prebuild /home/runner/work/astro/astro/packages/astro
> astro-scripts prebuild --to-string "src/runtime/server/astro-island.ts" "src/runtime/client/{idle,load,media,only,visible}.ts"


> astro@0.0.0-self-closing-children-20231120173528 postbuild /home/runner/work/astro/astro/packages/astro
> astro-scripts copy "src/**/*.astro" && astro-scripts copy "src/**/*.wasm"

::endgroup::
::group::@astrojs/alpinejs:build
cache miss, executing 1d66ce876800ec44

> @astrojs/alpinejs@0.3.1 build /home/runner/work/astro/astro/packages/integrations/alpinejs
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/underscore-redirects:build
cache miss, executing 63724292a679aea0

> @astrojs/underscore-redirects@0.3.3 build /home/runner/work/astro/astro/packages/underscore-redirects
> astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json

::endgroup::
::group::@astrojs/lit:build
cache miss, executing dae8fddd44416551

> @astrojs/lit@3.0.3 build /home/runner/work/astro/astro/packages/integrations/lit
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/tailwind:build
cache miss, executing d4f214f3e1ace4e4

> @astrojs/tailwind@5.0.2 build /home/runner/work/astro/astro/packages/integrations/tailwind
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/vercel:build
cache miss, executing 6f3e9db5a0414b21

> @astrojs/vercel@5.2.0 build /home/runner/work/astro/astro/packages/integrations/vercel
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/prefetch:build
cache miss, executing be7b227fe1823f73

> @astrojs/prefetch@0.4.1 build /home/runner/work/astro/astro/packages/integrations/prefetch
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/preact:build
cache miss, executing accf2cad52ef0ec8

> @astrojs/preact@3.0.1 build /home/runner/work/astro/astro/packages/integrations/preact
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/markdoc:build
cache miss, executing ce5eed56f23a06c0

> @astrojs/markdoc@0.7.2 build /home/runner/work/astro/astro/packages/integrations/markdoc
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/node:build
cache miss, executing 80e1bc5be7572c55

> @astrojs/node@6.0.4 build /home/runner/work/astro/astro/packages/integrations/node
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/svelte:build
cache miss, executing 31386d82a4dd6138

> @astrojs/svelte@4.0.4 build /home/runner/work/astro/astro/packages/integrations/svelte
> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc

::endgroup::
::group::@astrojs/rss:build
cache miss, executing 3edf7d34e977796d

> @astrojs/rss@3.0.0 build /home/runner/work/astro/astro/packages/astro-rss
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/react:build
cache miss, executing 1e53d89076464d7a

> @astrojs/react@0.0.0-self-closing-children-20231120173528 build /home/runner/work/astro/astro/packages/integrations/react
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@benchmark/timer:build
cache miss, executing 4ff91908f7ee901c

> @benchmark/timer@0.0.0 build /home/runner/work/astro/astro/benchmark/packages/timer
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/mdx:build
cache miss, executing 6f077b74d8be76ab

> @astrojs/mdx@1.1.5 build /home/runner/work/astro/astro/packages/integrations/mdx
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/solid-js:build
cache miss, executing c01e72c6cd31bb01

> @astrojs/solid-js@3.0.2 build /home/runner/work/astro/astro/packages/integrations/solid
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/partytown:build
cache miss, executing 96163288e008773f

> @astrojs/partytown@2.0.2 build /home/runner/work/astro/astro/packages/integrations/partytown
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/vue:build
cache miss, executing 50c5e7e50e1fe07c

> @astrojs/vue@3.0.4 build /home/runner/work/astro/astro/packages/integrations/vue
> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc

::endgroup::
::group::@astrojs/sitemap:build
cache miss, executing b6ec7cf2b9dcf34b

> @astrojs/sitemap@3.0.3 build /home/runner/work/astro/astro/packages/integrations/sitemap
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::

 Tasks:    24 successful, 24 total
Cached:    5 cached, 24 total
  Time:    39.143s 

@lilnasy lilnasy marked this pull request as ready for review November 20, 2023 17:38
@lilnasy lilnasy merged commit af43fb5 into main Nov 21, 2023
13 checks passed
@lilnasy lilnasy deleted the fix/9020 branch November 21, 2023 17:19
@astrobot-houston astrobot-houston mentioned this pull request Nov 21, 2023
natemoo-re pushed a commit that referenced this pull request Nov 22, 2023
#9141)

* add test script

* make children `undefined` with self-closing tags

* add changeset

* refactor: simplify
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope) pkg: react Related to React (scope) pr: docs A PR that includes documentation for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error img is a self-closing tag and must neither have children nor use dangerouslySetInnerHTML.
3 participants