Skip to content

How to handle running in Node #21

Closed
@trentmwillis

Description

@trentmwillis

When running an Ember application in Node (such as through FastBoot), the asset-manifest module blows up since it can't read from the DOM (which doesn't exist).

There are patterns to handle this, but it raises the overarching issue of how should lazy assets be handled within a non-browser environment.

Open questions:

  • Should the Asset Manifest be present in Node? Or should it just be an empty config?
    • If the manifest is present, what should the loader functions do?
    • If the manifest is not present, what happens when a code path is hit that expects to load something?

My current thinking is:

In a Node process, all assets should be loaded upfront (need build targets in order to do this easily), but the manifest should still be present so that if a code path expects to load a bundle (or similar) it doesn't kill the app. This would mean that the loader functions should all return immediately resolving Promises (Promise.resolve()).

@nathanhammond @dgeb @rwjblue would greatly appreciate hearing your thoughts on this

Tasks:

  • Pre-load assets in non-browser environments (should be handle by whatever booted the application)
  • Enable asset-manifest to be present in non-browser environments [PR]
  • Return resolved Promises from loaders in non-browser environments [PR]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions