Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fastboot support/ virtualise extraVendorFiles #2036

Open
BlueCutOfficial opened this issue Jul 10, 2024 · 0 comments
Open

Fastboot support/ virtualise extraVendorFiles #2036

BlueCutOfficial opened this issue Jul 10, 2024 · 0 comments

Comments

@BlueCutOfficial
Copy link
Collaborator

About FastBoot support

Fastboot is a solution to run Ember applications server-side, in a Node.js environment. (Like every documentation in the Ember world, Fastboot introduction to server-side rendering offers very enlightening comparisons to teach the concept).

To use Fastboot, you have to install ember-cli-fastboot. In other words, if this specific addon is present in the list of active addons used by your app, then it means that a bunch of Fastboot-related things need to be there and work as expected in the new Embroider world.

ember-cli-fastboot compat-dapter

To work correctly, an app using FastBoot has some FastBoot-related scripts referenced in the index.html. To retrieve this behavior, Embroider uses a compat-adapter for ember-cli-fastboot.

Let's try to put it simply: to maintain the compatibility of classic addons, Embroider rewrites them to static addons in what we call the rewritten-packages. If a classic addon has a corresponding compat-adapter, it allows Embroider to customize the way the package is rewritten.

The compat-adapter of ember-cli-fastboot emits a certain number of files so they can be found later in the build pipeline. To let Embroider find them, they are referenced in the package.json of the rewritten packages under the following field:

"embroider-fastboot": {
    "extraAppFiles": [],
    "extraVendorFiles": [],
}

extraVendorFiles

In the past, Embroider used to change the index.html between the initial Ember app and the rewritten-app, and while doing this, it seized the opportunity to include extraVendorFiles in the index.html using <fastboot-script> tags. Now, the index.html of the Ember app stays as it is, so we need to implement a new way for Vite to retrieve these scripts.

This task consists of:

  • Virtualizing the files listed in extraVendorFiles so Embroider provides its content to Vite.
  • If necessary, emitting the files in the production build.
@BlueCutOfficial BlueCutOfficial converted this from a draft issue Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant