Skip to content

Latest commit

 

History

History
485 lines (259 loc) · 15.4 KB

CHANGELOG.md

File metadata and controls

485 lines (259 loc) · 15.4 KB

@fuzdev/fuz_code

0.53.0

Minor Changes

  • perf: render_syntax_html appends flat strings and fewer of them, so stylize plus the first read of its result takes about a third less time: open tags are single strings instead of concatenation trees, a one-char leaf appends its whole span from the new TokenTypeInfo.char_spans cache, and text is sliced without a scan up to the next character that needs an escape; breaking: TokenTypeInfo has the new required char_spans field (6f060d6)
  • perf: the TypeScript, Rust and bash lexers classify a word from one integer instead of string-keyed Map and Set lookups, so lexing takes about 8% less time for TypeScript, 12% less for bash and 5% less for Rust; breaking: WordIndex takes [word, value] entries (a words_map result as it is) in place of words, and find returns the word's value, or 0 for a miss, in place of the word or undefined (902cc6f)
  • perf: a Svelte {expression} is lexed in one pass, about 3% less lex time on Svelte files and 9–18% on an expression: the TypeScript lexer finds the closing brace as it tokenizes through the new optional SyntaxLang.lex_to_brace and Lexer.embed_to_brace (with EMBED_UNAVAILABLE), in place of a scan for the brace followed by the lex; a brace inside a regex no longer closes the expression ({x.replace(/}/g, '')}, {#if /}/.test(s)}); {#each} and {#await} split at the as/then the TypeScript lexer reaches, through an optional stop_word on both, so {#await api.load().then(parse)} is no longer split at the .then call (c10f87d)
  • feat: TypeScript type annotations are recognized without an initializer ((x: T), let x: T;, ): T {, class and interface members), along with a type alias's body and the tail of an as assertion, so names in type positions are type_name and each annotation has its type_annotation and type containers; fix: a case clause, a destructuring rename with a default, and a template literal containing = are no longer read as annotations. TypeScript lexing takes about 9% longer and JavaScript 5% (b9882af)

Patch Changes

  • fix: in TypeScript a single uppercase letter (T, K, V) is a capitalized_identifier instead of a constant, so a type parameter is styled as a type at its uses (c366894)

0.52.1

Patch Changes

  • fix: the shell lexer treats a backslash outside quotes as an escape, so \``, ', and "` no longer open a substitution or string that runs on through later lines; perf: the markdown inline scan and the CSS statement scan skip plain chars through a lookup table (4d72632)
  • perf: WordIndex keeps a 256-slot table with exact-size buckets, cutting each lexer's retained memory by about 15KB (9c9a3a5)

0.52.0

Minor Changes

  • perf: lexers allocate almost nothing per call: keywords are looked up with the new WordIndex instead of slicing every identifier, the TS and Rust number scanners make no closures, and the TS and shell lexers reuse their machines across embedded regions (dcf3bd9)
  • perf: lex into one reused buffer instead of allocating an input-sized Int32Array per call; breaking: a lex_syntax / SyntaxStyler#lex result is valid until the next lex (keep one with the new copy_lexed_syntax), and new Lexer(events?) takes the buffer to emit into, not a capacity (a99d615)

0.51.0

Minor Changes

  • perf: keep the lexers' optimized code across major GCs: advance_probe returns the new PROBE_NOT_FOUND instead of Infinity when there is no further occurrence, and Lexer.shape_anchor keeps one lexer alive so its hidden class survives between lex calls (aa1977a)

0.50.0

Minor Changes

  • feat: require fuz_css 0.65 and read its OKLCH palette (db18591)

    Breaking:

    • The optional @fuzdev/fuz_css peer is >=0.65.0 (was >=0.62.0).
    • theme.css and theme_highlight.css read --palette_a_50 through --palette_j_50 (was --color_a_50 through --color_j_50), fuz_css's renamed palette variables. A consumer that sets the token colors itself sets the --palette_X_50 names.
    • theme_variables.css, the fallback for consumers not using fuz_css, declares --text_50 and --palette_a_50 through --palette_j_50 as sRGB snapshots of fuz_css's derived OKLCH palette, so the default token colors shift.

0.49.1

Patch Changes

  • fix: give CodeTextarea's wrapper fuz_css's flow margin so it drops in for a <textarea> (503cf1f)

0.49.0

Minor Changes

  • replace the create_range_highlighting getter factory with a RangeHighlighting class (the interface of that name is replaced by the class; construct during component init) (#47) (refactor)
  • fix: theme_variables.css declares the --text_50 and --color_*_50 variables that the themes read, replacing the stale --text_color_5 and --color_*_5 names (3c7017e)

0.48.0

Minor Changes

  • feat: add rust lexer (#42)
  • make sh the primary shell lang, with bash and shell as aliases (#41) (refactor)

Patch Changes

  • feat: support svelte syntax for attr comments and {let/const (#40) (80008d4)

0.47.0

Minor Changes

  • perf: rewrite to lexer architecture dropping regexp grammars (#39)
    • the regex-grammar engine is removed: tokenize_syntax.ts, the grammar_*.ts modules, SyntaxToken, tokenize(), and the hooks system
    • SyntaxStyler is now a lexer registry plus lex/stylize facade; lex() returns the flat event stream (LexedSyntax); languages are SyntaxLang lexers registered with add_lang
    • Code.svelte no longer has a grammar prop

0.46.3

Patch Changes

  • fix: simplify CodeTextarea styles to use fuz_css base (e45bccf)

0.46.2

Patch Changes

  • fix: clean up CodeTextarea styles (3d2130e)

0.46.1

Patch Changes

  • feat: add CodeTextarea (#34)

0.46.0

Minor Changes

  • fix: reclassify preprocessor deps (b0d5932)

    • magic-string and zimmerframe from optional peers to dependencies
    • @fuzdev/fuz_util from an optional to a required
  • upgrade peer deps (b89eabd)

0.45.1

Patch Changes

  • add bash lang (#33)

0.45.0

Minor Changes

  • upgrade gro after fuzdev transfer (40103c3)

0.44.1

Patch Changes

  • improve svelte_preprocess_fuz_code to handle more cases (676e71c)

0.44.0

Minor Changes

  • extract static bindings for the preprocessor (#32)

0.43.0

Minor Changes

  • update peer deps (#31)

0.42.0

Minor Changes

  • rename svelte_preprocess_fuz_code from svelte_preprocess_code_static (b35029d)

0.41.1

Patch Changes

  • add dangerous_raw_html to Code (#30)
  • add svelte_preprocess_code_static (#30)

0.41.0

Minor Changes

  • upgrade fuz_css (#29)

0.40.0

Minor Changes

  • update fuz_css (#28)

0.39.0

Minor Changes

  • add bottom margin to Code with nomargin prop to opt out (908896a)

0.38.0

Minor Changes

0.37.0

Minor Changes

0.36.0

Minor Changes

  • rename PascalCase from Upper_Snake_Case (lol) (#25)

0.35.0

Minor Changes

  • unpublish samples (#24)

0.34.0

Minor Changes

0.33.0

Minor Changes

0.32.0

Minor Changes

0.31.0

Minor Changes

  • upgrade moss dep (#23)
  • remove the wrapper element to Code (#23)

0.30.1

Patch Changes

  • support functions with braces in attachments (#21)

0.30.0

Minor Changes

0.29.0

Minor Changes

  • rename SyntaxGrammarRaw from SyntaxGrammar and SyntaxGrammar from NormalizedSyntaxGrammar (#20)

0.28.0

Minor Changes

  • update peer deps (8fae69f)
  • demote highlight API to experimental (#19)

0.27.1

Patch Changes

0.27.0

Minor Changes

  • add markdown support (#16)

0.26.0

Minor Changes

  • rename Grammar to SyntaxGrammar (#13)
  • improve token styles (#14)
  • factor out tokenize_syntax into its own module (#13)

0.25.0

Minor Changes

  • add range highlighting (#12)

0.24.0

Minor Changes

Patch Changes

  • fix: stop clobbering pre_attrs.class on Code (5829701)

0.23.0

Minor Changes

0.22.0

Minor Changes

0.21.0

Minor Changes

  • add syntax_styler and remove Prism (#9)

0.20.0

Minor Changes

  • upgrade peer dep to Svelte 5 (5aa3efb)

0.19.0

Minor Changes

  • bump required node version to 20.17 (b74b797)

0.18.0

Minor Changes

0.17.0

Minor Changes

0.16.0

Minor Changes

0.15.2

Patch Changes

  • enable tsconfig declaration and declarationMap (b6abdd2)
  • add sideEffects to package.json (88a50cc)
  • publish src files (3699312)
  • add tsconfig sourceRoot (6ede67a)

0.15.1

Patch Changes

  • upgrade gro with correctly formatted exports (dcc78db)

0.15.0

Minor Changes

0.14.1

Patch Changes

  • fix inline prop behavior (67bb1f7)

0.14.0

Minor Changes

0.13.0

Minor Changes

  • upgrade svelte@5 (#4)

0.12.0

Minor Changes

  • fix: remove peer dep on @ryanatkn/fuz because of circularity (11c70e9)

0.11.0

Minor Changes

0.10.0

Minor Changes

0.9.0

Minor Changes

0.8.0

Minor Changes

0.7.0

Minor Changes

0.6.0

Minor Changes

0.5.0

Minor Changes

  • unpublish $lib/package.ts (9ae282d)

0.4.3

Patch Changes

0.4.2

Patch Changes

  • add "public": true, to package.json (1ff962f)

0.4.1

Patch Changes

  • upgrade gro to fix package.ts (6a6c372)

0.4.0

Minor Changes

0.3.2

Patch Changes

  • upgrade gro to fix default svelte exports (b06d22d)

0.3.1

Patch Changes

  • publish $lib/package.ts (#2)

0.3.0

Minor Changes

  • bump minor version for fuz upgrade (3b44dc1)

0.2.1

Patch Changes

0.2.0

Minor Changes

  • bump node engine to 20.7 (551dea9)

0.1.0

Minor Changes