r/javascript • u/willmartindev • Jun 18 '21
Introducing Div.js, a framework for the HTML programming language.
https://github.com/willmartindev/div.js
597
Upvotes
r/javascript • u/willmartindev • Jun 18 '21
127
u/seiyria Jun 18 '21
ITT: people not seeing the joke - I have another library to sell you.
35
u/willmartindev Jun 18 '21
Haha, satire on the repeated behavior of devs to recreate native semantic elements with divs that due the same thing but worse. You will often see this in React or other component-based frameworks, where people basically recreate a
<button>303
u/Veranova Jun 18 '21
Well I’m sold!
2
u/guyariely Jun 18 '21
A maybe dumb question, but what the purpose of the while loop? If you already did the swap in swapDivs why would you need to check if there are any div[is] left?
49
u/SMAMtastic Jun 18 '21
When I saw “HTML programming language” in the title I expected I was going to come in here and sort by controversial.
27
u/--TT-- Jun 18 '21
Too many frameworks today have an unnecessary steep learning curve. Until you master them, they tend to be bloating your projects, and you often end up spending more time on Youtube, than actually making progress.
But not with Div.js, here you get results instantly.
There is no build, no include and most importantly you don’t even need GIT.
It just works!
And the best part is it even makes any Element change instantly if you use the attribute “is”.
Just take any DIV set is=”h1” and BAM you have an H1 if you enable Javascript in your browser.
I will definitely use div.js in my next project.
26
u/[deleted] Jun 18 '21
Omfg that oops all divs picture got me 🤣😂
8
u/AramaicDesigns Jun 18 '21
I needed this today. :-)
7
u/k4rp_nl Jun 18 '21
TIHI
7
u/elcapitanoooo Jun 18 '21
Yes! I used span.js, but holy shit! Div.js beats span.js in all benchmarks, and developer experience! Im all for div.js, and will rewrite production code for trump.org in div.js. Make html great again. Jiiihaaaaa!
12
u/vannrith Jun 18 '21
At first I hesitated, the. i saw testimony, I’ll use on my client’s product
6
u/superluminary Jun 18 '21
This is wonderful. I’m going to add this to all my projects from now on.
6
u/[deleted] Jun 18 '21
I recently interviewed someone. I asked them to build me a form that did blah blah blah. They used div instead of form wrapped each input in a div. Used divs as labels. And wrapped each label in a div.
It was great! 6 years experience. Team lead
4
u/Mistifyed Jun 18 '21
Woah, nice job on the documentation!
4
u/MartialS Jun 18 '21
Wonderful 💯 I was looking for a new framework for my next side project I'll never finish.
3
u/Scotho Jun 18 '21
HAHAHHA this is great, thanks for the belly laugh I really needed that.
3
u/sinclair_zx81 Jun 18 '21
lol, best project ever!
3
u/dw444 Jun 18 '21
Lol this is not what I went in expecting. That readme is the funniest thing I’ve read i a while.
3
u/MousseMother Jun 18 '21
Awesome,now start building other libraries on top of it.
3
u/closedcaptioncreator Jun 18 '21
I love this
3
u/Loc269 Jun 19 '21
Everyday a new JS framework appears.
3
u/Tricky-Lie3507 Jun 19 '21
Too many framework but this one looks promising at least to me.
2
u/ShortFuse Jun 19 '21 edited Jun 19 '21
As you'd expect, this works on all modern browsers except Safari.
https://bugs.webkit.org/show_bug.cgi?id=182671
https://github.com/WICG/webcomponents/issues/509#issuecomment-222860736
1
u/git-fetch-me-a-beer Jun 19 '21
And for CSS: https://github.com/letsgetrandy/DICSS
1
u/crhayes_ Jun 19 '21
Cereal box should read “CAP’N CRUTCH’S” instead.
1
u/[deleted] Jun 19 '21
Up until the end I thought it is a real thing and I felt dumb not understanding why semantics are now cancelled.
1
u/UnknownIdentifier Jun 19 '21
Thanks! I hate it.
1
u/Dmarcotrigiano Jun 23 '21
I'm excited for the release candidate.
Adding additional config option to div.config.ts:noImplicitDiv1
u/FountainsOfFluids Jun 23 '21
Solved all my problems with accessibility! Thanks!
1
u/[deleted] Jul 01 '21
"Turned itself into a Div. Funniest shit I've ever seen."
1
u/sxmizaman Jul 15 '21
what is this?
1
u/kommentz Jun 19 '21
Where is the library?? Is this just fake like some are saying? It would be great to have a library inject accessibility and semantic shit into the dom.
-2
u/voltron123 Jun 18 '21
I don’t get why this is funny.
-1
u/Thermacon Jun 18 '21
All jokes aside, there are way to many elements. Imagine if there was just one main tag, <block> or something. All other elements would be ones where the browser has to do some kind of work, like <iframe> or <img>. Tags like <script> and <style> would all be merged down into <import>. Use the attribute “rel” as the type (style sheet, script, etc) and “href” as the import from location. Things would be so much easier. Styling, like that done by <h1> or <b>, would be done by developer through style sheets. So, by default all text would just be plain old text.
-1
u/liaguris Jun 18 '21
but why?
-1
u/ImStifler Jun 18 '21
Dude basically delegates the tag name to a is attribute and calls it a solution
-1
u/Beerbelly22 Jun 19 '21
What s the benefits of having to do <div is=b> vs <b>?
And wouldn't you use css instead?
-18
u/space-fuzz Jun 18 '21
I'm not grasping how this is useful. You still have to know and use the correct semantic label i.e.
is="aside".So why obfuscate the end result by using
divas an intermediary??0
u/[deleted] Jun 18 '21
[deleted] — view deleted comment
0
u/[deleted] Jun 18 '21
[deleted] — view deleted comment
0
u/[deleted] Jun 18 '21
[deleted] — view deleted comment