Skip to main content

App

A just-web app is a context object that share functionalities and data (through store or other means) within an application.

It is used to expose public API of each layer of the application, allow each feature easily access the logic and utilities of other features.

manifest + main

manifest convention and customization

a cache key on manifest or main depends on option variations?

  • register then dynamic load

  • load(): load a plugin and its dependencies, and determine should it be loaded

  • init(): initialize a plugin after it is loaded

  • start(): when the plugin is needed

It should contain public API of each layer of every features.

It should contains any external dependencies (or their facades or adaptors), and any public API on each layer of the application.

just-web relies on this custom context object instead of relying on existing context objects for a few reasons:

  • supporting micro front-end (MFE) architecture
  • maximize testability
  • establish a common convention to simplify development

The app is accessible from the UI through a DOM-attached context. For example, the Context API in react and Solid.js.

context object

A context object is a construct where, within a certain context, a code can access for data or functionalities.

For example, the global object is a context object that lives in the global scope, which a code can access.

Other examples are:

  • module context: the implicit object that contains references to the variables and functions
import path from 'node:path'

let count = 0

export function foo() {}

// when you access `path`, `count`, or `foo` within the file,
// you are actually accessing `{module context}.path`, `{module context}.count`, `{module context}.foo`
// `myModule` is a namespace object
import * as myModule from './some-module.js'
  • custom context: any user created object or constructs that is used as a context object.
import axios from 'axios'

const context = { a: 1, axios }

const contextMap = new Map()

Store

Features