Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.4.0] - 2026-06-01

### Added
- **JSX/TSX support**: `.jsx` and `.tsx` files now run directly through the runtime. `.tsx` is type-stripped first (the existing TS pass) and then JSX is compiled to factory calls; `.jsx` goes straight through the JSX pass. `node app.tsx`, `require('./Component.tsx')`, and `index.tsx`/`index.jsx` directory resolution all work.
- Implemented with `acorn-jsx` (already a dependency) — a small, synchronous, pure-JS codegen pass, no Babel/esbuild and no wasm, keeping the bundle lean.
- The transform is **config-driven**: the nearest `tsconfig.json` or `jsconfig.json` in the VFS is resolved by walking upward from the script being transformed. `jsx` (`react` → classic `React.createElement`; `react-jsx`/`react-jsxdev` → automatic `react/jsx-runtime`), `jsxImportSource`, `jsxFactory`, and `jsxFragmentFactory` are all honored. Defaults to the automatic runtime with `react` when no config is found.
- Handles intrinsic vs. component tags, member-expression components (`<Foo.Bar/>`), fragments, spread attributes/children, boolean attribute shorthand, `key` extraction (automatic runtime), nested JSX inside expressions, JSX whitespace collapsing, and HTML entity decoding.
- **TypeScript import extension rewriting**: imports/requires that reference a sibling by its *output* extension (`import './foo.js'`, `require('./Card.jsx')`) now resolve to the TypeScript source on disk (`.ts`/`.tsx`/`.mts`/`.cts`) when the literal file is absent — matching `tsc`/Node behavior. A real `.js` sibling still wins over the rewritten `.ts`. Works from both `.js` and `.ts`/`.tsx` files.

### Fixed
- **Named exports now preserve their local binding** in the ESM→CJS transform. `export const`/`function`/`class` declarations previously became `exports.X = ...` outright, dropping the local `X` binding so later module-scope references broke (e.g. `export const o = {}; o.key = 'v'` produced invalid `exports.o = {}; o.key = 'v'`). The declaration is now kept and the value is assigned onto `exports` separately. Destructuring exports (`export const { a, b } = obj`, `export const [x] = arr`) export each bound name.

## [0.3.0] - 2026-06-01

### Added
- **Native TypeScript support**: `.ts`, `.mts`, and `.cts` files now run directly through the runtime, mirroring Node.js's native type-stripping (stable since Node 23.6). `node app.ts`, `require('./mod.ts')`, and `index.ts` directory resolution all work out of the box.
- Implemented with `acorn-typescript`, a pure-JS acorn plugin — no `typescript` compiler dependency and no wasm, so stripping is synchronous (required for `require()`) and adds minimal bundle weight.
- Type-only syntax (annotations, interfaces, type aliases, generics, `import type`/`export type`, `as`/`satisfies`, non-null `!`, definite assignment, `declare`, class member modifiers, `implements`) is replaced with whitespace, preserving source positions.
- `.cts` is treated as CommonJS and `.mts`/`.ts` as ESM-capable, consistent with Node.
- Like Node's strip-only mode, constructs requiring code generation (enums, namespaces, parameter-property assignment) are not emitted.

## [0.2.14] - 2026-02-14

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Built by the creators of [Macaly.com](https://macaly.com) — a tool that lets a
- **Run Any CLI Tool** - npm packages with `bin` entries (vitest, eslint, tsc, etc.) work automatically
- **Dev Servers** - Built-in Vite and Next.js development servers
- **Hot Module Replacement** - React Refresh support for instant updates
- **TypeScript Support** - First-class TypeScript/TSX transformation via esbuild-wasm
- **TypeScript & JSX Support** - Run `.ts`/`.mts`/`.cts` files directly via Node-style type-stripping, plus `.jsx`/`.tsx` via a synchronous, pure-JS JSX transform that's config-driven from the nearest `tsconfig.json`/`jsconfig.json`; first-class TypeScript/TSX transformation in dev servers via esbuild-wasm
- **Service Worker Architecture** - Intercepts requests for seamless dev experience
- **Optional Web Worker Support** - Offload code execution to a Web Worker for improved UI responsiveness
- **Secure by Default** - Cross-origin sandbox support for running untrusted code safely
Expand Down
Loading