Skip to content
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

Don't minify tree-sitter.js #3379

Open
verhovsky opened this issue May 22, 2024 · 1 comment · May be fixed by #3380
Open

Don't minify tree-sitter.js #3379

verhovsky opened this issue May 22, 2024 · 1 comment · May be fixed by #3380
Labels
enhancement Feature request

Comments

@verhovsky
Copy link
Contributor

Problem

Currently web-tree-sitter on npm has just these 6 files

  • LICENSE
  • README.md
  • package.json
  • tree-sitter-web.d.ts
  • tree-sitter.js
  • tree-sitter.wasm

where tree-sitter.js is a minified, single-line javascript file. This makes debugging/understanding it difficult.

Expected behavior

tree-sitter.js shouldn't be minified. Users can minify it themselves if they need to, along with the rest of their JavaScript.

Additionally, it would be great to generate source maps for tree-sitter.wasm so that developers could see the original C code it's running https://emscripten.org/docs/porting/Debugging.html , as long as this can be done without affecting performance.

@verhovsky verhovsky added the enhancement Feature request label May 22, 2024
@verhovsky verhovsky linked a pull request May 22, 2024 that will close this issue
@verhovsky
Copy link
Contributor Author

verhovsky commented May 22, 2024

Generating source maps without affecting performance is not possible, see emscripten-core/emscripten#20462 so this will have to only apply to --debug and not the release build.

@verhovsky verhovsky changed the title Don't minify tree-sitter.js for web-tree-sitter Don't minify tree-sitter.js May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
@verhovsky and others