I've taken our hand-written setup.js file and converted it into a TypeScript project.
This should make things easier going forward because we'll be able to precisely define the native functions exposed by WinterJS and write abstractions on top of them.
It also gives us nice things like bundling (our setup code can now use dependencies!) and *.d.ts files that we can upload to the DefinitelyTyped repo and have published as @types/winterjs.
To make sure our setup.js file doesn't go out of sync with the TypeScript code, I've added a self-updating integration test.
The main concern I have is that my translation won't be a 1:1 identical copy of setup.js and I might have missed something. I copied as much as possible from the original setup.js and winter.d.ts files but wasn't able to test the new code because mozjs doesn't build on my machine.
I've taken our hand-written
setup.js
file and converted it into a TypeScript project.This should make things easier going forward because we'll be able to precisely define the native functions exposed by WinterJS and write abstractions on top of them.
It also gives us nice things like bundling (our setup code can now use dependencies!) and
*.d.ts
files that we can upload to the DefinitelyTyped repo and have published as@types/winterjs
.To make sure our
setup.js
file doesn't go out of sync with the TypeScript code, I've added a self-updating integration test.The main concern I have is that my translation won't be a 1:1 identical copy of
setup.js
and I might have missed something. I copied as much as possible from the originalsetup.js
andwinter.d.ts
files but wasn't able to test the new code becausemozjs
doesn't build on my machine.