Magento is kicking off an effort on PWAs (Progressive Web Apps, https://developers.google.com/web/progressive-web-apps/). This thread is a place to collect different points of view on how to evaluate options. Please add your thoughts to this thread to share, even if conflicting. I will kick it off with a few of my own, but all views welcome - whether novice or expert.
A number of different people have been experimenting with different technologies already (e.g. React/Preact/Angular/Vue/Polymer/...), which is great and to be encouraged. But at the end we will probably want to pick the best one for Magento based on merit and fit for Magento. These evaluation criteria are to help with this evaluation.
Some thoughts on evaluating a JavaScript stack include:
What else matters to you?
Hi!
Here are a few other evaluation criteria I could gather:
Are you suggestion Magento should add PWA support without standardizing on a frontend rendering stack? Or just saying PWA itself does not mandate a particular stack? They are linked in my mind because I don't see the sense in Magento building in PWA support without also standardizing the render stack and data caching framework. People can always build their own frontend and just use our APIs - go for it! But Magento is planning to providing a PWA app shell and infrastructure including the JavaScript rendering stack. We want to provide guidance for extension developers on how to build an extension and have it work with Magento and other extensions in a PWA for a merchant.
A number of different people have been experimenting with different technologies already (e.g. React/Preact/Angular/Vue/Polymer/...), which is great and to be encouraged. But at the end we will probably want to pick the best one for Magento based on merit and fit for Magento. These evaluation criteria are to help with this evaluation.
there is no best and if Magento chooses something then don't make the same mistake third time and don't choose dying frameworks (m1 prototype, m2 knockoutjs) but instead take another approach on creating frontend component API data structure and communication logic first so each developer could later choose a framework to implement a component that can exist in some ecosystem (in m2 for example).
And for choosing a framewrok to implement their own set of components/themes you can't go wrong with existing uiComponent frameworks (like polymer2 etc) that have development and testing pipelines already worked out and documentation ready + community of devs often bigger than magento developer community + ensured future on framework. Gaining instant documentation and developer availability for frontend tasks is what developers and merchants need the most.
Don't mix this with creating a component system like magento2 uiComponents are , this is painful to learn and no use of learning this cause you can't use those skills in any other project. Getting up to the task with m2 development needs learning of new tools before you can even start whereas developers who happen to know React/Preact/Angular/Vue/Polymer/... could utilise their existing skills and toolsets to chime in and be productive from day one.
If API side is strong both for data access (rest apis) , data processing and component communication side (frontend components) then you are in a position where you don't need to think about building in more caching layers, other tricks cause those will be already solved within frontend application building process.
I was a little confused by the fact that this blog post is focused on selecting a JavaScript framework, as usage of a JavaScript framework is not inherently related to building a PWA. But based on discussions on Twitter, I now understand that the goal is build out a new SPA (single page app) frontend which uses the Magento backend API as a data source (the current "headless" idea). This new frontend would be built with the PWA guidelines in mind, and would pass the PWA "test".
With this understanding in mind, my advice would be as follows...
Hope this helps.
Just one other thought I had on this point...
> Finally I think that process to roll this out needs to be agile / iterative and you need to be open to change your implementation based on feedback from community. If you roll out a huge overhaul in 2.3(?) for the frontend without getting much feedback from community it could turn out that many developers dislike the system / find problems / have trouble working with it.
I'm wondering if it would also make sense to do rounds beta testing with front-end Magento developers as you work though the implementation
Thanks for the feedback.
Yes, would love to see any community feedback based on experiments. Wanted to get the "rules of the game" defined first - how would we evaluate different approaches after some experiments done?
At the end of the day we need to pick one - and it won't be everyone's personal favorite. But the more eyes on it, hopefully the better the choices we can make along the way. But I absolutely agree with "try and learn" in small increments. A part of that is working out the sequencing. Quite a few people now have said, for example, the APIs may be more important than the Vue vs React vs Polymer vs ... decision. The need for server side rendering is another - but perhaps we build in client side only and let advanced sites add server side rendering. I don't know, and agree completely with iterating with community feedback as we go along.
One challenge however is we want to move relatively quickly - try and learn rather than over analyze. The risk is making some wrong choices along the way, but as long as that is understood (and we do our best to correct mistakes) then I would rather move faster than overanalyze. Interesting discussions coming for sure!
Yes, would love to see any community feedback based on experiments. Wanted to get the "rules of the game" defined first - how would we evaluate different approaches after some experiments done?
make a github repo for 3 framework experiments polymer, angular, react implementing the same component data processing lifecycle (get data, build , render, send data back etc)
The need for server side rendering is another - but perhaps we build in client side only and let advanced sites add server side rendering.
Premature optimising, thinking too far ahead etc that's why API is more important cause whatever modern framework you choose has already solved rendering issues (both client and server side)
One challenge however is we want to move relatively quickly - try and learn rather than over analyze.
if you wan't to iterate fast , take current m2 uiComponent structure and remove the overly complete and undocumented component part and just leave the registry and layout system intact and then implement some part of this with different frameworks given that a structure and API is agreed and raise a discussion based on that result