What are you after in the product?
I would just serve Epi content types or view models as JSON and go from there. The JS framework of choice changes every month anyway.
That's what were doing and it's working pretty nicely. But we've had to jump through some hoops to get on-page-editing to work. So I guess that's what we're after; not having the on-page-editing so coupled to Razor and not having to use MutationObservers to override when Episerver applies updates.
@Anders: I am really wondering how you got on-page-editing to work. Which hoops did you have to go through? It seems like a frightfully complex undertaking.
P.S. Could you update on us whether the state of on-page editing has improved (being more decoupled from epi) in later Epi versions?
It certainly wasn't easy, and one Episerver release broke our implementation so we had to almost redo it. But our current implementation is pretty solid. Wish I could share it but I'm pretty sure we're unique with it.
@Anders, Its good to see that someone successfully done it.
Can you share a bit more of your experience with us?
Is it still working? Was it as solid as you've expected?
We've had a site running it in production for about four months now, and it's been solid. We've hit some bumps in the road but nothing we haven't been able to fix.
Wish I could tell you more but the solution we've created is rather unique and it's something we want to keep internal at least until others catch on.
Maybe you just think it's unique ;) Since you won't share your experience no one will ever know.
Maybe so. :) Feel free to ask concrete questions and I'll answer as much as I can.
Hi Anders Ekdahl.
I am curious how you rendered the SPA application? I am not a epi developer but work with them.
We are working on implementing the Angular CLI projekt and render it in EPi, we are not interested in the OPE functionality at this point.
After building the Angular CLI project we get three files (.html, .js and .css). How would you implement the Angular project into EPi so it renders on a Epi site?
How would it work on a EPi-platform?
What JS framework did your project go with? I'm currently trying to work out some things with React and Epi and I'm curious if you may have dealt with some of the issues I'm facing now.
We're using React as well. What we do is basically that we've turned the site into an API, so that all content is accessible as JSON (but still have the same urls like before, Epi still controls the routing).
When a request comes in we check if it's an ajax request or not, and serve JSON or do server rendering.
Episerver has exposed a few hooks now to make it easier to hook into on page editing, but that unfortunately only works for simple values. The solution we came up with covers content areas and blocks as well, so we've continued with that even though it's quite a hack. We override `innerHTML` on the DOM node and intercept when Episerver tries to update and run our code instrad.
Is this something that Episerver is exploring as well? There are great advantages for dynamic and interactive sites to use these frontend tools to keep the code base under control, but there's very little aid from Episerver today with that approach. You basically end up working aganist Episerver, which is very unfortunate.