-
Notifications
You must be signed in to change notification settings - Fork 1
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
Create new CollectionEntry class and add lifecycle hooks to Collections API #2046
Merged
Conversation
This file contains 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
sebnitu
force-pushed
the
next-collections
branch
from
September 24, 2024 18:20
3cb3c35
to
bcb64a5
Compare
sebnitu
force-pushed
the
next-collections
branch
from
September 25, 2024 05:30
94f9d79
to
eb91eb9
Compare
sebnitu
force-pushed
the
next-collections
branch
from
September 25, 2024 05:30
eb91eb9
to
31c7c42
Compare
- Also includes some re-organizing of core files
…hooks to collection
…unt if no element was found
sebnitu
changed the title
Create new Entry class and optimize Collections API
Create new CollectionEntry class and optimize Collections API
Sep 26, 2024
sebnitu
changed the title
Create new CollectionEntry class and optimize Collections API
Create new CollectionEntry class and add lifecycle hooks to Collections API
Sep 26, 2024
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.
What changed?
The primary goal of this PR is to introduce the new
CollectionEntry
class used as the prototype of collection entries. This also introduces some new Collection API lifecycle hooks for both the root component (extended from Collection) and entries (extended from CollectionEntry).New API
applySettings()
(collection and entry) method that allows passing a configuration object to settings.createEntry()
(collection) method that returns an instantiation of theCollectionEntry
class.Lifecycle Hooks
Lifecycle hooks are applied using a new helper
lifecycleHooks
and is applied to mount/unmount and register/deregister actions. The following are the lifecycle hooks and the order that they are called:On Mount:
beforeMount
entry.mount
entry.beforeMount
entry.afterMount
beforeRegister
entry.beforeRegister
entry.afterRegister
afterRegister
afterMount
On Unmount:
beforeUnmount
entry.unmount
entry.beforeUnmount
entry.afterUnmount
beforeDeregister
entry.beforeDeregister
entry.afterDeregister
afterDeregister
afterUnmount
Additional changes
registerCollection
deregisterCollection
getCustomProps
now takes a collection entry as an argument.getElement
now returns null in final case.transition
no longer handles custom property fetching and instead requires some number value as the duration argument.toMilliseconds
which converts a string or number to milliseconds if possible.updateGlobalState
tosetGlobalState
.selector[Component]
toselector
eventListeners
id
strings instead of optionally an HTML element or collections entry.popover.cleanup()
topopover.floatingCleanup()
handleDocumentClick
call into theopen()
function in an event type conditional.