Skip to content

Conversation

@JoviDeCroock
Copy link
Member

resolves #401

@changeset-bot
Copy link

changeset-bot bot commented Mar 7, 2021

⚠️ No Changeset found

Latest commit: e5323d6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2021

Size Change: +75 B (0%)

Total Size: 690 kB

Filename Size Change
packages/wmr/demo/dist/compat/index.html 1.49 kB +1 B (0%)
packages/wmr/demo/dist/index.********.js 7.14 kB +74 B (+1%)
ℹ️ View Unchanged
Filename Size Change
packages/wmr/demo/dist/about/index.html 657 B 0 B
packages/wmr/demo/dist/assets/Calendar.********.css 702 B 0 B
packages/wmr/demo/dist/assets/style.********.css 386 B 0 B
packages/wmr/demo/dist/chunks/class-fields.********.js 200 B 0 B
packages/wmr/demo/dist/chunks/compat.********.js 15.3 kB 0 B
packages/wmr/demo/dist/chunks/index.********.js 199 B 0 B
packages/wmr/demo/dist/chunks/prerender.********.js 2.45 kB 0 B
packages/wmr/demo/dist/class-fields/index.html 635 B 0 B
packages/wmr/demo/dist/env/index.html 713 B 0 B
packages/wmr/demo/dist/error/index.html 646 B 0 B
packages/wmr/demo/dist/files/index.html 675 B 0 B
packages/wmr/demo/dist/index.html 703 B 0 B
packages/wmr/demo/dist/lazy-and-late/index.html 657 B 0 B
packages/wmr/wmr.cjs 657 kB 0 B

compressed-size-action


if (typeof window !== 'undefined') {
render(<App />, document.body);
hydrate(<App />, document.body);

Choose a reason for hiding this comment

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

The typeof window !== 'undefined' browser check can be removed.

References:

if (typeof window === 'undefined') return;

https://github.com/preactjs/wmr/blob/main/packages/preact-iso/README.md#hydratejs

This method also checks to make sure its running in a browser context before attempting any rendering - if not, it does nothing.

@JoviDeCroock JoviDeCroock merged commit 91bc136 into main Mar 9, 2021
@JoviDeCroock JoviDeCroock deleted the fix-wmr-demo branch March 9, 2021 22:25
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.

packages/wmr/demo demonstrates static SSR prerender, but doesn't invoke hydrate()

3 participants