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

Only check functions called on first paint #159

Open
gracebrack opened this issue Jun 27, 2024 · 0 comments
Open

Only check functions called on first paint #159

gracebrack opened this issue Jun 27, 2024 · 0 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@gracebrack
Copy link

gracebrack commented Jun 27, 2024

@lwc/lwc/no-unsupported-ssr-properties and @lwc/lwc/no-restricted-browser-globals-during-ssr check all functions in a component for unsafe SSR practices. However, not all functions need to be SSR safe, only those called on first paint.

Example:

export default class ExampleButton {
    handleFocus() {
        this.dispatchEvent(new CustomEvent('focus')); //@lwc/lwc/no-unsupported-ssr-properties error
        console.log(window.location.href) //@lwc/lwc/no-restricted-browser-globals-during-ssr error
    }
}

Screenshot 2024-07-15 at 3 28 41 PM

Relevant Slack Thread: https://salesforce-internal.slack.com/archives/C5W3E40TC/p1719415297404469

@nolanlawson nolanlawson added the kind/bug Categorizes issue or PR as related to a bug. label Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants