Skip to content

Refactor sandboxGlobals options into buildSandboxGlobals #239

@rwjblue

Description

@rwjblue

Now that we are not sharing a single sandbox context for all visits, we will need to change the API to provide custom globals from a single stable object with properties to be assigned into the VM sandbox to a builder function that will return a new object for each request.

Specifically, we will move from:

let app = new FastBoot({
  distPath: 'path/to/dist',
  sandboxGlobals: { someProperty: whateverHere },
});

To:

let app = new FastBoot({
  distPath: 'path/to/dist',
  buildSandboxGlobals() { 
    return { someProperty: whateverHere };
  },
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions