Show how a Piral instance may be live updated.
⚡ This sample demonstrates using piral-update
to swap a pilet at runtime when it changes.
You can visit this demo at live-updates.samples.piral.cloud/.
Install the dependencies:
npm install
If you want to change the values to your auth0 provider then go ahead and modify the values in the src/client.ts module. These values need to come from auth0 as shown in the next section.
Now run:
npm start
The app shell should be up and running.
For the sample the update is just a simple swap of the "mario5" pilet with the "spaceshoot" pilet. We do not use the feed service for this as these would be two different pilets there and no update is actually happening. Instead, we create the response directly, telling the app shell that both pilets are the same, but in different versions.
You find more information at the the plugin page.
Piral and this sample code is released using the MIT license. For more information see the license file.