Open
Conversation
- Allow kebab-case, camelCase OR underscore_case for hook name - Remove unused argument from `add()` - Remove unused signatures from `add()` (multiple callbacks at the same hook or the same callback on multiple hooks) - Remove unised logic from constructor (new Hooks(hooksObj)) - New `Hook` class to manage hook metadata
…text Unused right now, but the intent is we can replace `init`, `setup` etc that way
Co-authored-by: Dmitry Sharabin <dmitrysharabin@gmail.com>
Co-Authored-By: Dmitry Sharabin <dmitrysharabin@gmail.com>
Co-Authored-By: Dmitry Sharabin <dmitrysharabin@gmail.com>
Co-authored-by: Dmitry Sharabin <dmitrysharabin@gmail.com>
Co-authored-by: Dmitry Sharabin <dmitrysharabin@gmail.com>
Co-authored-by: Dmitry Sharabin <dmitrysharabin@gmail.com>
Co-authored-by: Dmitry Sharabin <dmitrysharabin@gmail.com>
…o hooks-plugins
- Port formAssociated to the new syntax, - Split to three - Rename to "form behavior"
- Make it easier for subclasses to `setup()` - Declarative way to include plugins
- Don't error if internals are already attached or when it's not supported
Inspired by first-class protocols
Deleted apply-mixins.js and define-mixin.js from src/mixins as they are no longer needed.
Still missing dynamic slots and auto-slotting by selector
So that subclasses do not overwrite parent class hooks and plugins don't need to be installed separately on every subclass
Co-authored-by: Dmitry Sharabin <dmitrysharabin@gmail.com>
- Don’t shadow `attachShadow` from `HTML.prototype` - Avoid infinite recursion
DmitrySharabin
commented
Dec 16, 2025
src/elements/base.js
Outdated
| } | ||
| }, | ||
|
|
||
| constructed () { |
Member
Author
There was a problem hiding this comment.
Interestingly, the code of this hook should run at a different time depending on cases:
- It should run before we begin to work with internals, form-associated, events, etc
- But at the same time, it should run after an element is connected, so all other custom elements used inside the element are connected and ready to be queried
I can't think of a hook that we should use here. I'm puzzled. 😕
Member
Author
There was a problem hiding this comment.
first_connected might be a better choice? Hm...
Contributor
There was a problem hiding this comment.
I think perhaps we should use a proxy, like I did with slots. Then it's only queried when needed.
873e042 to
ec80242
Compare
Co-authored-by: Dmitry Sharabin <dmitrysharabin@gmail.com>
ec80242 to
267f801
Compare
9df45a0 to
b667ca4
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.