Repository navigation
v0.20.0
Highlights
@tsrx/oxc-core-compat now matches @tsrx/core 0.5.2 on leonidaz's remaining conformance reports. With this release the oxc repository has no open issues.
- Lone surrogates (a UTF-16 surrogate without its pair) are kept as written in
.js,.jsx,.tsand.tsxfiles. This applies to strings, regex patterns, directives, JSX attributes and text, template text and comments. They used to become U+FFFD (#139, #177). - Template text spans the text alone. In
.tsrx,.tsxand.jsxfiles, aTemplateElementno longer includes the backtick or the${/}next to its text, andvalue.rawno longer picks up those delimiters next to a lone surrogate (#140, #177). - Errors have core's shape (#142, #176):
- A thrown
SyntaxErrorends its message with(line:column)and haslocas{ line, column }, plusposandraisedAt, as acorn gives them. - Mistakes core reports itself (TSRX2011, TSRX2012, TSRX1004, TSRX2001, redeclarations and others) throw a plain
ErrorwithfileName,end,type: "fatal"and a spanloc. - Malformed directives get core's codes and positions, including the two that had none:
@ifwith no condition is TS1359, and an@in a@switchbody is TS1012. - An element a template ends before its closing tag is
Unclosed tag '<div>'. Expected '</div>' before end of template.at the template's}.
- A thrown
- After a bare
@, the error is at the token that follows it, even when a later structural error also exists, as in core (#175, #176). - The Markless drop-in suite runs in CI as
pnpm run test:markless-dropin. Its three stale expectations now match core 0.5.2 (#143, #174).
Behaviour change
Thrown errors from parseModule look different:
- Messages gain the
(line:column)suffix. locis{ line, column }instead of{ start, end }.- The native messages
malformed TSRX at byte …andunterminated JSX element …are replaced by core's wording.
Collected errors keep their span shape. Lint, format and the editor read the Rust diagnostics and are unchanged.
🩹 Fixes
- compat: Throw errors in core's shape, with core's codes for malformed directives, as @tsrx/core 0.5.2 does (#142)
- compat: Keep a lone surrogate as written in .js, .jsx, .ts and .tsx files, and span template text alone, as @tsrx/core 0.5.2 does (#139, #140) (#139, #140)
- compat: Read past comments, class heritage, and nested template literals when placing core's errors (#142)
- compat: Throw at the token after a bare @ before any later error, as @tsrx/core 0.5.2 does (#175)
- compat: Tell a class body from a later block, a class string, and a comparison in heritage (#142)
- compat: Read a class head past comments and strings (#142)
✅ Tests
- Align the Markless drop-in suite with @tsrx/core 0.5.2 (22207ef)
🤖 CI
- Run the Markless drop-in suite in the correctness job (9e371b9)
📋 Other changes
Commits changelogen could not classify, oldest first. They are here because a
release note that hides most of the history is not a release note.
- Merge pull request #171 from tsrx-org/release-v0.19.0 (300adec)
- site: pin wasm demo engine 300adec (57644ef)
- Merge pull request #173 from tsrx-org/site/wasm-pin-300adec (0c4876b)
- fix(compat): throw errors in core's shape, with core's codes for malformed directives, as @tsrx/core 0.5.2 does (#142) (8eb40dd)
- fix(compat): keep a lone surrogate as written in .js, .jsx, .ts and .tsx files, and span template text alone, as @tsrx/core 0.5.2 does (#139, #140) (3360be3)
- fix(compat): read past comments, class heritage, and nested template literals when placing core's errors (#142) (a38ead5)
- Merge pull request #177 from tsrx-org/fix/lone-surrogates-and-template-spans (3185084)
- Merge remote-tracking branch 'origin/main' into fix/markless-dropin-suite (91ddafd)
- fix(compat): throw at the token after a bare @ before any later error, as @tsrx/core 0.5.2 does (#175) (92ce791)
- Merge remote-tracking branch 'origin/main' into fix/core-error-shape (f741fde)
- fix(compat): tell a class body from a later block, a class string, and a comparison in heritage (#142) (a655a32)
- Merge pull request #174 from tsrx-org/fix/markless-dropin-suite (eedc645)
- Merge remote-tracking branch 'origin/main' into fix/core-error-shape (f817d5c)
- fix(compat): read a class head past comments and strings (#142) (576debf)
- Merge pull request #176 from tsrx-org/fix/core-error-shape (4ef73fa)
❤️ Contributors
- Jack Shelton me@jackshelton.com