-
-
Notifications
You must be signed in to change notification settings - Fork 9
feat: replace wasm with node bindings #61
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: master
Are you sure you want to change the base?
Conversation
|
Hello! Awesome work here :) My primary motivation for opening that discussion was because of the tree-sitter documentation which states:
Unfortunately, upon further investigation, I did not find this to be case. Directly comparing these two dependencies locally, I found that the node bindings were significantly slower than the wasm bindings
IMO, I think the performance difference is a little too large currently, and I'm not sure if it's worth the tradeoff as the web-tree-sitter and node-tree-sitter packages appear to be pretty noticeably inconsistent in what features they support. Indexing the If we do plan on adopting the node bindings, I think it would be worth further documenting what differences there are between the two packages, and how to handle them in the future. The eventually 1.0.9 uses a lot of the For now I'll leave this open, and continue looking into using the node bindings over wasm. Feel free to continue the discussion here, or on the old discussion. It's really unfortunate that the node bindings are so slow, as having features like typedocs and easier testing would be really nice to have. On some of the other fixes you mentioned:
Please feel free to open a PR for this, I'd be happy to help you get it merged. I've been meaning to finalize Thanks again for such a thorough PR! Hoping we can merge it eventually. |
- issue visible in [pr #61](https://github.com/ndonfris/fish-lsp/pull/61/files) Co-authored-by: branchvincent <[email protected]>
* feat: added install script and updated docs * docs: fixups to README * docs: added edit_command_buffer to README.md * fix: `fish-lsp info` logsfile location & readme wording * fix: `package.json` removed linking, reworded setup section `README.md` * fix: `package.json` pkg config * fix: audit `yarn.lock` removed deprecated `cross-spawn` * fix: removed unused fish-lsp enviornment variables w/ README changes - removed `fish_lsp_format_tabsize` & `fish_lsp_format_switch_case` - fixed `src/cli.ts` formatting for `fish-lsp info` - added `fish-lsp complete` completions for `-v/--version`, `-h/--help`, `--help-*`, when 0 subcommands and/or flags are given * docs: fixed `README.md` section order * fix: `yarn pack` and `package.json` scripts appear to be working - `yarn pack` creates a tarball of the package - `package.json` scripts are updated to properly build the tarball - added `files` field to `package.json` to include the directories necessary for the package to work *(main features working, but more testing is needed)*. See [package.json](./package.json) line 25 for more details. --- **What is this commit fixing?** when a user tries to install the fish-lsp npm package, through their package manager using something like: ```bash npm install -g fish-lsp pnpm install -g fish-lsp yarn global add fish-lsp ``` The package manager previously needs to use typescript to build the `src/**` directory, which is not necessary. This branch is testing various methods of improving the package manager installation experience. --- **TODO/Notes** - if we can get the wasm file to be included in the published package, then we can remove most of the `postinstall` related workarounds in the `package.json` scripts, which would be nice. - previous attempts at publishing the `tree-sitter-fish.wasm` file have been made. Most noteably, in versions `v1.0.0`, `v1.0.1`, etc... the `wasm` file included did not properly bundle a wasm file with a correct [magic-number](https://www.google.com/search?client=firefox-b-1-d&q=wasm+magic+number) - once the `postinstall`/`wasm` issues are resolved, building from source will no longer be necessary to install the package. * fix: conf.d not included in background analysis - removed yarn.lock - added files to package.json - removed .yarnrc.yml - successfully built on npm, yarn, & pnpm by `pack` testings - fixed minor misnumbered error code `src/diagnostics/errorCodes.ts` - removed packageManager key from package.json because of corepack * fix: rm *.wasm from .gitignore, added wasm to repo - added yarn.lock back to .gitignore * fix: added startup time w/ logger + popup support to `src/analyzer.ts` - changes made to `package.json` scripts - `dev` script for local development - `dev:watch` script for local development - `tsconfig.json` now contains a key for building `.tsbuildinfo` file and `clean` package.json removes it - `README.md` comments removed + fixes to other minor typo changes * fix: deps in package.json `typescript version too hight for eslint` - moved marked-man to `devDependencies` - typescript now using 5.5.4 in `devDependencies` * fix: ci.yml and added .npmignore * fix: added tests to ci.yml and yarn.lock * fix: fast-glob moved to dependencies * docs: minor comment to README.md * feat: fixed `src/execute-handler.ts` for testing - issue visible in [pr #61](https://github.com/ndonfris/fish-lsp/pull/61/files) Co-authored-by: branchvincent <[email protected]> * docs: fix `README.md` Client Configurations (REQUIRED) * chore: added @branchvincent to `.all-contributorsrc` Signed-off-by: nick donfris <[email protected]> * fix: `npm publish` should now work, `docs/MAN_FILE.md` updates, complete changes - `fish-lsp complete` now outputs completions for `fish-lsp env --no-global --no-local --no-comments --no-export` - `fish-lsp info --time-startup` is now a valid operation - man page was updated - updated .npmignore & .gitignore - updated README.md - added functions to `src/cli.ts` for `--time-startup` operation - added arguments to functions in `src/config.ts` for `fish-lsp env` behavior - pkg behaviour is still not working correctly * fix: removed tests from `.github/workflows/ci.yaml` because of race condition * docs: updated `docs/CHANGLOG.md`, `docs/CONTRIBUTING.md` and `README.md` * docs: updated `docs/CHANGELOG.md` & `package.json` for v1.0.8-3 --------- Signed-off-by: nick donfris <[email protected]> Co-authored-by: branchvincent <[email protected]>
7ba165f to
805784b
Compare


Hey, cool project!
This swaps the wasm bindings for native node bindings, fixing #17. Some things to note:
tree-sitter-fishcurrently has broken node bindings, so we need the fix at fix node bindings ram02z/tree-sitter-fish#24equals,delete,fieldCount,nodeTypeCount) so I had to remove a few test cases fromparser.test.tstsc(this was superseded bytypescript),chai,tree-sitter-clipreinstallscript to allow installing withnpm, which partially fixes Why is yarn required for the build? #48 and NPM Install Fail #57 (scripts/relink-locally.fishstill requires yarn but I have some suggested packaging changes that I'll make in a separate PR to fully fix)