Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Make FastBoot compatible #28

Open
chadian opened this issue Nov 18, 2019 · 2 comments
Open

Make FastBoot compatible #28

chadian opened this issue Nov 18, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@chadian
Copy link
Owner

chadian commented Nov 18, 2019

Support FastBoot so that this addon:

  • Doesn't break when rendering in a fastboot
  • Allows some fastboot fallback so users can choose what should be rendered
@lolmaus
Copy link
Contributor

lolmaus commented Dec 11, 2019

Hey @chadian, do you have suggestions how this could be theoretically possible, given that FastBoot render does not know viewport dimensions?

I wish browsers sent viewport size in HTTP headers, but that's not the case.

The only idea I have is to have inline JS in the HTML that would execute eagerly and redirect to the same page but with extra query params indicating viewport size. But this may cause a delay defeating the purpose.

@chadian
Copy link
Owner Author

chadian commented Dec 12, 2019

Hey @lolmaus, as a first take I was thinking that a reserved fastboot breakpoint key being included automatically.

So for css it would look like:

.my-component[fill-up-fastboot] {
  font-size: 50px;
}

and then in hbs you would also have access like:

<FillUp
  @breakpoints={{hash
    small=(fill-up-between 0 800)
    medium=(fill-up-between 800 1200)
    large=(fill-up-gte 1200)
  }}
as |F|>
  {{#if F.breakpoints.fastboot}}
    👋Here's some basic useful information, until I can re-render.
  {{/if}}
</FillUp>

This way you're opting in for what gets rendered in fastboot environment with some minimally useful information or a loading spinner.

I'm curious about your idea though. If you did know the global viewport dimensions how would you know the the size of the local components? Is there a use-case where supplementary details wouldn't suffice until the app has had a chance to render?

@chadian chadian added the enhancement New feature or request label Dec 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants