Skip to content

v5.0.0: Optimized builds and `promise` prop

Compare
Choose a tag to compare
@ghengeveld ghengeveld released this 03 Mar 23:26
· 584 commits to master since this release

This major release changes the way the code is bundled and published by adopting @pika/pack. We now ship separate bundles optimized for browsers and Node.js as well as the original "esnext" source code. package.json now specifies the following:

"esnext": "dist-src/index.js",
"main": "dist-node/index.js",
"module": "dist-web/index.js",
"types": "dist-types/index.d.ts"

This should not break your app, but if it does, please let us know.

New prop: promise

This release also adds a new promise prop, which allows you to pass an already instantiated Promise rather than a function that returns a Promise. This comes with a few limitations:

  • You cannot use reload(), it will do nothing.
  • There's no way to pass props/arguments to the Promise instantiation.
  • The AbortController isn't available either.