...
Platform Provided Dependencies
These are dependencies that may or may not be used in your module, but are common within the platform. These are singleton dependencies, so its necessary that they’re only added to the bundle from one primary, dependent source (the platform!) They should be listed as both peerDependencies
and devDependencies
(for testing) in your ui-module’s package.json
React Router/React Router DOM
Provides our general routing infrastructure.
Form Library
Provides a consistent source of implementation for various form-related concerns such as validation and tracking a form state. As of Quesnelia release, there is still usage of redux-form
and react-final-form
within the system, but these projects have decreased in maintainer responsibility. react-hook-form
is the recommended package for new form development - but it isn’t provided by the platform yet. Stay tuned!!
Date/Time Library
As of Quesnelia release, DayJS
is available from @folio/stripes/components
as a pre-extended export. See Date/time utilities documentation for more information.
Data Fetching
For API calls, we provide ky
, and react-query
. A global QueryClientProvider
wraps the module container; modules must not implement their own. @folio/stripes/core
exports useOkapiKy
(source) and withOkapiKy
(source) which decorate API requests with the options and headers required for authentication to the API gateway (Okapi).
Zustand
Zustand is a global state management solution.
Development setup
Repository settings
Pre-release FOLIO modules are published to our folioci
package repository, apart from publicly available npm
. To install pre-release dependencies, you will need to configure your package manner to install @folio
-scoped packages from the folioci
repository by executing this in a command prompt:
Code Block |
---|
$ yarn config set @folio:registry https://repository.folio.org/repository/npm-folioci/ |
Dev Workspace
For the best developer experience, it’s advisable to do development within a yarn workspace. Your workspace will need to include a FOLIO platform as well as a clone of your own ui-module. A sample workspace package.json for convenience can be as follows:
Code Block |
---|
{
"private": true,
"workspaces": [
"*"
],
"dependencies": {
"yarn": "^1.22.17"
}
} |
Set Okapi URL
Typescript
Linting
...