Giter Site home page Giter Site logo

winterjs's Introduction

WinterJS

A blazing-fast JavaScript server that runs Service Workers scripts according to the Winter Community Group specification.

WinterJS is able to handle up to 100,000 reqs/s in a single laptop (see Benchmark).

Note: WinterJS is not officially endorsed by WinterCG, despite sharing "Winter" in their name. There are many runtimes supporting WinterCG, WinterJS being one among those.

Running WinterJS with Wasmer

The WinterJS server is published in Wasmer as wasmer/winterjs.

You can run the HTTP server locally with:

wasmer run wasmer/winterjs --net --mapdir=tests:tests tests/simple.js

Where simple.js is:

addEventListener('fetch', (req) => {
  req.respondWith(new Response('hello'));
});

Running WinterJS Natively

You can run WinterJS natively by simply doing

cargo run -- tests/simple.js

And then access the server in https://localhost:8080/

How WasmerJS works

WinterJS is powered by SpiderMonkey, Spiderfire and hyper to bring a new level of awesomeness to your Javascript apps.

WinterJS is using the WASIX standard to compile to WebAssembly. Please note that compiling to WASIX is currently a complex process. We recommend using precompiled versions from wasmer/winterjs, but please open an issue if you need to compile to WASIX locally.

Limitations

WinterJS is early, pre-release software. It is currently not fully compliant with the WinterCG spec and the runtime itself is still a work in progress. It is not recommended to use WinterJS in production yet. For more information, see the API Compatibility section below.

WinterCG API Compatibility

This section will be updated as APIs are added/fixed. If an API is missing from this section, that means that it is still not implemented.

The following words are used to describe the status of an API:

  • ✅ Stable - The API is implemented and fully compliant with the spec. This does not account for potential undiscovered implementation errors in the native code.
  • 🔶 Partial - The API is implemented but not fully compliant with the spec and/or there are known limitations.
  • ❌ Pending - The API is not implemented yet.
API Status Notes
console ✅ Stable
fetch 🔶 Partial Request, Response and ReadableStream need to be stabilized before fetch can be considered Stable
URL ✅ Stable
URLSearchParams ✅ Stable
Request 🔶 Partial ReadableStream needs to be stabilized before Request can be considered Stable
Requests cannot be sent with ReadableStream bodies
Headers ✅ Stable
Response 🔶 Partial ReadableStream needs to be stabilized before Response can be considered Stable.
Response.body returns a Promise that resolves to a ReadableStream instead of returning a ReadableStream directly.
Blob 🔶 Partial Blob.stream() is not implemented yet
FormData ✅ Stable
TextDecoder 🔶 Partial Only UTF-8 is supported
TextEncoder 🔶 Partial Only UTF-8 is supported
ReadableStream 🔶 Partial Creating ReadableStreams with type: 'bytes' is not supported yet.
Returning ReadableStreams to native code is not supported yet.
atob ✅ Stable
btoa ✅ Stable
performance.now() ✅ Stable
performance.timeOrigin ❌ Pending

winterjs's People

Contributors

jdm avatar nox avatar sagudev avatar bors-servo avatar arshia001 avatar redfire75369 avatar theduke avatar ms2ger avatar vvuk avatar syrusakbary avatar michaelwu avatar metajack avatar mrobinson avatar larsbergstrom avatar simonsapin avatar brson avatar fitzgen avatar eijebong avatar emilio avatar mmatyas avatar cybai avatar akosthekiss avatar delan avatar pcwalton avatar kmcallister avatar mbrubeck avatar mukilan avatar teapotd avatar glennw avatar tetsuharuohzeki avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.