by sharkweek · 7y ago · 0 comments
Please, still in 2019, be careful with JavaScript unless you're willing to deal with a lot of uncertainty.
Google routinely says how things are supposed to work, but there are plenty of examples where their crawlers act inconsistent to public statements. To be clear, probably not Googlebot's fault though; we as a species do a lot of weird things when building websites.
Just finished a big project with a client who had a client-side render of their react app for the customer facing website. Googlebot was VERY sporadic with how they were indexing certain parts of the site, and in general, the site lost out to inferior sites in more competitive SERPs. Server side render fixed a lot of this and rankings/traffic jumped.
It's also worth noting that the Bing/Yahoo crawlers (still a notable chunk of web traffic!) can't crawl JS. You can ignore this chunk of market share if you want but someone is going to happily take it.
As a general rule, my advice is always this: Make it as easy as possible for bots to crawl and index your site's content. The more hoops the crawler is jumping through, the worse your site will perform in search engines.
Good, they should just delist client side rendered web pages.
My users don't care how I build it, just that the site works and is enjoyable to use.
If I need server-side rendering I'll still write it with a client-side rendered (e.g. React), but tack on server-side rendering at the end.
You are not building this for yourself if you need to be indexed by google. You need to build in a supported way.
The bigger question is why you think an spa should rank well in general. It's only one page.
This isn't everyone.
The comment I replied to said that Google should "delist client side rendered web pages", which is a terrible idea. Maybe I'm OK with the SEO hit? Maybe I've architectured my SPA so that it can be indexed? (At least to some degree)
> The bigger question is why you think an spa should rank well in general. It's only one page.
SPAs can have multiple pages (despite the name). Check out react-router [0]. Browser history can be manipulated to give the same "back button/forward button" functionality between logical pages. This is done for you by whatever framework you use.
For my use case, having the browser reload every time a page is changed would severely interrupt UX.
[0] https://reacttraining.com/react-router/web/guides/quick-star...
Spoken like someone who hasn't used the web in 5 years.
Filter out poor users by making the site inoperable with older hardware. If they cannot afford current gen i9, they will not afford whatever my ad network is pushing. Increases the conversion rate, so all is good.
Even my grandparents use an old iPad or cheap smartphone.
My machine isn't particularly powerful either - I use an old Macbook.