Repository navigation
Conversation
… EventRouter
- Pin all 21 `anomalyco/rune` dependencies to `6f0df42b84991341134f5dea59aad0ac73bd59ac`
(zero-build `.tsx`/`.jsx`, deferrable `RoutedEvent` & `EventRouter`, emoji caret, `AbortSignal.any`).
- Replace `@rune/ui` JS monkey-patching (`WRAP_UI_JS`, `AuxUiWrapCache`, `WrapState`, `WrapScope`)
in `apps/desktop/src/plugin_host/aux_windows/dispatch.rs` with Rune's native
`Script::set_event_router`, `Script::with_event_tag`, and owned deferrable `RoutedEvent`
(-452/+80 lines).
- Support `.tsx` and `.jsx` plugin modules across `opencode-plugin-runtime` (`is_script`,
`script_sources` fallback `init.js` -> `init.ts` -> `init.tsx` -> `init.jsx`, console source
locations) and `apps/desktop/build.rs`.
- Add ambient `__rune_jsx`, `__rune_frag`, `UiLibrary.{h,Fragment}`, `JSX.IntrinsicElements`
for all 52 contract UI nodes, and JSX compiler options in `opencode-plugin-spec` codegen
(`plugins/opencode.d.ts`, `plugins/tsconfig.json`).
- Add `--tsx` template mode to `scripts/new-plugin.{mjs,ps1,sh}`.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This branch has not been deployed
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.
Adopts
anomalyco/rune@6f0df42b84991341134f5dea59aad0ac73bd59ac(PR #3384), replaces@rune/uiJS monkey-patching for auxiliary windows with Rune's nativeEventRouter, and enables zero-build.tsx/.jsxplugins end to end.Architecture
flowchart LR subgraph Aux["Auxiliary Window Render"] R["render_entry(mailbox_key)"] --> T["script.with_event_tag(mailbox_key)"] T --> UI["@rune/ui, JSX __rune_jsx, HostNode, virtualList rows"] end UI -->|Callback fires on aux App| ER["Script EventRouter(tag, RoutedEvent, tx)"] ER -->|on_parent = true| SYNC["event.run(tx)"] ER -->|on_aux = true| Q["DISPATCH_QUEUE[mailbox_key] + parent.update(...)"] Q --> D["drain_dispatched: cx::enter(parent_app) -> event.run(tx) -> carry_out + sync_renders"]Changes
Cargo.toml,Cargo.lock): bumps all 21anomalyco/runepins to6f0df42b84991341134f5dea59aad0ac73bd59ac(zero-build.tsx/.jsx, deferrableRoutedEvent&EventRouter, emoji caret,AbortSignal.any).apps/desktop/src/plugin_host/aux_windows/{dispatch,mod}.rs): deletesWRAP_UI_JS,AuxUiWrapCache,WrapState,WrapEvent,WrapEffects,WrapScope,apply_ui_entries,collect_fn_entries, andwrapRow(-452 / +80 lines). UsesScript::set_event_router,Script::with_event_tag(mailbox_key, ...), and owned deferrableRoutedEventso standardui.*, JSX__rune_jsx,onDrag,onLink,onScroll,HostNodehandlers, andui.virtualListrows route onto the owning parentAppwith zero JS wrapping and zero overhead on untagged main-window renders..tsx/.jsxplugin loading (crates/opencode-plugin-runtime/src/{sources,console,hot}.rs,apps/desktop/build.rs,apps/desktop/src/plugin_host/runtime/hot.rs):is_scriptaccepts.js,.jsx,.ts(excluding.d.ts), and.tsx.script_sourcesfalls backinit.js->init.ts->init.tsx->init.jsx, skipping.ts/.tsxfiles when the entry is.js/.jsx.console::locationparses.js:,.jsx:,.ts:, and.tsx:source locations.crates/opencode-plugin-spec/src/codegen/ts.rs,plugins/opencode.d.ts,plugins/tsconfig.json): adds__rune_jsx,__rune_frag,UiLibrary.{h, Fragment},JSX.IntrinsicElementsacross all 52 contract UI nodes, and"jsx": "react"/"jsxFactory": "__rune_jsx"/"jsxFragmentFactory": "__rune_frag"intsconfig.json.scripts/new-plugin.{mjs,ps1,sh}): adds--tsxflag generating a typedinit.tsxstarter with custom<StatBadge />component,<icon>code</icon>,ctx.services,task.signal, and strict JSXtsconfig.json.Usage
Live Rendered Proof
tsx-demoDev, On).tsxStatus Bar