HackerTrans
トップ新着トレンドコメント過去質問紹介求人

Building a better online editor for TypeScript(blog.val.town)

61 ポイント·投稿者 fbuilesv·10 か月前·12 コメント
blog.val.town
Building a better online editor for TypeScript

https://blog.val.town/vtlsp

12 コメント

rafram·10 か月前
Why not Monaco? It works great.

https://github.com/microsoft/monaco-editor
jsejcksn·10 か月前
The title doesn't make it clear that it's actually about TypeScript plus Deno-specific syntax — and Deno's LSP doesn't run in a worker [1].

[1]: https://github.com/denoland/vscode_deno/issues/515
gvkhna·10 か月前
yet

They could have also contributed to the effort. You can also add types to monaco typescript. I don’t see a need for a Deno specific LSP, am I missing something?
WorldMaker·10 か月前
The biggest deal difference between the Deno LSP and Typescript sort-of-LSP in my experience is around the import model. Typescript has a bunch of "module resolution" modes based on various combinations of browser, bundler, and/or Node. For various reasons the Deno LSP is the only encoding of the Deno "module resolution' and upstream Typescript doesn't have a "denoX" set of "module resolution" options.

The second biggest deal is that the Deno LSP also includes a full linter, versus for the full experience the Typescript not-quite-LSP is often paired with the ESLint VS Code extension and a large eslint install.

Deno's LSP is also sometimes preferred for being a single Rust binary that runs quicker than Typescript's not-quite-LSP (plus or minus ESLint's non-LSP). It may be interesting to see how Golang Typescript's real-LSP fares in comparison in a future version.
gvkhna·10 か月前
Ah interesting, Yes i see what you’re saying regarding eslint and didn’t consider that. I’m a big of newer linters with better perf but none match the depth currently with eslint. Will keep an eye out on deno lsp!
d357r0y3r·10 か月前
I've built significant applications using Monaco, including things that tie into custom LSPs.

They really just should have used Monaco. This will be a burden to maintain and won't be a core differentiator.
whazor·10 か月前
Codemirror nowadays has first-party LSP support: https://github.com/codemirror/lsp-client
whazor·10 か月前
CodeMirror 6 is more modern with better accessibility and variable width fonts.
rafram·10 か月前
CodeMirror 6 is more modern than the editor that powers VS Code?
thecopy·10 か月前
I worked on adding a web-vscode editor in my project (MCP gateway https://mcp-boss.com). Initially i also spun up a container to provide terminal access, package installation etc. It turned out to be very resource intensive, and the cold-start-up UX sucked. This approach also comes with scaling challenges.

Leaning on CloudFlare Containers seems like a good balance though. But im wondering what the limits are, some packages are very large and require more than just Javascript (e.g node gyp).

(Personally I ended up hosting a web-only VS code served as static files. Luckily i dont need to support Deno syntax so the built-in Typescript language server worked fine.)
gdotdesign·10 か月前
I've done something similar for the Mint, and it's try page: https://mint-lang.com/sandbox/try (and all interactive snippets).

The client (CodeMirror) connects to the language server though WebSocket to offer semantic highlighting and some custom LSP actions related to compiling and serving the project.
conartist6·10 か月前
Shoots themselves nicely in the foot for scaling and profitability to have to centralize all the work for everyone forever