Skip to content

feat: add highlight.js compatibility harness - #319

Merged
pmatos merged 2 commits into
mainfrom
sym/jsse/297-node-compat-library-highlight-js
Jul 20, 2026
Merged

feat: add highlight.js compatibility harness#319
pmatos merged 2 commits into
mainfrom
sym/jsse/297-node-compat-library-highlight-js

Conversation

@pmatos

@pmatos pmatos commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • pin highlight.js 11.11.2 and generate a filesystem-free bundle with all 192 built-in grammars
  • verify 536 upstream markup fixtures plus 195 eligible full-set auto-detection fixtures against fixed expectations from the Node oracle
  • keep the integration additive under scripts/, with no engine or default-global changes
  • document the 731-case cross-check, production-mode detection rationale, and roughly 30-minute tree-walker cost

Validation

  • ./scripts/run-library-tests.sh highlight.js --clean --node — 731/731
  • ./scripts/run-library-tests.sh highlight.js --no-cross-check — 731/731
  • cargo fmt --check
  • cargo clippy
  • cargo build --release
  • cargo test --release — 294 Rust tests + smoke oracle
  • ./scripts/lint.sh
  • uv run python scripts/run-custom-tests.py — 7/7
  • uv run python scripts/run-test262.py test262/test/built-ins/RegExp/ — 3,756/3,756
  • ./scripts/run-acorn-tests.sh — 13,507/13,507, cross-checked against Node
  • TZ=UTC uv run python scripts/run-test262.py — 99,568/99,568, zero regressions (UTC matches the current baseline environment recorded by PR fix(intl): localize DateTimeFormat output #281; baseline left unchanged)

Closes #297

@pmatos

pmatos commented Jul 17, 2026

Copy link
Copy Markdown
Owner Author

Decision record for the auto-detection corpus: upstream 11.11.2 currently comments out its dynamic detect assertions, and eight sample-directory names do not win when all 192 grammars compete. Requiring the directory names made Node fail; limiting each input to its own grammar would have avoided the ambiguity but weakened the scoring-state-machine coverage. The harness therefore records the pinned Node winners for those eight inputs and lets every eligible input compete against the complete grammar set. Markup retains upstream debug mode, while detection uses the public production/safe mode because Node itself hits the Nix grammar zero-width debug assertion on valid inputs. G-code, properties, and plain text are excluded through upstream’s own autoDetection() opt-out. This yields the same fixed 731-case oracle on both engines without JSSE-only skips.

…pat-library-highlight-js

# Conflicts:
#	CLAUDE.md
#	scripts/README.md
@pmatos
pmatos merged commit cc51968 into main Jul 20, 2026
8 checks passed
@pmatos
pmatos deleted the sym/jsse/297-node-compat-library-highlight-js branch July 20, 2026 07:05
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Node-compat library: highlight.js

1 participant