Live data from Hacker News

RawJS is a better way to call document.createElement()

squaresapp.org

41–50 of 135 posts

Re: RawJS is a better way to call document.createElement()

#41

Earlier quoted context omitted.

When you click links it changes the URL, so the back button takes you to the previous URL. I absolutely hate when pages hijack the back button, but this ain’t it.

I mean, it’s not a dark pattern hijacking the back button, it’s a bug hijacking the back button. It’s still a bad experience, though.

It's not hijacking back like it happens with some sites that redirect and such. It's just pushing each color into history.

Re: RawJS is a better way to call document.createElement()

#42
> RawJS is a better way to call document.createElement().

React is a way to reduce calls of document.createElement using virtual DOM, ie using React.createElement. It’s JSX which is supposed to be a better way to call document/React.createElement. So what exactly does this compete with?

Re: RawJS is a better way to call document.createElement()

#45
Can someone explain these bullet points from the sample repo? [1] They seem contradictory, but maybe there's some esoteric definition of "builds" that I'm missing.

> - No bundler, no build system. Near-zero complexity.

> - TypeScript builds your app in milliseconds, even if your app gets huge.

[1] https://github.com/squaresapp/rawjs-sample

Re: RawJS is a better way to call document.createElement()

#46

Big claims and zero code examples? No I'm not going to go digging in a repo without so much as a top-level overview of the approach

Even worse, their "Check out Squares" link takes me to https://github.com/squaresapp/rawjs-sample The live sample of that is not very impressive. And even worse: > These are the limitations you need to accept with this project structure: > You have to be disciplined to only use dependencies that are published on jsdelivr (npm install programmers need to clean up their act) That with a package.json which has dependenc…

my reading on the "limitations you need to accept with this project structure" is that those limitations are about this particular project structure, not on rawjs itself; i.e. my understanding was that you can also write a project using rawjs using normal ES modules and plain JS (as mentioned briefly in the main rawjs github repo readme).

that said, I do agree that pointing to a highly opinionated example project is a bit confusing

Re: RawJS is a better way to call document.createElement()

#47

Big claims and zero code examples? No I'm not going to go digging in a repo without so much as a top-level overview of the approach

The sample repo is at least well-commented. I've taken the liberty of pasting some of the sample code here, sans comments, so we can see what the code style is like. My editorial take: no thanks. This looks less declarative than jQuery. If this is the alternative, then yeah, you still probably need React (or Vue/Svelte/Astro/whatever) namespace App { export class SegmentedButtonComponent { readonly head constructor(.…

...yuck. The hilarious part to me is that every single thing this does could be done in one line of an angular template with massively less typing and opportunity for error. just a:

Like, I know you want to create an element and blah blah...but if it takes your dev 4x longer to write it, why are you doing it? Ultimately, in the real world, all of this is devs trying to make bragging rights for reasons with no real commercial viability intended. As much as we like the idea of less JS frameworks and all that, there is a reason why every major company uses them - they allow people to make business-impacting changes and features faster.

What is really funny to me though is that it is even an awful example - you should never use a div as a button, it is an accessibility nightmare. That is telling.

Re: RawJS is a better way to call document.createElement()

#50
post #36

"No known bugs" is not the brag that they think it is. It's like someone peddling a medication and saying, "No known side effects."

Author(s) of this may be the type of people to not use a library because it has a lot of open github issues
Post reply on HN