ember-fastboot / ember-cli-fastboot

Server-side rendering for Ember.js apps
http://ember-fastboot.com/
MIT License
852 stars 160 forks source link

Turn on rehydration based on config #818

Open mansona opened 3 years ago

mansona commented 3 years ago

This is something that we discussed in the weekly Fastboot meeting where I thought it would be useful to be able to turn on rehydration based on a config entry rather than using the environment variable.

This would allow you to create a PR with the change to turn on rehydration quite easily, and also would support most preview apps setups when using heroku or something like netlify if you're using prember

I have managed to get my little test passing, and if all the other tests pass then I'm pretty confident that this would be ok to merge but I guess that we should probably still discuss it at one of the Fastboot meetings before we do.

One interesting fact: this doesn't actually enable rehydration for prember 🙈 the issue is that prember is actually instantiating its own Fastboot instance so I would need to make a change in prember to enable passing the config to either the constructor of the instance or the visit function call 🙃

mansona commented 3 years ago

@xg-wang regarding our discussion of the API of this change, here is me consuming the fastboot lib in prember: https://github.com/ef4/prember/pull/66 which might be useful to see what the API looks like in the wild.

Let me know what you think, and we can probably discuss it in the weekly meeting too 👍