Skip to content

v0.2.3

Choose a tag to compare

@shivamsn97 shivamsn97 released this 15 Apr 18:11
· 42 commits to main since this release
b72f1bc

v0.2.3 β€” Release Notes

πŸ› Bug Fix

SSR props no longer break JSON.parse on pages containing <!-- or -->

The inline-JSON escaper (pyxle.ssr._escape.escape_inline_json) previously rewrote HTML-comment sequences with backslash escapes that are not valid JSON:

  • <!-- β†’ <\!-- ← \! is not a legal JSON escape
  • --> β†’ --\> ← \> is not a legal JSON escape

Any page whose props contained a literal --> (very common in docs that quote shell output, code examples, or arrow markers) would fail at hydration with:

[Pyxle] Failed to parse initial props
SyntaxError: Bad escaped character in JSON

The fix swaps the problematic replacements for Unicode escapes β€” which are valid JSON β€” and still neutralise the HTML-tokenizer sequences:

  • <!-- β†’ \u003c!--
  • --> β†’ --\u003e

πŸ§ͺ Tests

  • Added a parametrised test_output_is_valid_json_after_escape that round-trips escaped output through json.loads to catch this class of regression.
  • 1127 total tests, all passing.

πŸ“¦ Install

pip install --upgrade pyxle-framework==0.2.3

πŸ™ Migration

None. This is a pure bug fix β€” existing apps just need to redeploy with 0.2.3 to get correct behaviour.