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 should not try to load through publicAssetURL #1210

Merged
merged 1 commit into from
May 24, 2022

Conversation

ef4
Copy link
Contributor

@ef4 ef4 commented May 24, 2022

When an application has customized the publicAssetURL, it means browsers should load assets from that URL prefix. However, fastboot doesn't work that way and always loads assets from a local dist directory. So when publicAssetURL differs from rootURL, we need to emit different URLs for fastboot vs browser.

Thankfully, the fastboot protocol V5 (which embroider already relies on) was designed to account for fastboot-specific assets via both <fastboot-script src="..."> and <script data-fastboot-src="...">, so we can easily emit output that provides consistent views to both browses and fastboot.

When an application has customized the publicAssetURL, it means browsers should load assets from that URL prefix. However, *fastboot* doesn't work that way and always loads assets from a local `dist` directory. So when publicAssetURL differs from rootURL, we need to emit different URLs for fastboot vs browser.

Thankfully, the fastboot protocol V5 (which embroider already relies on) was designed to account for fastboot-specific assets via both `<fastboot-script src="...">` and `<script data-fastboot-src="...">`, so we can easily emit output that provides consistent views to both browses and fastboot.
@ef4 ef4 added the bug Something isn't working label May 24, 2022
@ef4 ef4 merged commit 3ae10a9 into main May 24, 2022
@ef4 ef4 deleted the fastboot-public-asset-url branch May 24, 2022 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant