Skip to content
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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
docs: major changeset
bennypowers committed Feb 12, 2025
commit 9217a54ec34c2a71ae1cc44e9805378ae868e456
30 changes: 28 additions & 2 deletions .changeset/clear-pugs-make.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
---
"@patternfly/pfe-core": patch
"@patternfly/pfe-core": major
"@patternfly/elements": patch
---
Enable context protocol in SSR scenarios.
Enable `connectedCallback()` and context protocol in SSR scenarios.

BREAKING CHANGE
This change affects any element which is expected to execute in node JS when
lit-ssr shims are present. By enabling the `connectedCallback()` to execute
server side. Elements must ensure that their connectedCallbacks do not try to
access the DOM.

Before:

```js
connectedCallback() {
super.connectedCallback();
this.items = this.querySelectorAll('my-item');
}
```

After:
```js
connectedCallback() {
super.connectedCallback();
if (!isServer) {
this.items = this.querySelectorAll('my-item');
}
}
```