-
Notifications
You must be signed in to change notification settings - Fork 595
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
Adds support for FASTElement hydration #6977
Merged
janechu
merged 10 commits into
microsoft:master
from
prabhujayapal:users/prjayapa/add-ssr-hydration
Jul 5, 2024
Merged
Adds support for FASTElement hydration #6977
janechu
merged 10 commits into
microsoft:master
from
prabhujayapal:users/prjayapa/add-ssr-hydration
Jul 5, 2024
Commits on Jul 5, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 3d60271 - Browse repository at this point
Copy the full SHA 3d60271View commit details -
Adds support for FASTElement hydration
Original PR was made in a fork by `nicholasrice`. Below is the commit description from the original PR. This PR enables hydration of FAST custom elements from HTML emitted by SSR processes. This PR has three core areas: I've added a SSR example application to /examples to aid in debugging. This code was ported from external FAST. I've updated fast-ssr to accept a emitHydratableMarkup attribute. Configuring this option causes markers to be emitted during template rendering. These markers manifest either as element attributes (for attribute bindings / directives) and HTML comments (for content bindings / directives). These markers are used by fast-element to identify which elements belong to which views and bindings. fast-element has been updated to support hydrating views, details below. fast-element changes: Updated HydratableElementController to invoke hydrate on it's template during connection, also refactored ElementController base class to allow better direct extension by making private properties protected. Added a HydrationView class. An instance of this class represents a region of DOM created by a template during the SSR process. When this class binds for the first time, it walks the DOM tree between it's first and last nodes looking for binding markers emitted during fast-ssr rendering. When it finds binding markers, it associates the template binding to that DOM location. After all the nodes have been walked and the bindings targeted, behaviors for those bindings are created and bound, hooking up observable behavior. Updated bindings and directives to handle hydration scenarios. Unfortunately, I was not able to identify a good way to separate the hydration beahvior from the CSR binding behavior without implementing a large amount of code duplication. Instead, I added a lightweight isHydratable() test to determine whether bindings should go through hydration flows. Bindings and directives were then updated to not affect DOM during hydration flows.
Configuration menu - View commit details
-
Copy full SHA for 16c13d4 - Browse repository at this point
Copy the full SHA 16c13d4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 928ad63 - Browse repository at this point
Copy the full SHA 928ad63View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4361c73 - Browse repository at this point
Copy the full SHA 4361c73View commit details -
Configuration menu - View commit details
-
Copy full SHA for f3caa5c - Browse repository at this point
Copy the full SHA f3caa5cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7ca6be4 - Browse repository at this point
Copy the full SHA 7ca6be4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1441815 - Browse repository at this point
Copy the full SHA 1441815View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0deadfe - Browse repository at this point
Copy the full SHA 0deadfeView commit details -
Configuration menu - View commit details
-
Copy full SHA for aa57005 - Browse repository at this point
Copy the full SHA aa57005View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1c4ee83 - Browse repository at this point
Copy the full SHA 1c4ee83View commit details
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.