Skip to content

Introduce TypeScript Compiler API for Semantic Type Checking - #13

Merged
sonneko merged 4 commits into
mainfrom
feat/typescript-compiler-api-13696504239165391564
Jul 3, 2026
Merged

Introduce TypeScript Compiler API for Semantic Type Checking#13
sonneko merged 4 commits into
mainfrom
feat/typescript-compiler-api-13696504239165391564

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

Implemented full semantic type checking in the Funky Playground by integrating the TypeScript Compiler API. The playground now fetches necessary lib.d.ts files from a CDN at runtime, performs a full compilation check, and reports both syntax and semantic errors to the user. This enables robust verification of Funky's structural typing and protocol-based polymorphism using TypeScript's language features.

Fixes #12


PR created automatically by Jules for task 13696504239165391564 started by @sonneko

… playground

This change replaces the basic `ts.transpileModule` with a full TypeScript program
compilation in the browser. It includes:
- A new `compiler.ts` that implements a custom `CompilerHost` for browser environments.
- Support for fetching and recursively resolving standard library definitions from CDN.
- Enhanced error reporting that displays semantic type errors directly in the Result tab.
- Structural type checking for Funky protocols leveraged through TypeScript's engine.
- Optimization through caching of library files and parsed SourceFile objects.
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 3 commits July 3, 2026 05:26
…ions

- Implemented full semantic type checking in the browser-based playground.
- Added `website/src/compiler.ts` to handle custom `CompilerHost` and `lib.d.ts` loading.
- Optimized library loading with recursive reference resolution and caching.
- Fixed `unreachable_patterns` warning in `src/ty.rs` by reordering match arms.
- Fixed regression in `src/typeck_tests.rs` where a test expectation didn't match the code.
- Updated `.gitignore` to include `/target` and `/node_modules`.
@sonneko
sonneko merged commit e7f80be into main Jul 3, 2026
1 check passed
@sonneko
sonneko deleted the feat/typescript-compiler-api-13696504239165391564 branch July 3, 2026 12:54
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.

TypeScriptCompilerAPIの導入

1 participant