Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions 38 apps/webapp/app/clientBeforeFirstRender.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* Runs once on the client, synchronously, before React hydrates the app.
* Reserved for housekeeping that must happen before any component mounts.
*/
export function clientBeforeFirstRender() {
cleanupLegacyResizablePanelStorage();
}

/**
* Earlier versions of the resizable panel library wrote a per-session
* localStorage entry for every PanelGroup, including ones without an
* `autosaveId`. The keys look like `panel-group-react-aria<n>-:<rid>:`
* and accumulate without bound across sessions until they exhaust the
* ~5 MB origin quota and break subsequent `setItem` calls.
*
* The library no longer behaves this way, but existing users still carry
* the residue. Evict it (plus the orphaned `panel-run-parent-v2` key from
* the v2→v3 autosaveId bump) once on load.
*/
function cleanupLegacyResizablePanelStorage() {
try {
const toRemove: string[] = [];
for (let i = 0; i < window.localStorage.length; i++) {
const key = window.localStorage.key(i);
if (
key &&
(key.startsWith("panel-group-react-aria") || key === "panel-run-parent-v2")
) {
toRemove.push(key);
}
}
for (const key of toRemove) {
window.localStorage.removeItem(key);
}
} catch {
// localStorage may be disabled (private browsing, security policy)
}
}
3 changes: 3 additions & 0 deletions 3 apps/webapp/app/entry.client.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { RemixBrowser } from "@remix-run/react";
import { hydrateRoot } from "react-dom/client";
import { clientBeforeFirstRender } from "./clientBeforeFirstRender";
import { LocaleContextProvider } from "./components/primitives/LocaleProvider";
import { OperatingSystemContextProvider } from "./components/primitives/OperatingSystemProvider";

clientBeforeFirstRender();

hydrateRoot(
document,
<OperatingSystemContextProvider
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.