Piral-Core Redux & Saga Demo
⚡ A demo of a microfrontend portal based on piral-core and Redux with Saga.
This is a sample project using piral-core in combination with redux for global state and redux-saga for side-effects.
We use redux-dynamic-modules to dynamically load reducers and sagas into redux when needed.
You can visit this demo at core-redux-saga.samples.piral.cloud/.
Be aware, that state added via <DynamicModuleLoader>
is only available when the <DynamicModuleLoader>
is actually mounted.
sample-shell
contains the shell (core) application.sample-pilet
contains a pilet (sub-application).
- Go into
sample-shell
and execute these commands:npm ci
=> will install dependenciesnpm run build
=> will create both a simulator package (indist/emulator/*.tgz
) and a release build.
- Go into
sample-pilet
and execute these commands:npm i ../sample-shell/dist/emulator/piral-core-redux-saga-demo-shell-0.11.5.tgz
=> installs the simulator package you just build above.npm run build
=> will create a release build.
Normally, you'd publish your simulator package for easier installment, but since this is a demo, it isn't published anywhere.
- To run the sample pilet in the simulator, follow these steps:
- run
npm start
from within thesample-pilet
directory.- This starts the simulator package and automatically loads the pilet into it.
- Open your browser at http://localhost:3000
- This is nice for debugging.
- run
- To run the sample pilet in a more realistic way, follow these steps:
- run
npm start
from within thesample-shell
directory.- This starts the shell application normally (no simulator)
- run
npm run feed
from within thesample-shell
directory.- This starts a sample feed service
- run
npm run publish-pilet:fresh
from within thesample-pilet
directory.- This creates a fresh build of the pilet and publishes it on the sample feed service.
- Open your browser at http://localhost:3000
- run
Piral and this sample code is released using the MIT license. For more information see the license file.