-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
chore: export jsxs
type
#13463
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
chore: export jsxs
type
#13463
Conversation
WalkthroughThe type declaration file for the Vue JSX runtime was updated to export the Changes
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
Size ReportBundles
Usages
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/vue/jsx-runtime/index.d.ts (1)
4-8
: Update the comment block to mentionjsxs
.The documentation above still talks only about
jsx / jsxDEV
. Addingjsxs
to the comment keeps the declaration self-documenting and avoids confusion for consumers skimming the header.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/vue/jsx-runtime/index.d.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: Redirect rules
- GitHub Check: Header rules
- GitHub Check: Pages changed
- GitHub Check: test / unit-test-windows
- GitHub Check: test / e2e-test
- GitHub Check: continuous-release
🔇 Additional comments (1)
packages/vue/jsx-runtime/index.d.ts (1)
9-9
:✅ Verification successful
Types added—verify runtime export exists to avoid mismatched runtime errors.
The extra alias
h as jsxs
is the right fix for the type-checker 👍.
Please double-check that the compiled runtime module (packages/vue/jsx-runtime/index.js
/ dist build) actually exportsjsxs
; otherwise users will get a runtimeProperty 'jsxs' does not exist
despite the typings compiling fine.You can run the quick check below:
🏁 Script executed:
#!/usr/bin/env bash # Look for an exported `jsxs` symbol in the built runtime. fd -e js -E '*.d.ts' 'jsx-runtime' \ | xargs -I{} grep -nH "jsxs" {}Length of output: 68
🏁 Script executed:
#!/usr/bin/env bash # Locate compiled JS files in jsx-runtime and verify `jsxs` export set -euo pipefail # Find all .js files in the jsx-runtime package js_files=$(fd -e js packages/vue/jsx-runtime) if [[ -z "$js_files" ]]; then echo "No JS files found in packages/vue/jsx-runtime" exit 1 fi echo "JS runtime files found:" echo "$js_files" echo echo "Searching for any occurrences of 'jsxs' in these files..." echo "$js_files" | xargs -r grep -nH "jsxs" || echo "❌ No occurrences of 'jsxs' found in compiled JS." echo echo "Searching specifically for an export statement of 'jsxs'..." grep -R "export.*jsxs" -n packages/vue/jsx-runtime || echo "❌ No 'export .* jsxs' found."Length of output: 470
🏁 Script executed:
#!/usr/bin/env bash set -euo pipefail echo "Looking for any occurrence of 'jsxs' in the compiled runtime sources under packages/vue/jsx-runtime…" if [ -d packages/vue/jsx-runtime ]; then grep -R "jsxs" -n packages/vue/jsx-runtime || echo "❌ No occurrences of 'jsxs' found in packages/vue/jsx-runtime" else echo "❌ Directory packages/vue/jsx-runtime not found" exit 1 fiLength of output: 580
Confirmed:
jsxs
is exported in the runtime buildVerified in both CommonJS and ESM outputs—no further action required to avoid mismatched runtime errors.
Files and locations:
- packages/vue/jsx-runtime/index.js (line 13):
exports.jsxs = jsx
- packages/vue/jsx-runtime/index.mjs (line 12):
export { Fragment, jsx, jsx as jsxs, jsx as jsxDEV }
According to this PR #7959, I think we should export
jsxs type
to avoid type errors in tsFor example, a type error will occur when using it like this
https://www.typescriptlang.org/play/?ts=5.8.3#code/JYWwDg9gTgLgBAbzgCzgXzgMyhEcDkyAhgM4wkDGUwYM+AUKJLInDBAFIkAeASgK4A7GKACm6LDjyFSMALT8RAGzns5AKx5yoQkSFEMm0eEgBiUIgHN9wgDRxN3e45ITsuAgDd+ogPSPtXTF8OF9fOABBTyJgJSIAIyVxEmBBCnEAA29RAAEAZgA6PIyC+np2Lj4g-QAKZBrCAEZ8e0JgAEJ8AEp7BHo4OHMrGxhbfoceMYGXKbhRJJGImBhqeMVRADkifQBhUlEALgJkGBAlBjQuoA
Summary by CodeRabbit
jsxs
function in the JSX runtime, enabling improved handling of JSX elements with multiple children.