Technology stack evolution for Reader UI #11377
Replies: 6 comments 16 replies
-
Requirements
|
Beta Was this translation helpful? Give feedback.
-
Hmm, I should have separated my comment in pieces to avoid cluttering the UI haha
I understand, I don't have anything against it, it's just needed to ensure the community is ready for it. I've created a document with a bunch of ideas in ~2020 and this was one of the ideas: Replace Smarty by Vue everywhere: the flexibility of delegating the data gathering to the client (Vue) through APIs is interesting... A pain point is that server side rendering Vue components with PHP is risky/limited (V8 extension for PHP, spinning up a Node instance, emulation), which isn’t great for SEO... So, how well are search engines at handling dynamic content these days, given that we also could feed JSON-LD/metadata content while the client is “building” the interface? I don't have anything more to comment, I'll wait for comments from others 😁 |
Beta Was this translation helpful? Give feedback.
-
Just to remind that node.js is single-threaded and therefore the main bottleneck for SSR (see also, https://inertiajs.com/server-side-rendering , chapter Clustering - I'm not sure if that would be a virtual clustering or a clustering based on the available CPU cores). SSR is a topic which also bytes DSpace repository installations which have to face huge traffic from AI bots. Usually, you would need a multicore cpu and a process manager such as PM2 to run several node.js processes. Not all existing installations would have such a setup and you would limit upgradability to institutions that can afford such an environment. With regards to custom themes. Maintaining custom themes (even if derived from the Default theme) between upgrades is a major task for institutions that host multiple journals having their own branding. Separation of content rendering (templates) and representation (Less, CSS) should stay as is - but of course the two are connected via the general layout of a page and through its CSS classes. So, if you replace the template engine (and the templates), don't break the current layout (structure of HTML) and CSS classes! Introduce changes only slowly and iteratively, i.e. when changing the major version. My general recommendation would be that you carry out a survey among PKP users on the following topics
This would give you a better picture for planning such changes. For me it is essentially about not leaving a majority of installations behind. |
Beta Was this translation helpful? Give feedback.
-
Jarda, I am glad that you have raised a debate with such deep implications because you made me think that everything is possible... and at the same time, listening to you, my legs are shaking :-P First thoughts in telegram style until I have time to sort out ideas:
In short: I see many possible projects (JATS-centric-workflow, telemetry, API, SEO, translation management, caching, issues with reverse-proxies,...) that I think are more necessary for our community than changing our stack to improve the UI/UX. I'm also afraid of the implications of changing our stack (in terms o IT teams), so my suggestion would consolidate our upgrade tooling first, expand with community requested features, and then refactor if we still think is required. |
Beta Was this translation helpful? Give feedback.
-
Thanks, all, for the excellent commentary. I do think we'll find server-side NodeJS to be too scarce and problematic for our community at large, though I don't have solid facts to back up that superstition. (I do have a few commodity accounts on a2hosting, for what it's worth, and they don't include NodeJS.) @jardakotesovec, if you're convinced that this is the best technical approach, we could consider a survey or something more reliable than my suspicion. I think the hard parts of server-side rendering are mostly related to performance, and I don't find that a compelling technological driver for us. Most OJS/OMP/OPS users are not performance sensitive because they run relatively small collections, and for those who are, basic optimization work (as we're doing with submission lists in 3.5) will still give us the best bang for our buck before we start getting exotic. Even then, we can practice good citizenship with headers and Replacing Smarty motivates me. Smarty is an increasing tech risk, and never had fantastic community uptake. Almost nobody working with OJS theming has ever had to use Smarty before or ever will again. Moving to Blade further unifies us within the Laravel ecosystem, which we've invested heavily into adopting. I suppose Laravel use doesn't preclude us using SSR tools -- e.g. Spatie's SSR library, which has a Laravel bridge -- but that feels exotic and a big dependency risk. As the Spatie SSR project says well,
We're PHP and increasingly Laravel, for better or for worse, and I'm not convinced we have a compelling need to break the front end out of that mold. ETA: Linking #11336 to this discussion, as it's relevant particularly to the caching headers / squid part of the above. |
Beta Was this translation helpful? Give feedback.
-
Totally agree with this question from @nils-stefan-weiher . In addition to maintainable burden, double SSR, SEO issues, complexity for community plugin and theme developers, this adds also the problem of refreshing the content. There may be arguments, that pre-rendering can be archived, but for that, I think that can be a institutional choice and the Server-Side generated sites can be still archived easily using simple technologies. May be I missed that, is there any requirement list publicly available, where the necessity for vuejs for reader ui. I have not seen so much requirements for interactivity in reader. Therfore , I would prefer a Balde+PHP and tailwind css based solution a lot better than having VuesJS and all other related vueJS libraries like piniastore. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Everyone,
please join me in this interesting exploratory topic on how to shape our technology stack (or maybe stick with our lovely Smarty templating system forever). This will be solely focused discussion on the templating+interactivity part. Leaving styling aside, as thats good topic to explore separately.
As we all know, we adopted Vue.js on editorial side to build new UI couple years ago. Its well justified there to be able to create more bespoke and interactive UI. But on reader side we still heavily rely on the Smarty templating system with some jQuery on top of it.
We are exploring opportunities to at some point work on next generation default theme, we are also looking whether that might be opportunity to modernise underlying technology stack.
Requirements
Please challenge this topic. And ask hard questions. Also provide your suggestions. In this first part I focused quite a lot on the SSR requirement. But happy to follow on the other requirements in details as well, but did not want to make it too long.
Options
Blade + ?
Blade is default Laravel templating framework. With modern and clean syntax. But its running on the server and does not help with any interactive elements. Common solutions is to use htmx or alpine.js or livewire libraries on top of it to handle the interactivity. Works great for simple use cases. But would not want to build more complex features, like public commenting. Alpine.js has also some basic headless components, but the docs are behind paywall.
Therefore we would be likely looking into mixing Blade and Vue.js. We already have mixed experience with that approach from mixing Smarty and Vue.js on editorial side. Its possible and very useful for gradual migration, but needs to be done carefully and it requires developers switching between two distinct frameworks, which have very big overlap. There is lots of decision making between what to render with Blade and what in Vuejs.
Vue.js
Vue.js can do everything - not just generate html, but also handle any complex UI interactivity. "Only" challenge is the SSR with PHP server :-).
Running Node.js process in addition to PHP is obviously concern. It needs handle some load. It needs to be properly configured. So thats for sure possible (https://inertiajs.com/server-side-rendering), but its significant operational burden.
As @jonasraoni reminded me, that even in PHP constantly keep rendering all the reader facing pages is not optimal. I realised, that maybe we could use Node.js in a way so its not that big of the operational burden and generate pretty much all the content (articles, issues, static pages) as html pages on the background. And php server can just serve html pages, where vue.js would handle both the pre-rendering but also the interactivity in browser once its loaded.
Here are some point which hopefully helps you to imagine how it would work:
So basically if we would be willing to accept Node.js as requirement for next generation theme and keep current themes as fallback for users which have limitations on that, we could use Vue.js across the whole OxS ecosystem, without mixing in bunch of other things.
My understanding of the hosting ecosystem is limited. So I asked chatGPT to search the node.js support across different hostings. And its conclusion after couple of minutes was:
With this overview:
Is there other compelling option I missed?
Beta Was this translation helpful? Give feedback.
All reactions