Conversation
rexxars
approved these changes
Sep 14, 2022
Member
rexxars
left a comment
There was a problem hiding this comment.
Wow. That's a huge amount of work - thank you!
Let's make sure to release this as a major version just in case?
Member
Author
|
Yeah let's err on the side of caution |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Can be tested using
npm i get-it@esm.There's also a
@sanity/client@esmthat lets you try it out.Changelog:
--dry-runflag for until it's run on main and we've verified it's good to go..cjsand a.mjsfile. Uses Node 18's new built-in test runner to ensure the testing env doesn't handle pkg.exports differently than native node ESM.-C browserto test pkg exports when thebrowserconditional is active, just to catch easy mistakes like typos.browseranddenothat's native ESM.get-itas it is today.--platform=browsermode to applypkg.browsermappings to ensure minimal changes to existing code is required, and greatly reducing the risk of regression bugs.type: commonjsinstead oftype: modulefor the same reason, to avoid introducing breaking changes in systems that currently work withget-itbut would break if we started moving around files. By usingtype: commonjsand.mjsfile extensions we ensure every flavor of Node.js keep working.Why both
denoandbrowserconditions? Because deno doesn't supportbrowserwhen it's in compat mode: https://client-runtimes-dashboard.sanity.build/#:~:text=deno%2C%20import%2C%20node%2C%20node.deno%2C%20node.importThe list over supported ESM browser/deno/worker mode exports is based on looking at how
get-itis commonly imported: