Wrap naked expressions in playground blocks with console.log()#251
Merged
Wrap naked expressions in playground blocks with console.log()#251
Conversation
…oduce output Agent-Logs-Url: https://github.com/githubnext/tsessebe/sessions/30790671-f2ec-4398-bf84-3d33cc6afc47 Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add console.log() to demonstrate behavior in playground
Wrap naked expressions in playground blocks with console.log()
Apr 30, 2026
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.
Most playground tutorial blocks ended in bare expression statements (e.g.
seriesAdd(a, b).values; // [5, 7, 9]) orconst result = …;with the value documented only in a trailing comment. Since the playground runtime captures output exclusively fromconsole.log/warn/error, clicking ▶ Run displayed(no output — add console.log() to see results)instead of demonstrating behavior. Audit found 425 of 770 blocks affected.Changes
console.log(...), preserving indentation and inline// expectedcomments.console.log(<lastVar>);to blocks whose only meaningful output is bound to a top-levelconst/let/var.import pandas,pd./np.,print(,#end-of-line comments), TS type/signature reference lines (e.g.df.assign(spec: AssignSpec): DataFrame;), method-chain continuation lines (.toHtml();), multi-line statements (tracked via paren/brace/bracket depth), assignments (with HTML-entity decoding so=>is recognized as=>), and placeholder blocks.321 blocks across 70
playground/*.htmlfiles updated. Each block's TypeScript was transpiled before and after to confirm no new syntax errors.Example
import { Series, seriesAdd, seriesMul } from "tsb"; const s = new Series({ data: [1, null, NaN, 4] }); -seriesAdd(s, 10).values; // [11, null, NaN, 14] -seriesMul(s, 2).values; // [2, null, NaN, 8] +console.log(seriesAdd(s, 10).values); // [11, null, NaN, 14] +console.log(seriesMul(s, 2).values); // [2, null, NaN, 8]const df2 = dataFrameAssign(df, { c: [7, 8, 9], d: new Series({ data: [4, 5, 6] }), }); // df2.columns.values → ["a", "b", "c", "d"] +console.log(df2);Not addressed
A handful of blocks remain output-less by design or due to pre-existing bugs unrelated to logging — pure
interface/typedeclarations, comment-only snippets, and broken placeholders likeClick ▶ Run to executeincrosstab.html/datetime_tz.html/factorize.html/get_dummies.html/str_get_dummies.html. Those warrant separate fixes.