Skip to content

Native attributes via "extra component data" and extension points. #4

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

Open
wants to merge 3 commits into
base: mounted-component
Choose a base branch
from

Conversation

kbond
Copy link
Owner

@kbond kbond commented Jan 31, 2022

Adds:

  • $extraData to MountedComponent
  • PostMountEvent to "do something with the extra mounted data"
  • CreateAttributesSubscriber listens to above event to turn extra attributes into ComponentAttributes
  • ComponentAttributePropertyHydrator to hydrate/dehydrate ComponentAttributes
  • On dehydration, runs extra data through registered dehydrators. Adds dehydrated values to data as readonly values. Also adds an array of the extra data keys to the readonly data (so we know what to rehydrate)
  • On hydration, run the extra data (found via extra data keys set above) through registered hydrators and set as extra data on MountedComponent.

Maybe not a big problem, but the component url now contains an extra key: _extra that is an array of "extra" values" - even if there are none.

Still WIP as there are some problems that need resolving related to hydration.

kbond pushed a commit that referenced this pull request Nov 6, 2022
# This is the 1st commit message:

WIP heavy refactoring to Component

Initial "hook" system used to reset model field after re-render

Adding a 2nd hook to handle window unloaded

reinit polling after re-render

Adding Component proxy

# This is the commit message #2:

fixing some tests

# This is the commit message #3:

Refactoring loading to a hook

# This is the commit message #4:

fixing tests

# This is the commit message #5:

rearranging

# This is the commit message #6:

Refactoring polling to a separate class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant