81 points · by punkpeye · 3y ago · 35 comments
Due to the way that RSC hydrates elements during client-side rendering, Next.js has to provide all their property data using JSON (see this issue https://github.com/vercel/next.js/discussions/42170)
As a result, any website that uses Next.js with RSC is extremely easy to extract data from since you can tap into JSON of every element.
Just an interesting observation without implying whether it is good or bad for the ecosystem.
Previously they were rendering it from a REST endpoint which only had the necessary data, but now I get a lovely dictionary of all possible values of various properties, provided on a silver platter.
Another portal I'm scraping uses GraphQL, and they don't have access control, I get all the data they have on impressions, I know how much money somebody paid for listing, I know when the offer is going to be auto-bumped - just lovely. And no need to use Playwright either.
There was a person here complaining that hosting his anime fan site was costing too much.
He just couldn’t understand the concept of not sending the entire dataset to the web page on every page view.
However the entire post is worth reading because other people contributed some good points also.
The Mangadex devs seem to have followed some of the advice and the referenced inefficient JS API call has been made more efficient since my comment, but notably it is still sending many times more data than what is required.
I do not agree that engineers should avoid technical talks with managers. They should just always be prepared to break it down and provide examples. Look people in the eye, empathize with their sentiments, don’t be an asshole if you can help it, in my humble opinion.
If they don’t care about money when you talk about it, well, then that may signal something deeper.
I had this discussion with my friend who runs ArbeitNow. It's hard to create good filters when the data is just paragraphs of text. It's hard to augment these listings when the data is not reliable.
I'm looking for a job, and just started hacking together a job posts database with data scraped from a few aggregators and a couple of specific companies. Currently it's all just local and for myself, mostly raw data with some basic statistics and keyword similarity heuristics.
I decided to try something new and different and take it into my own hands (instead of hoping LinkedIn shows me the "right job").
I'm frustrated by the sheer volume of clearly duplicate job posts which often only vary by the "city" (even if they're 100% remote) and the lack of any kind of basic filtering for programming languages, tech stacks, platforms, years of experience requirements, company industry / size / age etc.
I'm really curious what others who have been doing this for much longer have learned! How do you store your data? How do you process it? Have you eliminated manual cleansing and grooming? So many questions...
Consider the descent down, and the contradictions therein, considering JUST data concerns for brevity:
1. SPA ostensibly being marginally more data efficient by shipping the markup/interactivity first, and fetching only the data as needed.
2. REST being too inefficient and cumbersome in practice, the rise of GraphQL to minimize payload over the wire.
3. Lack of SSR impacting SEO, the need to render on the server and sending HTML over on initial payload. (which btw goes against (1) for first render)
4. Impedance mismatch creeping in, seemingly necessitating the need to send data along with the rendered HTML for hydration purposes (again, going against the idea of saving data over the wire)
I eagerly await, from the sidelines, news from even deeper depths. Perhaps shipping the entirety of the server code that operates then against a local SQLite database? Which is then kept in sync with the authoritative copy "on the edge"? After all, if simple old SSR is beneath consideration, than we would do well to disdain the notion of a boring centralized database as well.
I believe you're describing Blazor: https://learn.microsoft.com/en-us/aspnet/core/blazor/?view=a...
For sure this new circle of hell is emerging. The browser is metastasizing into what resembles an application platform, operating system, a sandboxed virtual machine. It's becoming quite capable too, including a local file system (Origin Private File System), widely supported now.
> kept in sync with the authoritative copy "on the edge"
There could be a new generation of portable, cross-platform and local-first apps built with HTML, CSS, and/or any language that compiles to WebAssembly. Perhaps after decades of penance in the flames of their own making, the web world will find redemption by re-discovering and re-inventing ancient dreams of universal computational media, networked software objects inter-communicating with distributed data..
Speaking like a true denizen of the ninth circle.
Those who can do it for free, do; see e.g. Wikipedia.
More websites could offer a paid API though; stopping to waste your engineers' time on adding anti-scraping measures, and collecting payments from serious actors could offset the possible losses from copycats.
If you are offering a paid API it becomes a product that's most likely very different from your main product you should be focusing on. So instead of deprecating fields, breaking the format and quickly iterating you'll have to version APIs, add authentication, keep a change log for your paid customers, have customer support for your API customers and make sure you are not doing backwards incompatible changes.
Go backend, sprinkle some svelte, call it a day. Serve m/billions with server rendered page without breaking a sweat or over engineering. $24 a month.
I do something similar but with PHP + caching as much as I can, which right now is everything.
I have a site hosted on digital ocean app service. $5 a month. I just pinged it, with times being about 24ms. It must be serving that pretty local. Ooh IPv6 too!
All I did is make sure good cache headers are going out. As a bonus the tech being used here is something you need to know anyway. Whereas with funky tech, you need to learn the funky thing, but you still need to know about cache headers!
I used to host on cheap 1cpu 512mb ram and 20gb SSD. I would be able to handle 7-9k rps.
Now I’m on a bit beefier dedicated hardware doing a few more things. But under simulated load this can handle close to 200k rps.
I made a RSC framework which offers both for you, the html or the data.
Html: https://www.revskill.dev
Only the json: https://www.revskill.dev/?data=true
Want the HTML without the embed json ? https://revskill.dev/?isBot=true
You can see, no need for Graphql, HTML and API seperation.
Your html is the API !