ef4 / prember

Prerender Ember apps with Fastboot at build time.
MIT License
195 stars 17 forks source link

Plans for local development flows? #24

Closed lougreenwood closed 5 years ago

lougreenwood commented 6 years ago

Prember seems to be a great fit for a traditional SaaS app where the public pages are rendered using Prember (SEO etc) and the internal/logged-in pages are statically rendered from the built Ember app.

One of the main benefits of Prember is that it allows a deployed production build to gain the benefits of Fastboot where Fastboot provides value and limit the downside of Fastboot (additional point of failure/extra complexity on production, add-on compatibility issues etc)

However, it seems that for local development there's an obvious gap - if Prember is to be used locally when using ember s then Fastboot is also needed - which means that the local development environment doesn't match the deployed environment.

This is a scenario I'm battling right now, I'd like to see my public pages rendered using Prember as I work on them, so I can be aware of any issues as I work on and test the app, but I'd like my internal pages to not need the extra work and compromises needed to run on Fastboot when they wouldn't be using Fastboot on production.

So my question is a general one - is there an idea for any path towards a future for Prember which allows local development to serve Prember-rendered pages according to those defined in ember-cli-build and all other pages are rendered usually by ember s with no Fastboot involvement?

willviles commented 6 years ago

@lougreenwood, this may be what you're looking for?

FASTBOOT_DISABLED=true PREMBER=true ember serve
lougreenwood commented 6 years ago

@willviles thanks for the suggestion!

I just quickly tried that, but I immediately get an error about navigator is not defined - this is an error I don't see in production.

Probably need to do some more digging, but at first glance it looks like combing those env vars doesn't work (at least for me) :(

lougreenwood commented 5 years ago

Seems that my issue was that I wasn't properly pre-rendering pages.

After taking the time to fix all of my pre-rendered pages in FastBoot, things are now working.