Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Apr 4, 2022. It is now read-only.

Conversation

dstaley
Copy link
Member

@dstaley dstaley commented Jan 16, 2020

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 for kinto.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 new index.browser.ts file much like index.fx.ts that just re-exports the KintoClient. 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.

@dstaley dstaley requested a review from leplatrem January 16, 2020 19:59
@dstaley dstaley mentioned this pull request Jan 16, 2020
3 tasks
@dstaley
Copy link
Member Author

dstaley commented Jan 16, 2020

@leplatrem If everything looks good, could you merge and release a new alpha version?

Copy link
Contributor

@leplatrem leplatrem left a 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

@dstaley dstaley merged commit 4d22f80 into master Feb 11, 2020
@dstaley dstaley deleted the emit-declarations branch February 11, 2020 16:55
@dstaley
Copy link
Member Author

dstaley commented Feb 11, 2020

@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 kinto.js working on CI? Thank you!)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve typings for functions that return server data
3 participants