News for hackers. Stuff that matters.
Re:Things I wish I knew before moving 50K lines of code to R... by Illotus on Friday September 01, 2023 @01:48AM (#37347272)
I guess you use what you are familiar with, but using react for doc site instead of using some off the shelf static site generator/cms with caching seems like wasted effort. More fun from dev point of view with react no doubt.
Re:Things I wish I knew before moving 50K lines of code to R... by Osiris on Friday September 01, 2023 @02:11AM (#37347408)
I agree. It’s static content. Why isn’t it just generated as HTML with some JS for the search bar?
Re:Things I wish I knew before moving 50K lines of code to R... by ojkelly on Friday September 01, 2023 @04:45AM (#37348287)
Great doc sites are dynamic in heaps of little ways. Stripe started the trend of showing you code snippets with api keys from your account to test with.

Frontend docs sites almost always include runnable examples, that you can play with inside the docs.

Re:Things I wish I knew before moving 50K lines of code to R... by yard2010 on Friday September 01, 2023 @06:02AM (#37348765)
You can use a static site generator like Gatsby or a variant of Nextjs (or even docosaurus), get MD(X) support and full features of react components when needed
Re:Things I wish I knew before moving 50K lines of code to R... by junon on Friday September 01, 2023 @06:15AM (#37348856)
You can get dynamic functionality for docs sites without much JS at all. We've been doing it for years.
Re:Things I wish I knew before moving 50K lines of code to R... by satvikpendem on Friday September 01, 2023 @05:29PM (#37356381)
It's easier to integrate JS when the entire toolchain is all in JS. That's my main reason for using React Server Components over other static site generators. Also I like types via TypeScript.
Re:Things I wish I knew before moving 50K lines of code to R... by rrdharan on Friday September 01, 2023 @06:54AM (#37349115)
> Stripe started the trend of showing you code snippets with api keys from your account to test with.

Pretty sure Google started / had this years earlier (before Stripe even existed?). And there may have been others earlier as well.

Re:Things I wish I knew before moving 50K lines of code to R... by skippyboxedhero on Friday September 01, 2023 @06:54AM (#37349112)
It is statically generated. The reason to use React is so you have one language across the front-end rather than having some people using React on one site, and then people using Gatsby/Hugo for something else. Next.JS can do the same thing as Gatsby/Hugo but has more features and is in React.
Re:Things I wish I knew before moving 50K lines of code to R... by Swalden123 on Friday September 01, 2023 @07:48AM (#37349572)
Gatsby is in react
Re:Things I wish I knew before moving 50K lines of code to R... by JackFr on Friday September 01, 2023 @08:18AM (#37349814)
“This group over here uses a hammer to smash their fingers while this group is still slamming car doors on their fingers. We’re trying to get everyone on the same platform.”

“Doesn’t it hurt.”

“You don’t even notice it after a few weeks.”

Re:Things I wish I knew before moving 50K lines of code to R... by satvikpendem on Friday September 01, 2023 @05:32PM (#37356403)
Then what is an actually good example in your analogy? I don't see how using a static site generator is anything like smashing your fingers, seems like a common enough solution to me.
Re:Things I wish I knew before moving 50K lines of code to R... by Cthulhu_ on Friday September 01, 2023 @08:41AM (#37350075)
But you don't even need to know what language your tool is written in if all you want is a static documentation site.

This is a problem a lot of people have; they think in technology instead of actual problem solving. Just look at how many projects have been posted on here with a title like "$solved_problem... in Rust!" as if Rust makes everything better forever.

It's marketing bullshit. It's self-gratification. It's using a technology for technology's sake, not for solving a problem. And it's costing the industry billions in sunk cost, dead ends, overcomplicated and unmaintainable software. Because one guy felt strongly about a language or technology.

Re:Things I wish I knew before moving 50K lines of code to R... by satvikpendem on Friday September 01, 2023 @05:31PM (#37356394)
> But you don't even need to know what language your tool is written in if all you want is a static documentation site.

Not if you want interactivity in certain parts of the doc site, such as what Stripe does with API keys. It's simply easier to add JS if the entire toolchain is JS.

Re:Things I wish I knew before moving 50K lines of code to R... by Cthulhu_ on Friday September 01, 2023 @08:38AM (#37350050)
> More fun from dev point of view

This is the curse of software developers and employers everywhere tbh.

Re:Things I wish I knew before moving 50K lines of code to R... by rpbiwer2 on Friday September 01, 2023 @10:15AM (#37351127)
I hear this all the time and I don't understand it. Bootstrapping a new project with <insert modern framework here> is so easy and fast, literally easier than bootstrapping a vanilla HTML project. What am I missing?