A mini-program API environment

Each environment manages multiple backend contexts. However, a backend context should be exclusively managed by a single environment (to avoid StyleScopeId confliction). It is able to create multiple CodeSpace within the environment.

Constructors

Methods

  • Create a component space that can manage WXML, WXSS, JS and static JSON config files

    The space can be specified as a main space. This makes some features available:

    • the app.wxss will be used as a style sheet for all root components in the space;
    • the StyleIsolation.Shared is accepted for components in the space. Non-main spaces usually act as plugins. publicComponents is a map for specifying a map of aliases and component paths.

    Parameters

    • id: string
    • isMainSpace: boolean
    • publicComponents: {
          [alias: string]: string;
      } = ...
      • [alias: string]: string

    Returns CodeSpace

  • Get a global code space in which global components can be defined

    External glass-easel based components can be defined in this code space. All global components should be defined before any other CodeSpace created!

    Returns CodeSpace