Skip to content

feat: allow connectedCallback calls to be filtered in SSR - #3159

Open
zeroedin wants to merge 1 commit into
mainfrom
feat/connectedcallback-filter
Open

feat: allow connectedCallback calls to be filtered in SSR#3159
zeroedin wants to merge 1 commit into
mainfrom
feat/connectedcallback-filter

Conversation

@zeroedin

@zeroedin zeroedin commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

What I did

Replaced the deprecated globalThis.litSsrCallConnectedCallback flag with the LitElementRenderer.renderOptions API introduced in @lit-labs/ssr@4.1.0.

  • core/pfe-core/ssr-shims.ts: Removed the deprecated global. Exported a new ssrCallConnectedCallback(predicate?) function that pushes a filter onto LitElementRenderer.renderOptions. Without a predicate, all elements opt in (backwards-compatible).

  • tools/pfe-tools/ssr/global.ts: renderGlobal accepts an optional third connectedCallbackFilter parameter, forwarded to ssrCallConnectedCallback. Existing call sites pass no filter and retain the previous behavior.

  • tools/pfe-tools/package.json: Bumped @lit-labs/ssr peer dep to ^4.1.0 to require the renderOptions API.

https://github.com/lit/lit/blob/main/packages/labs/ssr/README.md#litelementrenderer-configuration

Closes #3158

Testing Instructions

Notes to Reviewers

@changeset-bot

changeset-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2a34a55

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@patternfly/pfe-core Minor
@patternfly/pfe-tools Minor

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

@zeroedin
zeroedin requested a review from adamjohnson August 6, 2026 20:23
@netlify

netlify Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deploy Preview for patternfly-elements ready!

Name Link
🔨 Latest commit 2a34a55
🔍 Latest deploy log https://app.netlify.com/projects/patternfly-elements/deploys/6a74ed27fcceea0008686e1b
😎 Deploy Preview https://deploy-preview-3159--patternfly-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

[bug] ssr-shims.js uses deprecated globalThis.litSsrCallConnectedCallback

1 participant