https://github.com/pokatomnik/ts2mjs
PoC for typescript to mjs files transpiling
https://github.com/pokatomnik/ts2mjs
ecmascript mjs modules mts preact typescript
Last synced: 19 days ago
JSON representation
PoC for typescript to mjs files transpiling
- Host: GitHub
- URL: https://github.com/pokatomnik/ts2mjs
- Owner: pokatomnik
- License: mit
- Created: 2022-08-01T23:38:23.000Z (almost 4 years ago)
- Default Branch: dungeon-master
- Last Pushed: 2022-08-22T15:45:42.000Z (almost 4 years ago)
- Last Synced: 2026-02-16T18:10:10.640Z (4 months ago)
- Topics: ecmascript, mjs, modules, mts, preact, typescript
- Language: TypeScript
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Typescript to MJS
This repository is a PoC and a small guide for developers who want to try Ecmascript modules but would like to use Typescript as a primary development language.
The Idea is to stop bundling the application because the ECMAScript modules [are ready and implemented in all major browsers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules).
So, this code is working in Chrome, Firefox, Safari and MS Edge (Blink-based).
This example has four Preact components written in the Typescript, so type checking is working just okay, Preact supports state, contexts and all (P)React things we love.
## Known issues
- If you're serious about ECMA modules, make sure you use HTTP/2. Good old HTTP/1 isn't good enough, because of performance issues.
- Keep in mind [this](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#browser_compatibility) table. The compatibility is good, but not perfect yet :(