Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@abhagta-sfdc
Copy link
Collaborator

No description provided.

@abhagta-sfdc abhagta-sfdc force-pushed the abhagta/ssr-v2-support branch from 8e6a87c to 95d92b0 Compare March 17, 2025 14:37
Copy link
Contributor

@divmain divmain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good except for the test snapshots. All the __lwc_scope_token__ stuff looks really odd, and I want to confirm that it is intended before merging.

Copy link

@lpomerleau lpomerleau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! What are the steps for a component developer to start using SSRv2 unit testing? Do they just need to upgrade their packages?


const renderedComponent =
ssrMode !== 'v1'
? await serverSideRenderComponent(tagName, Ctor, props)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We recently turned on style dedupe with serverSideRenderComponent in LWR. Should that be an option here? It will change the SSRed output, but I'm not sure if that matters for the unit tests 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im not really familiar with style dedupe. @divmain Can you confirm if we need this for unit testing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My inclination is to wait on style-dedupe for now:

  • If we turn it on now, everybody's fixtures will change and their tests will fail.
  • If we tell them "your fixtures may change due to style-dedupe" then component owners may simply accept all changes to their fixtures without thinking critically about those changes.
  • However, that means any actual SSRv2 issues will be less likely to be caught.

We can turn style-dedupe on sometime in the future, once we're past the initial surge of SSRv2-related issues.

@abhagta-sfdc
Copy link
Collaborator Author

Nice! What are the steps for a component developer to start using SSRv2 unit testing? Do they just need to upgrade their packages?

Yes they need to update the tooling version in the package and update the calls to renderAndHashComponentin to await renderAndHashComponent their server side tests as its a async func now

Copy link
Contributor

@divmain divmain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Thank you!


const renderedComponent =
ssrMode !== 'v1'
? await serverSideRenderComponent(tagName, Ctor, props)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My inclination is to wait on style-dedupe for now:

  • If we turn it on now, everybody's fixtures will change and their tests will fail.
  • If we tell them "your fixtures may change due to style-dedupe" then component owners may simply accept all changes to their fixtures without thinking critically about those changes.
  • However, that means any actual SSRv2 issues will be less likely to be caught.

We can turn style-dedupe on sometime in the future, once we're past the initial surge of SSRv2-related issues.

@abhagta-sfdc abhagta-sfdc merged commit 9f28dd1 into master Mar 18, 2025
8 checks passed
@abhagta-sfdc abhagta-sfdc deleted the abhagta/ssr-v2-support branch March 18, 2025 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants