When building websites for small businesses, I face two extremes. But only me, as a programmer. Users do not collide, because you cannot face something that does not exist for you. The first extreme is when a client buys another hosting for Wordpress for $ 50 per month. A person does not know that special hosting is not needed for Wordpress, that such special hosting is usually worse than regular hosting and contains a bunch of restrictions and is more expensive. The second extreme is when using the JAM stack for the sake of economy. But this is economy in the bad sense of the word, when you save on matches, using a generator to power the soldering iron from which you light a cigarette.
Officially speaking, the JAM-stack- Javsacript, API, Markup, in general, a static template filled with data on the client via API using Javascript. In simple terms, the JAM stack is a bunch of crutches, the use of which will go badly for everyone, and above all for the developer. Technically speaking, a JAM stack is an integrated crutch system for building static sites, using SAAS for data hydration and persistence, and a lot of client-side rendering. How did the grandfathers do static sites in their youth? They wrote simple HTML and CSS files and put them on FTP hosting. How did our fathers make static sites during their wild youth? They used Jekyll / Octopress, or any of hundreds of static site generators, and the resulting HTML and CSS files were uploaded to github pages through a commit, and they linked the desired domain.Some then still arranged games with Disqus, because I canβt name it in any way other than games, because a user with a Disqus account to leave comments on your site is vanishingly rare.
In terms of price / time cost / complexity of support / development constraints, this was all a good option. When it ceased to be a good option, they bought hosting with php for a couple of bucks a month. Static pages were mocked up and acquired a solid functionality of a full-fledged site. And everything was fine, but Yenisei was made from light beer. But our great ancestors found a normal job and no longer suffer from such garbage. Now we suffer from it, and what can the industry offer to us, young, funny, for whom everything is easy? She proudly coughs blood in our face with a JAM-stack, and says: "You won't wait!"
JAM stack is the newest approach to building static sites, and Gatsby.JS is one of its prophets. Gatsby is the brightest representative of the genre, raising the ridicule of the idea of ββstatic sites to the absolute, thus translating it into the category of postirony. For starters, Gatsby is built on top of React. The same React that was created for sites that need a component-based approach, i.e. there are some user interfaces, i.e. there is data manipulation. But we have a static site, right? No? Retrograde answer! Now this is not a problem, we have services like Netlify and Contentful. They provide you with an API to make AJAX requests to their servers and receive or write content. Those. the usual database accessible through the thirtieth ass. But it's free. The first N requests, or users, plus the blob size limit.Promotion: meet all the restrictions and get paid from the customer * (* the number of attempts is limited).
Why, at first glance, does it look attractive for business? Because everyone knows React, and there are a lot of Reacto-macaques that yesterday were able to enter IT and are ready to work for a penny. For Reacto-macaques, this is attractive because there is at least some way to raise money and fill a portfolio. And sitting by your mother's neck you can literally not pay for hosting or for the base. For the same reason, a hesitant customer can, after seeing the result, figure out whether he needs it at all, and stop responding to the messages of the would-be freelancer. Also, the customer and the contractor are united by a rather small competence, where the first does not understand how all this works in general, and the second does not understand that sites can be done in another way.
As a result, with rare exceptions, about which later, everyone loses. React and its derivatives are a complex tool with a large ecosystem and huge challenges that are often only tackled by React programmers, not React monkeys. 10 years ago there was a popular circus act called "pull out a menu with all submenus in one SQL query". Now we have his ideological successor - to pull all data from the required service through one GraphQL request. Gatsby pulls more than 500 dependencies along with it, and knowing the speed of the JS ecosystem update, we can safely say that in six months something will break if you need a new third-party widget. After 2 years, you will be cheating versions just to rebuild this miracle into a new release. I'm kidding, just kidding! It may not be collected for the first time according to the instructions from the site.If Roskomnadzor, in another burst of concern for citizens, blocks your serverless database server, or simply changes the tariff, then you have to have fun with all this again. By the way, unlike traditional static sites, build a site on Gatsby! == site sources. So the strategy of backing up and deploying this miracle, including the database, and even without it, is very interesting. But the very pulp will begin if the freak created by schoolchildren on crooked technologies needs to be developed. Believe me, PHP has a much lower upper limit for legacy code bastardness, no matter what they say about it!So the strategy of backing up and deploying this miracle, including the database, and even without it, is very interesting. But the very pulp will begin if the freak created by schoolchildren on crooked technologies needs to be developed. Believe me, PHP has a much lower upper limit for legacy code bastardness, no matter what they say about it!So the strategy of backing up and deploying this miracle, including the database, and even without it, is very interesting. But the very pulp will begin if the freak created by schoolchildren on crooked technologies needs to be developed. Believe me, PHP has a much lower upper limit for legacy code bastardness, no matter what they say about it!
For you, as a novice developer, it is not profitable to use the JAM stack for commercial projects. Firstly, static sites with minimal functionality are the very bottom of freelancing with everything that comes with it and smells bad. Second, the JAM stack is a direct cost savings for the developer. You will be wasting your time to compensate for the curvature of tools and services, which does not depend on you and to deal with which you have little experience. The one that you get here will not be useful to you any further, because paying customers will be able to pay you at least a normal hosting.
So what then is the right use case for the JAM stack in its modern form? In my opinion, this is a situation when your fairly adequate acquaintance or relative asks you, a React programmer who has a normal high-paying job in your profile, to make a relatively simple site in your spare time. And you can use existing skills to do this quickly, while explaining to the person all the disadvantages of this approach. And if he agrees, then go ahead. Otherwise, just tell him about Wordpress and wp2static.
Criticism and objections are welcome. But please indicate the cost and number of projects that you have done Gatsby, Next.