lundi 22 juin 2020

How to integrate EmberJS incrementally into an rails web app?

we're working on our opensource password manager cryptopus https://github.com/puzzle/cryptopus. since our last release we integrated emberjs and are updating one component after another from classic rails webapp to emberjs. For now, we used locationType: "hash" to trigger emberjs parts.

one challenge we're facing now is to make sure the URLs are still the same after moving the UI components to emberjs. So we should get rid of "hash"-URLs for emberjs and still be able to call some legacy rails webapp URLs.

is there a way to ignore routes in emberjs and sending the request to the backend? any other ideas to make an incremental integration of emberjs possible? It would be OK if the SPA would be re-initialized after coming back from an class rails webapp URL.

some example routes:

/session/new -> send to rails backend
/teams -> handle by emberjs
/teams/42 -> handle by emberjs
/admin/users -> send to rails backend



Aucun commentaire:

Enregistrer un commentaire