-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: the use hook didn't work when type is Slot. #7250
base: build/v2
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: defcde7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
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 |
commit: |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
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.
Hey, thank you for your contribution, but this is not a good solution. We can't add special condition for every edge case in the vnode-diff.
Tip: the problem is somewhere in this function
function addUseOnEvents( |
There are a couple of problems. Q: template also has a problem with usedocument. However I will find a better way to do it. And will tell you when I finish it |
I think we need to just modify jsx output to be:
instead of just |
if you need more help with that let me know |
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.
Good job! I have added some comments
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.
Awesome work! Nice job! 😃
I added some comments
@@ -176,7 +182,7 @@ function addUseOnEvents( | |||
} | |||
} | |||
} | |||
return jsxElement; | |||
return _jsx || jsx; |
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.
Just _jsx
isn't enough?
const jsxElement = findFirstStringJSX(jsx); | ||
let _jsx = jsx; |
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.
I think we don't use _
convention. Maybe we can name it jsxResult
?
const [jsxElement, _jsx] = addScriptNodeForInvisibleComponents(jsx[0]); | ||
return [jsxElement, jsx]; |
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.
just return addScriptNodeForInvisibleComponents(jsx[0])
doesn't work?
@@ -300,7 +301,8 @@ function processJSXNode( | |||
options.styleScoped, | |||
options.parentComponentFrame | |||
); | |||
const jsxOutput = applyQwikComponentBody(ssr, jsx, type); | |||
|
|||
const jsxOutput: any = applyQwikComponentBody(ssr, jsx, type); |
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.
Can you remove any
type here?
@@ -21,7 +23,7 @@ Error.stackTraceLimit = 100; | |||
|
|||
describe.each([ | |||
{ render: ssrRenderToDom }, // | |||
{ render: domRender }, // | |||
{ render: domRender }, /// |
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.
Remove additional /
What is it?
#7230
fix: modify jsx output when it is Slot.
example :
Description
Checklist
pnpm change