Repository navigation
feat: pin scripts to aged exact versions and match the official runtime calls - #15
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.
Ports two things from the official artifacts that the plugin was missing.
Script version rule. Claude is now told to pin every script URL to an exact version at least two weeks old:
react@18.3.1on jsDelivr or unpkg,react/18.3.1/…on cdnjs,cdn.tailwindcss.com/3.4.17. It never uses a bare name, a range or a tag (react,react@18,@latest). Any version Claude knew before the conversation counts as old enough. The rule is in the tool description (server/prompts.ts) and in thespatial-designskill's "Load a library" paragraph.Runtime calls that broke for pages written to the official contract (
web/runtime.js, with thespatial-capabilitiestypes updated to match):collection(x).doc()with no id now creates a random 20-character id, so a retried create makes at most one document. Before, it wrote tox/undefined.assets.upload(blob, { type })now usestypeas the content type, and the result includessizeBytes. Before, the options object was ignored, so a blob with no type was refused. Pages that callupload(file, 'name.txt')keep working.user.isOwner(),canEdit()andcan()now return Promises, as they do officially. A page that checksif (user.isOwner())still sees a true result.Smoke test
chart.js/4.4.1/…, never a bare name or@latest.dbcapability that adds items withdb.collection('items').doc().set(...). Add two items: each gets its own random id and both persist after a reload.assetscapability that uploadsnew Blob(['a,b'])with{ type: 'text/csv' }. The upload succeeds with content typetext/csvand asizeBytesof 3.usercapability, callawait user.isOwner(). It resolvestrue.https://claude.ai/code/session_012Q19Vb4PXCSzxLEiwnmRfn