-
Notifications
You must be signed in to change notification settings - Fork 10
feat: tsgo playground #298
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
Conversation
✅ Deploy Preview for rslint canceled.
|
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 browser-based WASM support for running Rslint in web environments, specifically targeting TypeScript AST debugging capabilities. The implementation creates a browser playground that compiles the Go-based linter to WebAssembly and provides a JavaScript interface for in-browser execution.
- Adds a new
@rslint/browser
package with WASM compilation and JavaScript bundling - Implements browser-specific execution mode with file system virtualization
- Updates build constraints to properly handle WASM target compilation
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
packages/vscode-extension/package.json | Changes default binary source from "local" to "built-in" |
packages/rslint-browser/package.json | Defines new browser package with WASM build scripts and dependencies |
packages/rslint-browser/src/index.mjs | Main browser entry point using WASI and virtual file system |
packages/rslint-browser/index.html | Simple HTML page to load the bundled JavaScript |
packages/rslint-browser/.gitignore | Excludes generated WASM binary from version control |
cmd/rslint/signal_wasm.go | WASM-specific signal handling implementation |
cmd/rslint/signal_unix.go | Updates build constraints to be more specific about Unix platforms |
cmd/rslint/main.go | Adds browser mode argument handling and logging |
cmd/rslint/browser.go | Browser-specific execution logic for TypeScript program creation |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
return 1 | ||
} else { | ||
for _, file := range program.GetSourceFiles() { | ||
if(file.FileName() == "/input.ts") { |
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.
Remove unnecessary parentheses around the if condition. Go style prefers if file.FileName() == "/input.ts"
without parentheses.
if(file.FileName() == "/input.ts") { | |
if file.FileName() == "/input.ts" { |
Copilot uses AI. Check for mistakes.
|
||
rootDir := "/" | ||
tsconfigPath := "/tsconfig.json" | ||
fs := bundled.WrapFS(osvfs.FS()); |
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.
Remove unnecessary semicolon at the end of the line. Go statements don't require semicolons.
fs := bundled.WrapFS(osvfs.FS()); | |
fs := bundled.WrapFS(osvfs.FS()) |
Copilot uses AI. Check for mistakes.
} else { | ||
for _, file := range program.GetSourceFiles() { | ||
if(file.FileName() == "/input.ts") { | ||
log.Printf("file: %v\n,%v", file.Text(),file.Node) |
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.
Fix the format string syntax. There's an extra comma in the newline sequence. It should be \"file: %v\\n%v\"
instead of \"file: %v\\n,%v\"
.
log.Printf("file: %v\n,%v", file.Text(),file.Node) | |
log.Printf("file: %v\n%v", file.Text(),file.Node) |
Copilot uses AI. Check for mistakes.
this is used to simplify debug tsgo ast