Try our conversational search powered by Generative AI!

Server rendering HTML with Javascript

Vote:
 

It gets more and more popular for every day to render HTML with JavaScript libraries such as Knockout, React, Angular, etc. It's also getting more popular and viable to execute that JavaScript on the server as well as on the client using Node.js, with Microsoft exploring the field on how to integrate it with ASP.NET (https://github.com/aspnet/NodeServices).

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.

#142232
Dec 05, 2015 12:21
Vote:
 

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.

#144576
Feb 15, 2016 20:47
Vote:
 

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.

#144577
Feb 15, 2016 20:56
Vote:
 

@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?

#157870
Sep 23, 2016 15:11
Vote:
 

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.

  1. I wouldn't say that on-page-edit has gotten more decoupled, you just have figure out where to hook in.
#157884
Sep 24, 2016 8:04
Vote:
 

@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?

#174492
Jan 27, 2017 12:37
Vote:
 

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.

#174497
Jan 27, 2017 14:26
Vote:
 

Maybe you just think it's unique ;) Since you won't share your experience no one will ever know.

#174498
Jan 27, 2017 14:32
Vote:
 

Maybe so. :) Feel free to ask concrete questions and I'll answer as much as I can.

#174499
Jan 27, 2017 15:40
Vote:
 

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?

I have a background in SharePoint and the way we render a javascript application there is basicly a webpart that points to a index.html (from the SPA project), the .html file is then pointing to the javascript files and they are all located in the "Site Assets" folder on the site.

How would it work on a EPi-platform?

#189048
Mar 09, 2018 11:15
Vote:
 

Hey Anders,

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.

#201028
Feb 01, 2019 23:35
Vote:
 

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.

#201029
Feb 02, 2019 7:24
Vote:
 

Anders,

It would be great if you could share the details of your work in a blog post.

#201068
Feb 04, 2019 16:38
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.