preactjs / wmr

👩‍🚀 The tiny all-in-one development tool for modern web apps.
https://wmr.dev/
MIT License
4.93k stars 109 forks source link

(preact-iso) - avoid calling onLoadEnd on every render #864

Closed JoviDeCroock closed 3 years ago

JoviDeCroock commented 3 years ago

Fixes https://github.com/preactjs/wmr/issues/836

Ref solution: https://github.com/preactjs/wmr/pull/864/commits/d6c87e340538c341e7826b7b043dec03ddc306fd (ties into the effect on every render) State solution: https://github.com/preactjs/wmr/pull/864/commits/960364758bd818d8c00a482ef4c346c7adc05554 (avoids using effect on every render)

changeset-bot[bot] commented 3 years ago

🦋 Changeset detected

Latest commit: 7e28300de70f048337c913c382863f53b228cde3

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

This PR includes changesets to release 1 package | Name | Type | | ---------- | ----- | | preact-iso | 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

github-actions[bot] commented 3 years ago

Size Change: +126 B (+2%)

Total Size: 6.32 kB

Filename Size Change
packages/preact-iso/.dist/index.********.js 1.72 kB +52 B (+3%)
packages/preact-iso/.dist/prerender.********.js 348 B -2 B (-1%)
packages/preact-iso/router.js 2.54 kB +76 B (+3%)
ℹ️ View Unchanged | Filename | Size | | :--- | :---: | | `packages/preact-iso/hydrate.js` | 290 B | | `packages/preact-iso/index.js` | 195 B | | `packages/preact-iso/lazy.js` | 594 B | | `packages/preact-iso/prerender.js` | 629 B |

compressed-size-action

developit commented 3 years ago

If we land this, I feel like we should also land a callback that fires after every successful route (sync or async), like onDidRoute. I often want to register a callback to do stuff like change title/reset scroll/etc