Repository navigation
fix: run Lattish on non-DOM hosts (the tish VM, AppKit) - #18
Merged
Merged
Conversation
- Component ids live in an identity table instead of a property on the function: tish functions don't accept property writes and Map has no function keys. - A host config may provide schedule(cb) for deferred flushes and effects; the DOM host keeps queueMicrotask. - Profiling and the setState probe read from activeHost.profiler() instead of window. - typeof x === "undefined" instead of comparing to the undefined global.
Up to standards ✅🟢 Issues
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moo renders
@moo/uiplugin views with Lattish inside a capability-free tish VM, and its launcher UI through an AppKit host. Neither has a DOM, so four browser assumptions broke:fnIdStringstashed_lattishFnIdon the component function. Tish functions don't accept property writes, andMaphas no function keys, so ids now live in a small identity table (one entry per component type).queueMicrotask. A host config can now provideschedule(cb)to run them on its own loop (an AppKit run loop, a plugin VM's thread). The DOM host doesn't set it, so it keeps using microtasks.__lattishSetStateProbereadwindowdirectly. They now go throughactiveHost.profiler(), which the DOM host defines aswindowwhen it exists, so browser behaviour is the same.undefined. Comparisons against theundefinedglobal becametypeof x === "undefined", which works on every tish backend.Tests:
tish test test/jsx-runtime.test.tishpasses 5/5, andnpm run test:dompasses. TheLattish patch failed, remountline in the DOM run is printed onmaintoo.