Repository navigation
chore(deps): update opencode host runtime to v0.9.0 - #21
Merged
Merged
Conversation
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.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
0.8.4→0.9.00.8.4→0.9.0Release Notes
anomalyco/opentui (@opentui/core)
v0.9.0Compare Source
In 0.9.0, Markdown runs on OpenTUI's native engine, the same engine the Rust widget uses. In 0.8.3,
MarkdownRenderableparsed withmarkedin JavaScript and lexed the open end of the document again on every chunk. In a growing list, the open end is the whole list, so streaming one list took 21,430 million instructions.MarkdownRenderablealso sent all prose to the Tree-sitter worker for styling. The native engine reads each chunk once and writes paragraphs and headings into their text nodes itself. Streaming the same list now takes 5.9 million instructions. Over one streamed answer, JavaScript's styled-text writes for prose went from 1,595 to 0, and the prose characters sent to the highlighter went from 56,223 to 0.Because the engine follows CommonMark 0.31.2 and GFM, some documents look different. While streaming, a line that can still change kind, such as a possible table row or a heading underline, waits for its end before it shows. A table appears when its delimiter row arrives, and task items show ☐ and ☑. The token tree is gone, so
renderNode(token, context)becomesrenderBlock(block, context), and you switch onblock.kindinstead oftoken.type:internalBlockModeis gone: every top-level block is its own renderable, one blank row apart. Code that read the parse state readsblocksandcommittedBlockCountinstead, and the React and Solid prop isrenderBlocktoo. The Markdown page has the full migration list.The new
inlineHookoption replaces the private chunk callback that apps had to override to show IDs as titled links. That callback missed the streaming preview and table cells, so on a typical answer 9 of 18 frames showed the raw ID. The hook gets the spans of every paragraph, heading, and table cell and returns the spans to show. A span with atargetin a paragraph or heading becomes clickable throughmarkdown.targetAt(x, y).inlineHookFilterruns the hook only on blocks that contain one of its strings, so other blocks stay on the native path:Input now has one stdin parser, the native one. 0.8 had two: the TypeScript parser was the default, and the native parser was opt-in through
experimental_nativeInput. They did not always return the same keys for the same bytes. The TypeScript parser gaveESC ,no key name, droppedCSI 1;2 Rinstead of reporting Shift+F3, and read an SGR button-32 report as a move instead of a drag. Removeexperimental_nativeInputandstdinParserMaxBufferBytesfrom your renderer config. To report a parser bug, attach anOTUI_STDIN_LOGcapture.parseKeypress()keeps its signature but decodes with the native parser, so under Node it needs--experimental-ffi. You can feel one change: once a terminal confirms the Kitty keyboard protocol, Escape arrives at once instead of after a 20 ms wait.The declarative composition layer is gone too:
h(),delegate(),vstyles, and the construct factories such asBox()andText(). Create renderables with their classes and add their children:Use the
ttemplate instead ofvstyles, for examplet`${bold("Done")}`, and therenderAfteroption instead ofGeneric().Renderable.add()now accepts only aRenderable, so narrow a nullable value before you add it.React and Solid now handle a removed prop the same way. They used to map JSX props to renderables in separate code, and the two disagreed. In Solid, a key removed from
stylekept its old value, sostyle={on ? { border: true } : {}}left the border on screen. React wrotenullfor a removed prop, andopacity = nullmeans 0, so removingopacityhid the box. Both reconcilers now callsetRenderablePropin Core and write a removed prop asundefined, which restores the default. If your custom setter checksvalue === nullto detect removal, make it acceptundefinedtoo.Two new edit buffer methods convert between JavaScript string indexes and cell offsets. Edit buffer offsets count display cells, but JavaScript indexes a string in UTF-16 units, and the two diverge at the first tab or wide character. In
ab\tcdwith the default tab width of 2,dis at string index 4 but at cell offset 5, so a plugin that passed the string index deletedc. Neither method moves the cursor:The new
layoutMode: "list"makes long columns cheaper to lay out. Before, a long column, such as a transcript, made Yoga run its flex pass over every row when one row changed. A list lays out its rows as a column and reuses the size of each row that did not change. Rows never grow or shrink; otherwise, a list lays out like a flex column withoverflow: "scroll". For ScrollBox content, setcontentOptions: { layoutMode: "list" }. In a 1,000-row select, a frame that appends one row costs 1.54 million instructions in list mode. Before list mode reused row sizes, the same frame cost 22.39 million.Breaking changes
MarkdownRenderableparses with the native engine, andmarkedis no longer a dependency.renderBlock(block, context)replacesrenderNode(token, context), also as a React and Solid prop.blocksandcommittedBlockCountreplaceinternalBlockModeand the parse state. Paragraphs and headings areTextRenderables, so code that setonChunksoronHighlighton them moves toinlineHook. The hook runs when the content or options change, also inside a setter, not when a highlight arrives. See Markdown. (#2079, #2023)MarkdownCodeBlockRenderergets aMarkdownCodeBlockinstead ofTokens.Code. Itsclosedfield tells whether the closing fence has arrived. See Markdown. (#2079)h(),VNode,delegate(),instantiate(),Generic(),VRenderable,vstyles, and the factoriesBox(),Text(),Input(),Select(),TabSelect(),ASCIIFont(),FrameBuffer(),Code(), andScrollBox(). Create renderables withnewandadd(), use thettemplate instead ofvstyles, and use therenderAfteroption instead ofGeneric(). See Renderables. (#2000)Renderable.add()andinsertBefore()accept only aRenderable, andTextRenderableaccepts only text children. Narrow a nullable orBaseRenderablevalue before you add it. See Renderables. (#2000)experimental_nativeInputandstdinParserMaxBufferBytesoptions, theOTUI_NATIVE_INPUT_PARSERandOTUI_NATIVE_INPUT_SHADOWvariables, andStdinParserwith its types are removed. Userenderer.keyInput,prependInputHandler, orsubscribeOscinstead. This fixes the F3 bugs that @FasterPHP reported. See Keyboard input. (#1981)MouseParserandnonAlphanumericKeysare removed.parseKeypress()decodes with the native parser, needs--experimental-ffiunder Node, and returnsnullfor empty input. Use renderable mouse events orcreateMockMouseinstead ofMouseParser, andterminalNamedSingleStrokeKeysinstead ofnonAlphanumericKeys. See Keyboard input. (#2016)stylekey through the newsetRenderablePropasundefined, notnull, so the setter restores its default. A custom setter that checksvalue === nullmust also acceptundefined. See React bindings. (#2018)InputRenderableOptionsno longer hasonSubmit, whichInputRenderablenever called. Listen for theenterevent instead. Contributed by @posva. See Input. (#1216)ExtmarksController.adjustExtmarksAfterDeletion()is removed; the edit buffer now moves extmarks itself. For a malformed range,create()returns 0 instead of throwing an error. Because the buffer owns its extmarks, a controller'sdestroy()leaves them in place; callclear()to drop them. See Editing buffers and views. (#2104)zIndexpaint in child order instead of the order they were added. A renderable inserted or moved before a sibling paints below it, and where they overlap, the later sibling gets the click. This also applies to a Solid<Show>before an overlapping sibling. To keep a renderable on top, give it a higherzIndex. See Renderables. (#2119)yoga.yogaNodeGetContentBoxChecked(node, &box)is nowyoga.yogaNodeGetLayoutChecked(node, &layout, &box).yoga_c.otYogaNodeGetComputedLayouttakes a third argument,nullor a four-float content box. See Zig. (#2090)opentui.hhas new calls and types, butOT_CONTEXT_ABI_VERSIONstays 2. Build a C or Rust host with the header, bindings, and library from the same release.opentui-sysfails its build when the library's header differs from its bindings. See C. (#1949, #2049, #2104)opentui-sys,opentui, andopentui-sshmoved into the OpenTUI repository and are not published, so depend on them by Git revision. On Linux and macOS they link the static library by default; for the shared library, turn off default features in every crate that depends on them. On Windows, shipopentui.dllbeside the app. See Rust. (#1946, #1949, #1984, #1992)Markdownparses with the native engine and follows CommonMark and GFM, so rules and setext headings can render differently. Its code fences now wrap by word; a standaloneCodestill does not wrap.Input::max_lengthcounts UTF-16 units, as Core does. See Rust. (#2049, #2089, #2017)clear_highlights, a theme change brings syntax colors back only at the next edit. See Rust. (#2026, #2030)Host::releasehands the terminal to its task as on Unix.ScrollbackSurface::commit_rowsfails after a change of width or width method until the surface renders again. See Rust. (#1950, #1958, #2043, #2082)Added
EditBuffer.stringIndexToCellOffset()andcellOffsetToStringIndex()convert between a JavaScript string index and a cell offset in the buffer. They do not move the cursor. Reported by @cameronr. See Editing buffers and views. (#2110)MarkdownRenderabletakesinlineHookandinlineHookFilterto rewrite the spans of paragraphs, headings, and table cells.rerunInlineHook()runs the hook again without reparsing.targetAt(x, y)returns thetargetof the paragraph or heading span that the last frame drew at that position. See Markdown. (#2023, #2079)extensions: ["math"],MarkdownRenderableparses inline math into spans withmathset, and display math into amathcode block. See Markdown. (#2079, #2078)TextTableRenderabletakes acolumnAlignmentsoption with"left","center", or"right"for each column. See TextTable. (#2112)alignContentandaspectRatiolayout options work on renderables, ScrollBox content, and React and Solid props.getAlignContent()andgetAspectRatio()read them. Requested by @nwidynski. See Layout. (#2096)layoutMode: "list"lays out children as a column without a flex pass over each row, so a change to one row lays out only that row. ScrollBox content takes it throughcontentOptions. See Layout. (#1989, #1960, #1987)StyleDefinitionand theme token styles takestrikethrough, and Code, Markdown, and Tree-sitter styles draw it. See Code. (#2027)super+backspace) deletes to the start of the line in terminals that report Super. If your app uses this key, overridekeyBindings. Contributed by @remorses. See Textarea. (#817)OPENTUI_FORCE_TRUECOLORfrom the client environment. See SSH. (#1967)OPENTUI_FORCE_TRUECOLOR=1forces 24-bit color, for example inside GNU screen with itstruecolorsetting on. See Environment variables. (#1967)zig build -Dvideo=falsebuilds the same native API without FFmpeg. A video in such a build reports that decoding is unavailable. Requested by @AaronFeledy. See Deploy an OpenTUI application. (#2098)ot_markdown_*functions expose the streaming Markdown engine. They create a document, append or set its source, read changed blocks and leaves, and bind paragraphs to text nodes.OT_MD_BLOCK_ALIGN_LEFTandOT_MD_BLOCK_ALIGN_RIGHTgive the alignment of a table cell. See C. (#2037, #2049, #2112)ot_edit_buffer_markandot_edit_buffer_get_marksstore marks in an edit buffer, which moves them with edits and restores them on undo.ot_edit_buffer_convert_offsetconverts between bytes, UTF-16 units, and cells. See C. (#2094, #2110)ot_edit_buffer_set_layerandot_text_buffer_set_layerwrite a highlight layer ofot_highlight_runbyte runs in one call.ot_context_group_setregisters a group set of up toOT_GROUP_SET_NAME_COUNT_MAXstyle names. See C. (#2026, #2091, #2030)OT_STYLE_ENUM_LAYOUT_MODEwithOT_LAYOUT_MODE_LISTgives a box list layout.ot_scene_get_layoutwithOT_LAYOUT_CONTENTreturns the content rect of a text node inside its padding. See C. (#1960, #2054)ot_scene_hit_test_excludingskips one node,ot_scene_get_text_byte_atreturns the byte that the last frame drew at a cell, andot_scene_clear_childrendetaches all children in one pass.ot_scene_paintedtells whether the last frame painted a node. See Frames and output. (#2065, #2019, #1943, #2036)OT_EDITOR_STYLE_ATTRIBUTE_MASKtells which attribute bits a syntax style supplies, so a later style name can clear bold as well as set it. See C. (#2027)OT_INPUT_EXPECT_ESCAPE_PREFIXmakes the input parser read Escape without a timeout, andOT_CONTROL_END_REPLY_SENTINELends the reply sentinel. See Host I/O and time. (#1948)opentui.hdefines macros for values it used to describe only in comments: text attributes, Kitty keyboard flags, cell kinds, the indexed palette, embedded terminal codes, cursor styles, limits, and Yoga enums. The values do not change. See C. (#2020)OT_SCENE_RECORD_CELLSpaint record draws a run ofot_scene_cellcells in rows of a given width, each as a blended cell draw would. Rust widgets write it withPainter::cells. See Frames and output. (#2128)App::on_animation_tickandWidget::on_animation_tickrun animations on Core's shared clock, so animations with equal rates tick in the same frames. An animation bound to a widget parks while the widget is hidden, detached, or clipped out of view.AnimationTick::followadds a widget to an animation, andWidget::downgradereturns aWeakWidgetthat does not keep the widget alive. See Rust. (#2120, #2134)ScrollBox::on_scrollreports each move of a scroll box once, with its position and cause. See Rust. (#2129)Code::finish()frees the parse tree of a view whose text stopped growing, and the next change parses again. A transcript with 100 written files uses 36 MB less heap. See Rust. (#2126)Changed
"coalesced"default now see blank rows between some blocks. SettableOptions.style: "columns"to get the old top-level table style. See Markdown. (#2079)~~text~~unless the theme setsstrikethrough: false. See Markdown. (#2027)getLineHighlights()on a streaming fence returns no syntax records.MockTreeSitterClientin@opentui/core/testinghashighlightAppend(). See Syntax highlighting with Tree-sitter. (#2102)waitForThemeMode()resolves withnullwhen no OSC 11 reply arrives, andgetPalette()reports the default colors of a terminal that does not answer OSC 4. See Terminal capabilities. (#1969)writeToScrollbackcommits stay at 8 per frame. See Renderer. (#2084)ThreeRenderable.aspectRatiosets the Yoga layout ratio, whichgetAspectRatio()returns; reading it still returns the display ratio. AnaspectRatiopassed at construction no longer throws. See Three.js WebGPU. (#2101)COLORTERMandWT_SESSIONand writes 256-color SGR, because screen drops 24-bit colors by default. SetOPENTUI_FORCE_TRUECOLOR=1when screen'struecolorsetting is on. See Terminal capabilities. (#1967, #1982)WT_SESSIONenables OSC 8 hyperlinks on every host OS whenTERMis unset, empty, or starts withxtermand no multiplexer is present. So a Windows Terminal client gets clickable links from a Linux or macOS host when a remote session forwardsWT_SESSION. See Terminal capabilities. (#1976)libopentui.aincludes a private libc++ and libc++abi. A static link needs no system libc++ and also works on musl. See C. (#1991)Code,Diff, andTextareaviews no longer wrap their text at width 0 before their first frame, and Code views and Diff rows share their theme and signs instead of copying them. 100 Code views mounted before their first draw take 20 MB instead of 438 MB. See Rust. (#2124, #2123)Fixed
minWidth, children one cell off in a cached box, a column in a baseline-aligned row, stale wraps after small width changes, and nodes added underdisplay: none, which now read 0 × 0. See Layout. (#1947, #1968, #1995, #2009)OAor[TODO], arrives as typed. A bracketed paste arrives whole even when a pause splits its start marker. See Keyboard input. (#2046, #1971)reportText, Kitty key text longer than 8 characters arrives whole, up to about 42 CJK characters. See Keyboard input. (#1972)EmbeddedTerminalRenderablesends Ctrl+J to its program when the host terminal does not use the Kitty protocol. See Embedded terminal. (#2022)InputRenderableatmaxLength, typed or pasted text replaces the selection. A cut atmaxLengthno longer splits a character. See Input. (#1999, #2017)DiffRenderablekeeps a blank context line and numbers the lines after it correctly. See Diff. (#2017)changeevent. A click on the track emits onechangeevent. Both fixes also apply to scrollbars. Contributed by @Kidyoh. See Slider. (#2031)remove()accepts a child from another copy of the Core bundle, asadd()already did. Contributed by @AksharP5 and reported by @letrquan. See Renderables. (#1535)EditBuffer.getText()andTextBuffer.getPlainText()keep a leading U+FEFF. Contributed by @sean0407. See Editing buffers and views. (#1626)treeSitterClienton Diff and Markdown,scrollMarginon editors, the ASCIIFont selection colors, or the line-number gutter props after construction now takes effect, so these props work in Solid JSX. Reported by @filipsobol. See Solid bindings. (#2097)createBuffer()stays removed. Reported by @JosXa, @RaphaelFakhri, and @Osraka. See Syntax highlighting with Tree-sitter. (#1978, #2002, #2073)suspend()keeps the exit-signal handlers until it settles. A SIGTERM or SIGHUP during a suspension restores the terminal. See Lifecycle and cleanup. (#2083)externalOutputMode: "capture-stdout", a combining mark or VS16 at the start of a write joins the previous character. Captured rows use the renderer's width method, so text after a wide cluster stays visible. See Renderer. (#2067, #1929)all-availableclipboard writes OSC 52 after the host write settles, so the terminal keeps the copy on Wayland and X11. Contributed by @clemenswasser. See Clipboard. (#2028)onErrorinstead ofonEnd. See Video. (#2074)onTimeUpdateafteronReady, and reports a failed state read throughonErroronce. See Video. (#2127)setCursorByOffset()with an offset past the end of the text moves the cursor to the end instead of the start. Contributed by @latent-9. See Editing buffers and views. (#2131)node_modulesagain, so runtime plugins from npm or git get reactive props. See Load plugins and modules at runtime. (#2051)react/jsx-runtime, so the error boundary shows its fallback underNODE_ENV=productioninstead of a blank screen. Reported by @nwidynski. See React bindings. (#2092)fruns the shortcut even after an input stall. Reported by @cevr. See Built-in keymap addons. (#2099)timed-outat its deadline. The text can still land later. See Clipboard. (#2038)+q4d73. A remote session detects screen fromTERM, so OSC 52 copies are wrapped and emoji widths match. See Terminal capabilities. (#1945, #1961)quit()calls that a frame starts run on time in an otherwise idle app. Before, they waited for the next unrelated wakeup, so a headless app could fail to end. See Rust. (#2118)Security
triggerNotification()returnsfalsein ConEmu. See Notifications. (#1998)API changes and documentation: https://opentui.com/docs/releases/0.9.0
What's Changed
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.