This repository was archived by the owner on Jul 19, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 114
feat(runtime-vapor): component emits #42
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Size ReportBundles
Usages
|
|
…ejs-core into feat/component-emits
ubugeeei
commented
Dec 10, 2023
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
This PR is on hold until this issue is resolved. |
…at/component-emits
…at/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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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