aeternity / mdw-frontend

https://explorer.aeternity.io
Other
4 stars 3 forks source link

Enable Server side rendering (SSR) #136

Open davidyuk opened 2 years ago

davidyuk commented 2 years ago

was disabled in https://github.com/aeternity/mdw-frontend/pull/84 also doing

$ curl https://explorer.aeternity.io/account/ak_jupBUgZNbcC4krDLR3tAkw1iBZoBbkNeShAq4atBtpFWmz36r

I don't see actual page markup as it should be with SSR enabled. SSR is needed for:

why are using Nuxt after all?

marc0olo commented 2 years ago

why are using Nuxt after all?

I heard that question now multiple times. actually we currently just try to display as much info as possible which was missing before.

so far we didn't find the time to improve these things. feel free to provide a PR if you wanna fix this ;-)

davidyuk commented 2 years ago

This is mostly a deployment issue (cc: @mmpetarpeshev), from the code side we need just to revert the mentioned PR

mmpetarpeshev commented 2 years ago

@davidyuk Not sure that I understand the issue here. What is the deployment issue ?

davidyuk commented 2 years ago

Can we setup the deployment of mdw-frontend in SSR mode? We need it firstly for staging because some stuff may be broken now.

marc0olo commented 2 years ago

@venimus what was the reason for disabling it in #84?

venimus commented 2 years ago

It is hosted as a static site. I think nuxt is a leftover before refactoring. I think it is still possible to build with nuxt anyway, just we don't do it for over an year.

marc0olo commented 2 years ago

I need to recall this topic. it's still confusing for me.

@davidyuk does SSR make sense for this application? in what form did we use it for the things you mentioned above? from my perspective I am not sure if we need indexing of search engines. what could be cool of course is the rich preview in social media. not sure if the faster rendering time is that important for this application.

@venimus what was the reason for disabling it?

general question:

davidyuk commented 2 years ago

does SSR make sense for this application?

I think it is worth maintaining it. Also for educational purposes, to estimate is it useful to have SSR in other projects, to have devs that know how it works in Nuxt.

in what form did we use it for the things you mentioned above?

I don't know. It was implemented explicitly in https://github.com/aeternity/aepp-blockchain-explorer/issues/490 and related tickets, but I can't find any reasoning, probably it somewhere in old chats.

if we need indexing of search engines

I've tried to google my Ethereum address, and I got its details on etherscan.io, googling my ae address I got only aeknow.org. Ability to google it looks useful for users not familiar with the concept of blockchain explorer.

if we decide to drop SSR, should we also get rid of nuxt?

would be better to use the same tool in different projects (vue cli), but it is not necessary, moreover, we might decide to enable SSR later

venimus commented 2 years ago

@venimus what was the reason for disabling it?

because it does not really make sense for the app, all the content is dynamically rendered. However the explorer is/was hosted as static site, there is no "server side rendering". In addition the SSR option in the config in fact simply prerenders static versions of all the urls, which results in prebuilding a snapshot of all transactions, which is insane in terms of building time and disk space. Until things change conceptually for the app it simply cant use SSR.

davidyuk commented 2 years ago

I'm not sure how it is configured now, but above I was taking about rendering on server side by request, prerendering is not needed

venimus commented 2 years ago

Yes, I get what you mean, I just want to elaborate that the option i turned off is not related to what we are discussing. I’ll check with Petar to see how we can host it so SSR works and what would be needed to be changed

marc0olo commented 2 years ago

@venimus please don't waste time with this right now. we're re-implementing the explorer and when the time has come we will come back to this issue.

venimus commented 2 years ago

Sure, it’s just in a discussion state still