airbnb / hypernova-ruby

Ruby client for Hypernova.
https://github.com/airbnb/hypernova
MIT License
141 stars 55 forks source link

Fixes developer plugin to include fallback HTML #4

Closed goatslacker closed 8 years ago

goatslacker commented 8 years ago

This PR changes where/when after_response gets called.

Before: we used to call after_response right after we received the response from the Hypernova server. Now, we'll call it after we've parsed it, ran through it, and fixed the response. This means that if a component has failed the html field will no longer be blank but it'll have the fallback HTML for client side rendering.

This is important because otherwise you'd be using the developer plugin and you wouldn't have the fallback HTML in the page causing client rendering to fail.

This also fixes the developer plugin directly. Now, it inserts the fallback HTML in the response which it overwrites.

@tommydangerous @ljharb

ljharb commented 8 years ago

LGTM once tests pass, pending my question