Menu

Every page of our site adds the same nine properties to window, and one of them says framer-motion is mounted on a page with no animation
📰

Every page of our site adds the same nine properties to window, and one of them says framer-motion is mounted on a page with no animation

DEV Community: nextjs·Daniel Pertu·about 18 hours ago
#MY7SNoPM
#devtonextjs#devto#dev#window#every
Long article (1076 words) — no AI summary yet.
Reading 0:00
15s threshold

Most measurements of a page's cost are about what it downloads. I have done plenty of those for Notifio's website , including a 38-page coverage run of the JavaScript it ships . This one is smaller and stranger: what is left behind on window once the page has finished loading.

The question came from an old habit. When I read a site's globals in the console I learn more about its dependencies in ten seconds than in ten minutes of reading its bundle, because every library that shares state across modules puts a name there. So: what does ours say?

The method

Everything a browser gives window is noise, so I needed a baseline from the same browser. I loaded https://notifio.app/robots.txt (a text document, no scripts), took Object.getOwnPropertyNames(window) , and subtracted it from the same call on every page in the sitemap , after load plus a pause of a few seconds for hydration. Headless Chromium from the app's own Playwright install, 38 pages.

const base = new Set ( await text . evaluate ( ( ) => Object .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.