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

Increment latest schema version to 5 #822

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

xg-wang
Copy link
Member

@xg-wang xg-wang commented Apr 7, 2021

html-oriented manifest format

In the new schema format, which is defined in
ember-fastboot/fastboot@3fd5bc9
the manifest is written into HTML and later extracted by fastboot on
server side instead of previously reading from dist/package.json

Note:

(1) fastboot config
The new schema in fastboot did not handle fastboot config
https://github.com/ember-fastboot/ember-cli-fastboot/tree/e4d0b7c7bcdf82def0dc8726835b49d707673f41#providing-additional-config
The support is added in the #854

The fastboot config meta has the name ending with
"config/fastboot-environement" to distinguish from regular
"config/environement" meta tags. If the new meta tags are not found,
which happens in embroider builds, we fallback to find regular meta
tags.

(2) keeping package.manifest
We cannot drop manifest field in the generated package.json until
broccoli-asset-rev support support reading config from html.

Allow to require module path from whitelisted dependency

Incrementing schema to 5 also included the changes in schema 4
strictWhitelist
See ember-fastboot/fastboot#200

@@ -4,6 +4,30 @@
"fastboot": {
"schemaVersion": 5,
"moduleWhitelist": [],
"htmlEntrypoint": "index.html"
"htmlEntrypoint": "index.html",
"config": {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ef4 @rwjblue should we put config in a <meta name="<my-app>/config/fastboot-environment"> instead? Then we can merge with browser env and pass it to sandbox

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't thought about this in a while but that seems fine to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in latest commit. v5 schema after the fix is backwards compatible to embroider build

@xg-wang
Copy link
Member Author

xg-wang commented Apr 7, 2021

We should also ignore certain scripts like https://github.com/embroider-build/embroider/pull/455/files

@xg-wang xg-wang force-pushed the increment-schema branch 2 times, most recently from 00dc159 to 9068d29 Compare April 9, 2021 18:42
@@ -455,18 +455,4 @@ describe('FastBoot', function() {
usedPrebuiltSandbox: true,
});
});

it('htmlEntrypoint works', function() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to test-packages/integration-tests/test/basic-test.js

@xg-wang
Copy link
Member Author

xg-wang commented Apr 12, 2021

@ef4 @rwjblue this is ready for review, can you take a look?

When using custom rootURL specified in environment.js, the
fastboot-script is still having relative path to local dist path, not
containing rootURL path. The fastboot-script should not be ignored.
html-oriented manifest format
-----------------------------

In the new schema format, which is defined in
ember-fastboot/fastboot@3fd5bc9
the manifest is written into HTML and later extracted by fastboot on
server side instead of previously reading from dist/package.json

Note:
The new schema in fastboot does not handle fastboot config
https://github.com/ember-fastboot/ember-cli-fastboot/tree/e4d0b7c7bcdf82def0dc8726835b49d707673f41#providing-additional-config
The support is added in the #854.

Allow to require module path from whitelisted dependency
-------------------------------------------------------

Incrementing schema to 5 also included the changes in schema 4
strictWhitelist
See ember-fastboot/fastboot#200

Revert back to put config in dist/package.json

add data-fastboot-ignore to unexpected files

properly ignore files that should not execute in fastboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants