-
Notifications
You must be signed in to change notification settings - Fork 16
Add response types and emit TypeScript declarations #643
Conversation
@leplatrem If everything looks good, could you merge and release a new alpha version? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could only overlook the changes, and trust you on this.
Let me know when you're ready with the changes I can try to run some tests with the new Gecko build output
@leplatrem merged! You can view a diff of the Gecko build here. It's primarily differences between how Babel and TypeScript emit certain features. There are a few actual implementation changes, but those all passed tests so it should be fine! Let me know how it goes! (Also, if you wouldn't mind, could you do another alpha release so we can get the TypeScript PR for |
Now that I've confirmed these types work well with how the library is being used in
kinto.js
, I think it's time to enable the declarations! This is an important step to finishing the TypeScript conversion forkinto.js
.This PR also removes
"use strict";
since TypeScript emits that by default.This PR also makes a slight modification to the browser build process. Because we're exporting types for use by the TypeScript compiler in
kinto.js
, Rollup wants to export those types in the browser bundle as well, which causes issues since the browser bundle is a UMD module. This PR adds a newindex.browser.ts
file much likeindex.fx.ts
that just re-exports theKintoClient
. TypeScript 3.8 will introduce type only imports that get removed once passed through the compiler, so this is just a temporary solution until 3.8 is released. I highly doubt we'll cut a non-prerelease prior to the release of 3.8, but I'd rather have the repo in a working state in the interim!This PR supersedes #562, and fixes #517.