-
Notifications
You must be signed in to change notification settings - Fork 103
[Web] Support structural tag in web-xgrammar package, upgrade version to 0.1.27 #482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
akaashrp
commented
Nov 27, 2025
- Support structural tag in web-xgrammar package
- Upgrade version to 0.1.27
- Upgrade devDependencies and migrate to new eslint config format
- Fix testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds structural tag support to the web-xgrammar package and upgrades to version 0.1.27. It includes significant infrastructure updates including migration to ESLint 9 flat config format, Jest ESM support, and TypeScript configuration improvements.
Key Changes:
- Added comprehensive structural tag API with both modern and legacy interfaces
- Upgraded development dependencies (ESLint 9.x, Jest 30.x, TypeScript 5.9.x, Rollup 4.x)
- Migrated to ESLint flat config format and improved Jest ESM configuration
- Updated C++ bindings to support structural tag validation and compilation
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| web/package.json | Version bump to 0.1.27 and major devDependency upgrades |
| web/tsconfig.json | Added ES2022 target and module configuration for better ESM support |
| web/src/structural_tag.ts | New module providing structural tag type definitions and conversion utilities |
| web/src/xgrammar.ts | Extended Grammar and GrammarCompiler APIs with structural tag support |
| web/src/xgrammar_binding.cc | Added C++ wrapper functions for structural tag validation and compilation |
| web/src/index.ts | Exported new structural tag types and StructuralTagItem class |
| web/tests/grammar.test.ts | Updated tests for new API signatures and added structural tag test coverage |
| web/tests/web_tokenizers_shim.mjs | New shim module for CommonJS tokenizer compatibility in Jest ESM |
| web/jest.config.cjs | Enhanced ESM support with proper module name mapping |
| web/eslint.config.cjs | New flat config format replacing legacy .eslintrc.cjs |
| web/.eslintrc.cjs | Removed legacy ESLint configuration file |
| web/.eslintignore | Removed in favor of ignores in flat config |
| web/run_test.sh | Rewritten to use proper ESM test execution without package.json patching |
| web/build.sh | Updated CMake flag from BUILD_PYTHON_BINDINGS to XGRAMMAR_BUILD_PYTHON_BINDINGS |
| web/example/src/example.ts | Added structural tag example demonstrating new API usage |
| web/example/package.json | Version sync to 0.1.27 with dependency updates |
| cmake/config.cmake | Made XGRAMMAR_BUILD_PYTHON_BINDINGS conditionally defined |
| CMakeLists.txt | Added deprecation handling for old BUILD_PYTHON_BINDINGS flag |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.