Document the two JavaScript APIs for contributors - #56
Open
christophdb wants to merge 1 commit into
Open
Conversation
docs/javascript/ describes the scripting API and the external seatable-api client on shared pages. The two are not identical, but nothing in this repository said so, so an editor had no way to know which methods need a context marker. That is how methods ended up documented for readers whose context does not have them. - README: what the two contexts are, both kinds of divergence (columns are read-only in scripts; three methods differ only in name), the marker convention, and how to verify a method in either context - scripts/dump-script-api.js: prints the method surface of `base` from a base's script editor -- the scripting API has no published package, so this is the only way to enumerate it Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Why
PR #55 fixes the symptom: methods on the JavaScript pages that are
undefinedin the reader's context. This PR addresses why it happened.docs/javascript/documents two different APIs on shared pages — the scripting API and the externalseatable-apiclient. Nothing in this repository stated that. There was no list of the divergences, no note on the marker convention, and no way to check a method's availability. Anyone editing those pages had to assume parity, because assuming parity was the only documented option.Changes
README, new section "Editing the JavaScript reference" — placed with the other contributor instructions:
getRows/listRows,updateLinks/updateLink,getColumns/listColumnsdtable-sdkon npm is not a stand-in for the scripting API — the script environment wraps it and adds methods, and the SDK has no link methods at allscripts/dump-script-api.js— walks the prototype chain ofbaseand prints every method, plusbase.utilsandbase.context. The scripting API is not published as a package, so this is the only way to enumerate it. Run it in any base's script editor.Notes
Merge after #55 — the section describes the "External client only" marker introduced there.
The divergence list will age. It is deliberately short and covers only the stable, surprising cases; the markers in the pages themselves stay authoritative per method, and the dump script is there for when something looks off.
tests/validate_docs.pyandmkdocs build --strictpass.🤖 Generated with Claude Code