Holocron Modules may be developed and versioned in isolation as if they were their own frontend applications. The one-app
Server relies on a module-map.json
configuration file to orchestrate all these versioned web experiences together to form a single application. A Module Map contains an object of the following information:
- Holocron Module Name
- URLs to Holocron Module Bundles
- Subresource Integrity Hash to verify contents of the Holocron Module Bundle
Contents
({
clientCacheRevision: String, // optional
modules: {
[moduleName]: { // required
browser: {
url: String, // required
integrity: String, // SRI String required
},
legacyBrowser: {
url: String, // required
integrity: String, // SRI String required
},
node: {
url: String, // required
integrity: String, // SRI String required
},
},
// ... more module entries allowed
},
});
{
"clientCacheRevision": "<any-string>",
"modules": {
"cultured-frankie": {
"browser": {
"url": "https://one-app-statics.surge.sh/modules/f16a872/cultured-frankie/0.0.0/cultured-frankie.browser.js",
"integrity": "sha256-CGgTIe7x19CK+Z7G7YAjwPMstd/gpWNd4FRce7csbNA= sha384-8QStyVD+275LwFA2Zlgyh3fnt5chqPMpJjD9Yn8AF1dybM297+lFid40gZ+JCBqY"
},
"legacyBrowser": {
"url": "https://one-app-statics.surge.sh/modules/f16a872/cultured-frankie/0.0.0/cultured-frankie.legacy.browser.js",
"integrity": "sha256-7xmKAgHKfrK4WVdRDW5i2NHauPd79NWa/XJ5yKiKhpo= sha384-MsQDrDBAK3KfG/svpk7C3wHy+Ht7G6D99NbjZjBcfxdhPbZFeIQgsBtKkCVXzR1P"
},
"node": {
"url": "https://one-app-statics.surge.sh/modules/f16a872/cultured-frankie/0.0.0/cultured-frankie.node.js",
"integrity": "sha256-fQT5PYOExfnv/b6tMAoWdp8lyJK1XPHloKfjNQUfySk= sha384-LhjPddGOg6KcGbs2IhVWvZRnyNrEasr01aVhOPXmwlTzg3n2QQqxJHdx93aucRby"
}
}
}
}
This optional value is used to bust the client-side caching of Modules in the Holocron Module Registry.
By convention, the moduleName
is the key mapping where Holocron Module bundles are stored in the Holocron Module Registry.
Includes an object of url
and integrity
pointing to the location of the modern browser
bundle (e.g. last two major versions of currently used browsers) for a Holocron Module.
Includes an object of url
and integrity
pointing to the legacyBrowser
bundle (e.g. more transpilation for older browsers like Internet Explorer) for a Holocron Module.
Includes an object of url
and integrity
pointing to the location of the node
bundle (e.g. Serverside compatible) for a Holocron Module.
Contains a fully qualified url
to a Holocron Module bundle location.
Contains a hash SRI integrity
string to validate the contents of a Holocron Module bundle.
📘 More Information
- Library: One App Bundler
- CLI Command: npm start
- Environment Variables
- Development Tools