Repository navigation
feat(check): typed emits, citry.Secret, development-only page checks, CSS class rules (#207) - #242
Merged
Merged
Conversation
CLAUDE.md and the agent index named only template_parser, safe_eval and html_transform (plus i18n in the index); lib.rs also registers vue and template_formatter. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… arguments (#207) Section 5.1 already says written arguments replace the form's fields; the component-tag section still described a merge that the browser runtime does not do (both paths go through declarativeEventArgs in _vue/client.js). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e emit payload (#207) A listener written as a bare method name, such as @hide="hideCard", is now passed to a generated function typed from the child's emits, so tsc compares the method's parameters with the payload (m60). The props and events guide documents typed emits, which also report a wrong payload at the child's $emit call (m30). Co-Authored-By: Claude Opus 5.5 <[email protected]>
… render errors (#207) 12a: the missing and duplicate #c-key messages now give the template and line for inline templates, template files, slot fills and template-valued attributes, include the repeated value, and explain nested loops; the element-key conflict shares one message with the parser's wording. 12b: when the Vue compiler reports MODEL_HELPER_MISMATCH, the render searches the authored templates the Vue template came from with the invalid-model-target rule and names each element, its template and line. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A Secret[T] wraps a server-only value such as an API token. Its text form is ***, so a template never shows it; js_data(), css_data() and State refuse it with an error naming the component and key path; and the citry.js-data.unsupported-type rule reports it statically (annotations, module constants, also nested in literals, and values ty types as Secret). The component options and security guides explain how to keep tokens off the page (m42). Co-Authored-By: Claude Opus 5.5 <[email protected]>
… and variable rules (#207) citry.css.misspelled-class (rule_misspelled_css_class, a warning) reports a static class one slip from a class selector in the component's own CSS that no CSS Citry reads declares (m16). citry.css.undeclared-class and citry.css.undeclared-variable are off by default ("ignore", which the diagnostics schema now allows with a configurable severity) and report every class no CSS Citry reads declares and every var(--x) without a fallback that nothing sets. All three run in citry check with the app loaded. _css_scan.py is the one reader of selectors and custom property declarations. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-checked (#207) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…velopment mode (#207) 12c: with Citry(mode="development"), a hydrating page inlines _vue/dev_checks.js, and the runtime compares each shell's served HTML with Vue's first render and logs a console warning naming the component, the element, the first difference, and the data-allow-mismatch value that silences it (m14). Production pages carry no flag and no script. 12d: in development mode, serialization collects each component's own ids and issues one RuntimeWarning per page listing every id two components (or two renders of one) wrote, with the components and template files (m57). Co-Authored-By: Claude Opus 5.5 <[email protected]>
… m50 (#207) The decisions table records what was built for items 8, 11, 12a-12d, 13, the two off-by-default CSS rules, and 14. Section 15 proposes a check for an inject() key no ancestor provides (m50) for the maintainer to decide. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CSS rules: the misspelled-class rule no longer reports a missing final d/r/n of a word family or a slip in a short first hyphen part (p-4/px-4), reads other components' stylesheets only when a class is one slip from the component's own CSS, and the variable messages say the property gets its initial or inherited value. Secret: constant-time equality for text and bytes; css_data() refuses a Secret even without CSS; a Secret in a cache key gets its own error and is never hashed into the key; citry check also follows attributes, *, both branches of a conditional and Const(); the js-data warning has a Secret message in citry check and the editor; the State error names the class. Development checks: same-tag v-if/v-else branches are paired by their whole subtree within a budget, so a correct page no longer warns; the script is read once; warnings from the repeated-id, CSP and JavaScript policy checks point at the caller's code (_caller_warnings.py). Render errors: an element-key clash names its template, line and column; the v-model search reads template-valued attributes. Prose fixes across the docs, docstrings, messages, changelogs and design docs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Development checks: an agreeing pair outranks any number of differing pairs, a branch rejected only by the quick text check gets a full comparison while budget remains, and the budget now charges the text search (raised to 200,000 steps). Caller warnings work through a symlinked import path and document the Events response case. CSS rule: the final d/r/n exclusion covers only listed UI words (collapse, disable, show, toggle, ...), the short-first-part exclusion covers only a doubled or dropped letter, and a word already ending in s is not excused, so heade, iu-button and progres are reported again. Secret: the static walk reads attributes without running user code, judges only built-in values, survives deep nesting and skips a value a property shadows; equality treats str and bytes subclasses as text; css_data() refuses a nested Secret with or without CSS; the js-data message says a field can hold a Secret. Prose fixes in the docs, changelogs and design docs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The CSS checks, citry.Secret, and the development-mode browser check (_vue/dev_checks.js) grow the wheel to 1,360,663 bytes, 9 KB over the cap the earlier #207 batch set. The cap moves to 1,344 KiB, about 15 KB of headroom. Co-Authored-By: Claude Opus 5.5 <[email protected]>
On Python 3.10, types.SimpleNamespace lists its own C __getattribute__ in its class namespace, so the js_data() Secret check took it for a hook that might run code and left SETTINGS.auth.token unchecked. It runs no user code, so it joins object, type and ModuleType. Co-Authored-By: Claude Opus 5.5 <[email protected]>
pytest puts a test's id in the PYTEST_CURRENT_TEST environment variable, and the deeply nested @media case made it longer than the 32,767 characters Windows allows. Co-Authored-By: Claude Opus 5.5 <[email protected]>
JuroOravec
changed the base branch from
main
to
benchmarks/errors-citry-unreleased
October 22, 2026 07:20
# Conflicts: # benchmarks/errors/frameworks/citry/framework.toml # docs/design/vue.md
This was referenced Oct 22, 2026
Give hot reload and development mode their own guides: /guides/hot-reload/ covers file reloading only, and /guides/development-mode/ covers Citry(mode="development") and what it turns on. /guides/dev-server/ now redirects to the hot reload page, and every link points at the new pages. On the pages this branch touched, move typing, linting, and error detail out of the main flow into one section near the end of each page: "Keep tokens off the page" now sits before "Check JS code" on Component options, and Props and events gains "Catch mistakes early". The full list of rules for method listeners moves to the VS Code page, and the CSS class rule details move to the template linting page's less common cases. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
JuroOravec
added a commit
that referenced
this pull request
Oct 22, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
JuroOravec
added a commit
that referenced
this pull request
Oct 22, 2026
Main brought two checks whose findings carry ranges: the CSS class rules (#242) and the unknown inject key rule (#243). Both already counted from 0 in UTF-16 units through `_byte_offset_coordinates`, but neither said which text it counts in, so the report rejected them. The CSS class findings are now built with `_ranged_finding` from their template source, and the inject key findings are marked as counting in the component's Python file. Their tests now also check `source_kind`; no expected position changed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Part of #207. It implements the maintainer's decisions on items 8 and 11 to 14 in
docs/design/issue_207_proposals.md, plus two new opt-in CSS rules.What changes
emits.@hide="hideCard", is compared with the child's emit payload.citry.Secret[T](m42): a new public marker type.get_secret_value(). It shows as***as text, and comparing two secrets takes constant time.js_data(),css_data()and State, with an error naming the component and the key.Secretinput, and a secret is never part of the cache key.citry.js-data.unsupported-typereports it before the app runs.#c-keynow name the right template and line, including template files and slot fills.v-model, the render error now names the element, the template and the line.rule_misspelled_css_class: a warning, incitry checkwith the app loaded. It reports a static class one typo away from a class in the component's own CSS that no registered component's CSS declares.rule_undeclared_css_class: reports every class no CSS Citry reads declares. Citry reads componentcssandcss_file, localDependenciesstylesheets and template<style>elements.rule_undeclared_css_variable: reports everyvar(--x)with no fallback that nothing declares or sets. That includescss_data()keys and--xstrings in templates, JavaScript and Python.docs/agent/INDEX.mdnow list all six Python binding submodules. 14a and 14b were already onmain.inject()keys that no ancestor provides (m50), for the maintainer to decide.Wheel size
The wheel is 1,360,663 bytes, so the cap moves from 1,320 to 1,344 KiB (commit
427e9a9a0). Revert that commit if you'd rather shrink the wheel, for example by minifyingdev_checks.js.Evidence
--platform linux.citry.Secret, the runtime and editor changes, and a separate prose pass), then a re-review of the fixes.Known limits
citry checkwith the app loaded, not in the editor.#c-keyclash message still has the old wording; Rust couldn't be built here.🤖 Generated with Claude Code