Skip to content

pmalacho-mit/Thrafe

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Thrafe

Pronounced like the name 'Rafe', as in:

My uncle, Thrafe lives in the Cayman Islands.

This is a library that aims to make it simple and straightforward to make typesafe, multithreaded web applications (using Typescript and web workers) -- hence the annoying name, Thrafe: threading + typesafe.

Why?

When working on my CommunicativeCode webapp, I found it tricky to use both Typescript and web workers for the following reasons.

Where / how should types fit it in?

Bungling Bundling

On one side, it's completely unobvious how best to compile & bundle a web worker written in typescript down to a single javascript file so that it can then be executed as a worker in the browser, e.g.:

const worker = new Worker('https://www.my-example-website.com/static/worker.js');

Bundlers are supporting this in different ways, which I think is already confusing.

Vite's solution seems pretty neat, webpack seems to be working on it (not immediately clear to me how this works with typescript), but regardless I don't like how any of the solutions I've seen.

Two-way communication

Anatomy of a Thrafe Implementation

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 62.2%
  • JavaScript 31.6%
  • Svelte 4.2%
  • HTML 2.0%