Merge pull request #26326 from overleaf/td-clean-up-scope-store

Create separate window.overleaf.unstable.store based on React context values

GitOrigin-RevId: 68f070a6fc5e2965a82720024d91b16fa622b28b
This commit is contained in:
Tim Down
2025-07-02 08:05:53 +00:00
committed by Copybot
parent dc97da1276
commit 904fac958d
34 changed files with 621 additions and 251 deletions
@@ -81,6 +81,13 @@ export const IdeReactProvider: FC<React.PropsWithChildren> = ({ children }) => {
const [scopeEventEmitter] = useState(
() => new ReactScopeEventEmitter(eventEmitter)
)
const [unstableStore] = useState(() => {
const store = new ReactScopeValueStore()
// Add dummy editor.ready key for Writefull, that relies on this calling
// back once after watching it
store.set('editor.ready', undefined)
return store
})
const [startedFreeTrial, setStartedFreeTrial] = useState(false)
const release = getMeta('ol-ExposedSettings')?.sentryRelease ?? null
@@ -179,6 +186,7 @@ export const IdeReactProvider: FC<React.PropsWithChildren> = ({ children }) => {
ide={ide}
scopeStore={scopeStore}
scopeEventEmitter={scopeEventEmitter}
unstableStore={unstableStore}
>
{children}
</IdeProvider>