🛂Migrating from V3
Last updated
Last updated
BlueRain V4 is a complete rewrite of the whole framework. These have resulted in some major breaking changes. We made a conscious decision to go ahead with it since we a major version, we wanted to do what's right, rather than carry mistakes of previous version.
This page should serve as a guide to migrate BlueRain projects from V3.
The project name has changed in V4. Previous the framework was called BlueRain OS
. We have decided to drop the OS
part. So now, it's just BlueRain
.
From V4 onwards, the project will move to it's new homes at:
Unfortunately, this also means that all import statements need to be migrated as well.
Theres no easy way to say this but... withBlueRain
HOC is gone! Use BlueRainConsumer
component instead.
We did this to simplify the API and to keep the bundle size in check.
In V3 we used a single instance of BlueRain. This instance was exported from the library as default
and BR
. This has been removed in the V4. This means:
Now there is not default export in BlueRain 4.
Now there is no single BlueRain instance exported.
This also allows us to use more than one BlueRain apps in a single project.
Since registry codebase has been completely revamped, the internal API and methods has changed. So, if you use any of the BR.Hooks
class methods directly, be sure to check docs for changes.
Some important changes are listed below:
add
and remove
methods have been renamed to register
and unregister
respectively.
Behavior of set and remove has changed.
set
method sets the whole array of all listeners of a hook, as opposed to a single listener.
Hooks in V3 were made of 2 registries:
FilterRegistry
EventRegistry
Both of these have been removed, and we only have a single unified registry now, i.e. HookRegistry.
This also means that there are no BR.Filters
and BR.Events
properties in BlueRain context anymore.
All BR.Hooks.run
now returns a Promise that resolves a value, previously it just returned the value.
In V3 a hook handler function could receive any number of arguments. This has been changed and now a hook can only receive 3 fixed arguments.
More details of about the arguments passed to the handler function can be found here.
Since registry codebase has been completely revamped, the internal API and methods has changed. So, if you use any of the BR.Plugins
class methods directly, be sure to check docs for changes.
Some important changes are listed below:
add
and remove
methods have been renamed to register
and unregister
respectively.
Behavior of set and remove has changed.
set
method sets the whole array of all listeners of a hook, as opposed to a single listener.
initializeAll
method has been removed. Use bluerain.plugins.initialize.all
hook instead.
registerMany
method has been removed. Use bluerain.plugins.register
hook instead.
IconEnhanced Component has been renamed to DynamicIcon