-
Notifications
You must be signed in to change notification settings - Fork 97
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
fix(core): ssr events #2891
base: main
Are you sure you want to change the base?
fix(core): ssr events #2891
Conversation
🦋 Changeset detectedLatest commit: 453280b The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Commitlint tests passed!More Info{
"valid": true,
"errors": [],
"warnings": [],
"input": "fix(core): ssr events"
} |
✅ Deploy Preview for patternfly-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
||
; | ||
// @ts-expect-error: opt in to event support in ssr | ||
globalThis.litSsrCallConnectedCallback = true; |
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.
should we really be making this decision for our users? or should e.g. rhds' ssr regime choose whether or not to enable this?
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'm having a hard time trying to figure out if this is hostile in any way. Maybe I'm misunderstanding, but doing otherwise would mean that we'd need to wrap all addEventListeners in !isServer()
in component connectedCallback() correct? Could there be a helper method that replaces isServer() and includes the check to see if the litSsrCallConnectedCallback is enabled on the server while in SSR and otherwise falls back to normal isServer()?
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.
This PR should be pared down to concentrate on lit, context-api, and table changes
slot controller changes should be deferred to another PR
This will be addressed in a later PR
pending later PR
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.
Maybe move these changes to a new PR since they are less concerned with the SSR changes and are a fix for pf-table
explicitly, although the context change allows it to happen in SSR.
The ## What I did
write a server-sidedeferred to feat(core): slot controller ssr hint attributes #2893SlotController
which adds hint attributes to all elements that useSlotController
.Testing Instructions
addEventListener
Notes to Reviewers
connectedCallback
andhostConnected
- i suspect some of these should be refactored in order to make that more clear from the code