-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
feat(runtime-vapor): component emits #42
Conversation
…component-props
…component-props
Size ReportBundles
Usages
|
|
…component-props
…ejs-core into feat/component-emits
playground/src/props.js
Outdated
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've just added a playground for checking the default values.
It's not related to the content of this PR, though.
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.
2023-12-10.13.37.25.mov
…component-emits
…component-emits
…component-emits
…component-emits
This PR is on hold until this issue is resolved. |
…at/component-emits
…at/component-emits
…component-emits
🤷♂️
|
…component-emits
✅ Deploy Preview for vapor-repl ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
2f9e25d
to
0255505
Compare
Closes #41
Summary
I have implemented emit.
This branch is derived from the branch for implementing props.
Please merge the props PR first.
Points I'm unsure about
Flags related to lifecycle
I had implemented it so that isMounted is set to false when unmounting,
In traditional components, it seems that isUnmounted is set to true.
Which approach should we follow for the implementation? (In this PR, I have added the isUnmounted flag.)
Holding rawProps in ComponentInternalInstance
I think we will face the same issue when implementing attr, but in emit, we need to search for handlers from user-defined raw props, not those defined as propsOption.
In the past, raw props were held in instance.vnode.props, but at the moment, there is no implementation that handles vnode, so I am directly holding them in ComponentInternalInstance.
Is this okay?
Caching
Similar to props, I haven't implemented caching because I don't understand how to handle it.
Should we also implement it in Vapor Mode?
Validations
Should be emits validations are implemented?
https://vuejs.org/guide/components/events.html#events-validation
How to confirm the operation
Since the compiler implementation is not yet available, I have written the expected JavaScript code as the compilation result in
playground/src/emits.js
.code
Left button: normal emit
Right button: emit once
2023-12-10.13.38.52.mov