The packaging
Pre-releasecuri-react
, et al.
curi-react
has been split up into a number of smaller packages. If you want all of the React web components, you can install curi-react
. However, if you only want the <Navigator>
and <Link>
, you may just want to install curi-react-navigator
and curi-react-link
.
UMD
A UMD example has been added to the curi-experiments
package.
Also, UMD builds have been switched to Rollup. These builds are now slightly smaller. There is a little bit of work to do in optimizing these because there are some duplicate helpers, but the releases are still quite small. react-dom
makes up the vast majority (over two-thirds) of the script download size.
file | dependency of | size |
---|---|---|
curi.min.js | n/a | 7.99kB |
curi-react.min.js | n/a | 7.46kB |
15.45kB | ||
history.min.js | curi | 14.9kB |
prop-types.min.js | curi-react | 2.42kB |
32.77kB | ||
react.min.js | curi-react | 21.3kB |
react-dom.min.js | react | 129kB |
183.07kB |
Todo: Test Curi with Preact?
curi
The curi
package has had two changes:
-
Response objects now have a
key
. For browser/memory histories, this will be the same as thelocation
's key. For hash histories, it will be a randomly generated 6 character alphanumeric string. -
You can now provide a
cache
option tocreateConfig
. The cache allows you to re-use responses to the same location. Implementations can vary, but the cache must haveget
andset
methods.get
receives the current location and returns the cached response for the location (if one exists).set
receives a response object, which the cache should store (usingresponse.location
to identify the location).