Skip to content

Conversation

@akaashrp
Copy link

  1. Support structural tag in web-xgrammar package
  2. Upgrade version to 0.1.27
  3. Upgrade devDependencies and migrate to new eslint config format
  4. Fix testing

Copilot AI review requested due to automatic review settings November 27, 2025 09:01
Copilot finished reviewing on behalf of akaashrp November 27, 2025 09:05
Copy link

Copilot AI left a 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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant