News for hackers. Stuff that matters.

adamscybot

Re:“You should never build a CMS” on Sunday December 14, 2025 @03:15AM (#46261586)
The point about CMSs having value in possibly being a more real-time collaborative UI layer to interact with that's less-scary for the average Joe is a valid driver; and is a critical factor for many use cases. But the the other stuff is clearly reasoning with a solution already in mind...

"All blog posts mentioning feature Y published after September...[more examples]...The three most recent case studies in the finance category...[etc]"

Fairly simple queries. If you're willing to build an MCP server (as they did for their solution), you could just as well build one that reads structured front matter.

"You can't. You'd need to parse frontmatter, understand your date format, resolve the category references, handle the sorting, limit the results. At which point you've built a query engine."

Well that's a scoped problem. Looks like it already exists (e.g., https://markdowndb.com/) and doesn't require moving away from Markdown files in GIT if you want.

Or use something like content collection in astro (https://docs.astro.build/en/guides/content-collections/). Hell, looks like that lets you have the MD files somewhere else instead of git if you please.

The AI-generated points aren't as compelling as the prompter thinks. A new common problem.

Yes, you don't need flatfile-committed raw text for AI tools to work properly, in part because of things like MCP servers. Yes, semantically linked content with proper metadata enables additional use cases.

The next point to make would be "if you use our thing, you don't need to think about this", but instead goes into a highly debatable rant about markdown in git not being able to fulfil those additional use cases on a practical level.

This distracts from the what I imagine is the real intent: "git and markdown files don't come automagically with a snazzy collaborative UI. And yes you can still use AI, and use it well out of the box. If someone tells you you need markdown in git to do x,y,z with AI they are wrong."

Personally, I can get over the "AI writing style", but only if the content still nails the salient point...

Re:Ink: React for Interactive CLI Apps on Friday November 01, 2024 @05:13PM (#42021609)
One language that comes to mind is ReasonML. It doesn't have runtime checking. It's structural and compile time, but the guarantees are supposedly cast iron. https://reasonml-old.github.io/guide/language/type#design-de...

    type thing = 
      | String(string)
      | Bool(bool);

    let arr: list(thing) = [];

    let add = (item: thing, dst: list(thing)): list(thing) => {
      switch (item) {
      | String(s) => dst @ [String(s)] 
      | Bool(b) => dst @ [Bool(b)]    
      };
    };

    let newList = add(String("asd"), arr);

This doesn't work, since the dst array has to be one that can contain both string and bool in the first place.
Re:Ink: React for Interactive CLI Apps on Friday November 01, 2024 @04:03PM (#42020967)
The "should we use node for the core business logic for my use case" thing is absolutely valid and depends.

But you'd be surprised about the "react for the front end of the CLI" part. I used this thing a whole six years ago in a complex interactive CLI and it came off great to use, maintainable and ergonomic. React is just one framework that proscribes to the "UI as declaritive/composable trees" pattern. And that UI doesn't have to be web based. That pattern works for all UI's I've come across.

Its the pattern that is a good reason to do this. And not react/js landscape. That part is probably a bonus for many though.

Re:Ink: React for Interactive CLI Apps on Friday November 01, 2024 @03:57PM (#42020894)
Odd to see this come up. I used it about 6 years ago to produce a CLI for devs. It worked very well and React concepts map cleanly to pretty much any "UI" target as said targets can also be well represented by declarative & composable trees.

Probably, other Ui frameworks could also map, seeing as the declarative/composable tree pattern is ubiquitous now. So it's important to note it's that pattern which enables this, and not a specific framework.

But React is one of the ones that is also more removed from the web target than others.

Re:Ink: React for Interactive CLI Apps on Friday November 01, 2024 @03:43PM (#42020770)
If you are used to structural typed systems though this actually "feels" expected. Don't get me wrong, I know where you are coming from. But the realisation comes from nominal systems, which are different beasts. As long as it actually evaluates to the expectations in the head of the developers using it, then that's okay.

However, regularly it's not the case -- especially with people moving from nominal systems.

TS can't really be practically nominal when it has to be constrained by its compile target. So I guess it ultimately boils down to an anomaly/criticism born from the legacy of how web standards came about.

Re:Apple's Hidden Social Network on Sunday August 06, 2023 @12:05PM (#37023347)
Interesting internal comms along these lines from 2013: https://www.techemails.com/p/imessage-for-android
Re:Don't use Tailwind for your Design System on Wednesday January 11, 2023 @10:12AM (#34339276)
Right, huge +1 for Chakra. Chakra is basically tailwind but built on react primitives. It feels lot cleaner, and solves most of the issues mentioned.
Re:GitHub Outage on Tuesday September 06, 2022 @07:56AM (#32735882)
Its back
Re:GitHub Outage on Tuesday September 06, 2022 @07:50AM (#32735819)
In my experience its often the case the status site does not reflect reality -- until someone intervenes.
I know about CSP and iFrames, but I think they aren't ergonomic enough to be used as mechanisms to restrict deps right?

Iframes need a full web context whilst CSP cant target individual code blocks. For example, I might want my code to be able to do alerts, but I dont want dependency x to be able to.

EDIT: Ah I think thats what you meant by your "code in a sandboxed iframe thing". Fair.

TBH I think its not because JS somehow fundamentally attracts a different group of people, its probably more like:

- It being web based means you can target this kind of software for maximum "impact"

- NPM dep trees are massive and you generally have thousands of tiny libs. The chance of something like this happening and being noticed goes up therefore.

- NPM ecosystem is a bit more wild west which again leads to increased chance of something like this being able to occur in the first place.

The web needs APIs that enables certain blocks of codes to run under specific permission constraints. Such constraints might include ability to read/write to DOM; window.alert; redirecting (well I guess CSP covers that one) etc. At least let us mitigate it.
"Depends". The benefits of leaning on open source pays off the majority of the time. Are you exposed to more risk? Yes. Does that mean you shouldnt take that risk? Not really. Otherwise you'd struggle to move quickly and be competitive.

Of course certain things change this balance. Hopefully nuclear power plants dont have NPM in their toolchain. And I believe financial orgs already have quite heavy auditing of dependencies.

Amazing! I always wanted Everything + deeper OS integration and this fits the bill.
Perhaps give it another try, but with TypeScript. Im a front end dev and yes, I feel the JS pain. I look back at how I used to do things and think "wtf". TS completely changed this and brought it back to sanity.
I think esbuild is basically already doing most of what Rome promises
People are talking the other points to death but on the toolchain front, you might enjoy https://github.com/evanw/esbuild, which is rapidly gaining in popularity. Just 1 thing for bundling, transpilation etc. And its terrifically fast since its written in Go (ironic I know).
Re:Best practices for REST API design (2020) on Monday February 22, 2021 @01:31PM (#26228306)
What if you need that set of read/write operations to happen in one database transaction?
Re:Best practices for REST API design (2020) on Monday February 22, 2021 @01:29PM (#26228279)
One thing people havent mentioned as well is the importance of mutations. Querying is only one side of the story.

Your API should match semantic actions on your client like the UI and it needs to do this in such a way that it happens in one database transaction.

With REST, new UI requirement that needs to save 2 objects together across multiple entity types...? GG.

Re:Best practices for REST API design (2020) on Monday February 22, 2021 @01:20PM (#26228120)
Yep. OpenAPI spec is not rich enough to represent relations like this so its rubbish for FE dev to use to generate models/api client.

In general, the tooling/spec has thousands of open bugs, isnt going anywhere, moves very slowly and is missing fundamental features.

https://github.com/OAI/OpenAPI-Specification/issues/1998 heres the ticket where it will inevitably be ignored and die. But even if it was supported in the spec, the open source generators wont support it anyways.

Said generators also uses "logic less" templates to generate something that very much needs logic. As a FE dev, I love nothing more than to fork a an archaic Java based generator to get the client gen working...not.

Re:Best practices for REST API design (2020) on Monday February 22, 2021 @01:13PM (#26228001)
Yes and by doing so you lost the advantages of a predictable and well organised API.

GraphQL has first class support for this scenario.

Re:Best practices for REST API design (2020) on Monday February 22, 2021 @01:11PM (#26227974)
If you're a front end developer the advantages a clear because of much superior tooling. The reason for this the agreed SDL spec format which is part and parcel of GQL. REST is just a loose collection of ideas and OpenAPI is not integral to REST as theres no single over arching spec of organisation for REST.

In my experence therefore, the tooing (code gen, doc gen) etc around OpenAPI is piss poor in comparison to gql. Just look at GraphIQL compared to postman.

Yeh, those are good. Though they seem to have appeared shortly after the Dyson blade dryers. Dyson seem to have shaken the market a bit into realising you actually need power in these things for them to be useful.
> How would they make any money off the App Store in a future where all apps are streamed bypassing their system all together?

Yes I agree, I think this is the answer. Video streaming is allowed since they already lost -- no one wants to download the whole video as an app first because the experience would suck.

That's not true of games...yet. They are scared it will be. As an enthusiast, I'm a little scared too!

That's not the case. It literally is sending user input to the server, where the game is running, and then you watch a video back. That's the base technology that underlies every single gaming streaming service (to date, at least).
By this logic, why are any video streaming services like Netflix, YouTube and Amazon Prime allowed on the service given they cant audit every video?

It's exactly the same logic.

Re:Ask HN: What Happened to GitHub's Atom? on Thursday October 03, 2019 @04:16AM (#21144780)
To be fair to VSCode it's the most slick and speedy electron app I've seen by miles. I forget often that its backed by it.
Re:Migrating to GraphQL: A Practical Assessment on Thursday July 04, 2019 @04:47PM (#20357655)
That essentially means you are still overfetching underneath the hood but yeh -- for me the benefits are in its ergonomics anyway. The whole under/overfetch thing is overstated.
Re:Migrating to GraphQL: A Practical Assessment on Thursday July 04, 2019 @04:44PM (#20357639)
I've found it reduces complexity in your app code (at least on the front end). You basically have no or extremely minimal data fetching logic where as with REST you often find yourself making more requests in response to other requests. I.e to traverse relations. GQL Gives you that for free.

Also the tooling is next level . GraphIql alone is miles ahead of any REST tooling offerings. Also, typescript generation. Truly improved my workflow.

Re:GitHub Package Registry on Friday May 10, 2019 @07:15PM (#19883162)
You configure the NPM client on what your primary registry is. I think this github repo will mirror everything on NPM (?).

Older »