diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5be8cfb7df4..ff41e1a22fa 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -867,11 +867,11 @@ jobs:
working-directory: mithril-explorer
run: make test
- - name: Build Explorer
+ - name: Build Explorer (stable)
working-directory: mithril-explorer
run: make build
- - name: Publish Explorer build
+ - name: Publish Explorer build (stable)
uses: actions/upload-artifact@v4
with:
name: explorer-build
@@ -879,6 +879,21 @@ jobs:
path: |
mithril-explorer/out/*
+ - name: Build Explorer (unstable)
+ working-directory: mithril-explorer
+ env:
+ BASE_PATH: "/explorer/unstable"
+ UNSTABLE: "1"
+ run: make build
+
+ - name: Publish Explorer build (unstable)
+ uses: actions/upload-artifact@v4
+ with:
+ name: explorer-build-unstable
+ if-no-files-found: error
+ path: |
+ mithril-explorer/out/*
+
build-open-api-ui:
runs-on: ubuntu-22.04
steps:
@@ -923,12 +938,18 @@ jobs:
name: docusaurus-build
path: ./github-pages/doc
- - name: Download Explorer build
+ - name: Download Explorer build (stable)
uses: actions/download-artifact@v4
with:
name: explorer-build
path: ./github-pages/explorer
+ - name: Download Explorer build (unstable)
+ uses: actions/download-artifact@v4
+ with:
+ name: explorer-build-unstable
+ path: ./github-pages/explorer/unstable
+
- name: Download OpenAPI UI build
uses: actions/download-artifact@v4
with:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c8671a353b0..5d1bbcee5d6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,8 @@ As a minor extension, we have adopted a slightly different versioning convention
## Mithril Distribution [XXXX] - UNRELEASED
+- Build and publish both a `stable` version (for release networks) and an `unstable` version (for testing networks) of the explorer.
+
- Crates versions:
| Crate | Version |
diff --git a/mithril-explorer/README.md b/mithril-explorer/README.md
index b7c4a0f6150..eff2a697abd 100644
--- a/mithril-explorer/README.md
+++ b/mithril-explorer/README.md
@@ -26,6 +26,20 @@ make dev
Open [http://localhost:3000](http://localhost:3000/explorer) with your browser to see the result.
+### Enabling unstable features
+
+Some features are still in development and are not enabled by default. To enable them, set the `UNSTABLE` environment variable to `1` when running the development server:
+
+```bash
+UNSTABLE=1 make dev
+```
+
+Or when building the production version:
+
+```bash
+UNSTABLE=1 make build
+```
+
## Adding or updating an icon of the 'Mithril' font
In the `./icons` folder add or modify a svg.
diff --git a/mithril-explorer/next.config.js b/mithril-explorer/next.config.js
index 64c55e20f6c..81a0a1980df 100644
--- a/mithril-explorer/next.config.js
+++ b/mithril-explorer/next.config.js
@@ -1,13 +1,20 @@
-/** @type {import('next').NextConfig} */
+const webpack = require("webpack");
+
+/** @type {import("next").NextConfig} */
const nextConfig = {
output: "export",
- basePath: "/explorer",
+ basePath: process.env.BASE_PATH ?? "/explorer",
reactStrictMode: true,
images: {
unoptimized: true,
},
webpack: (config) => {
config.experiments = { layers: true, asyncWebAssembly: true };
+ config.plugins.push(
+ new webpack.DefinePlugin({
+ "process.env.UNSTABLE": process.env.UNSTABLE === "1",
+ }),
+ );
return config;
},
};
diff --git a/mithril-explorer/package-lock.json b/mithril-explorer/package-lock.json
index fd22c1242ea..96036bbefdc 100644
--- a/mithril-explorer/package-lock.json
+++ b/mithril-explorer/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "mithril-explorer",
- "version": "0.7.22",
+ "version": "0.7.23",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "mithril-explorer",
- "version": "0.7.22",
+ "version": "0.7.23",
"dependencies": {
"@mithril-dev/mithril-client-wasm": "file:../mithril-client-wasm/dist/web",
"@popperjs/core": "^2.11.8",
diff --git a/mithril-explorer/package.json b/mithril-explorer/package.json
index 99b7cbb99dc..b82cfd213db 100644
--- a/mithril-explorer/package.json
+++ b/mithril-explorer/package.json
@@ -1,6 +1,6 @@
{
"name": "mithril-explorer",
- "version": "0.7.22",
+ "version": "0.7.23",
"private": true,
"scripts": {
"dev": "next dev",
diff --git a/mithril-explorer/src/app/layout.js b/mithril-explorer/src/app/layout.js
index 0060d4c43fe..4cc52380694 100644
--- a/mithril-explorer/src/app/layout.js
+++ b/mithril-explorer/src/app/layout.js
@@ -1,6 +1,7 @@
import Image from "next/image";
import Link from "next/link";
import React, { Suspense } from "react";
+import { Badge } from "react-bootstrap";
import { Providers } from "@/store/provider";
// These styles apply to every route in the application
@@ -31,6 +32,14 @@ export default function RootLayout({ children }) {
{" "}
Mithril Explorer
+ {process.env.UNSTABLE && (
+ <>
+ {" "}
+
+ Unstable
+
+ >
+ )}
{children}