DID YOU KNOW? 😨😱
👉 using DOCTYPE is TERRIBLE 🚨 for PERFORMANCE and SIZE!
😌 Instead use LOWERCASE, because it's smaller your page will LOAD MUCH FASTER
#react
#javascript
#webdev
This sucks so much 🥲Bun just keeps digging its anti-interop hole deeper and deeper. If you ship this, people will definitely start using it, and itll break a bunch of tooling that reads package.jsons
For those of you who are out of the loop and looking for context, this is Ljharb's handy work. He's the reason your node_modules are bloated, and does this to many popular packages, inflating downloads for many of his other packages.
He does this under the guise of "robustness" and backwards compatibility (going so far as supporting node 0.4), but he also has a monetary incentive for getting as many downloads as possible, because tidelift pays him out for it.
devs: classes for components are ugly, functions make so much more sense, Ui iS a FuNcTiOn Of StaTe
also devs: here's a 5 part tutorial series on how to correctly use useEffect
DepTree is turning out to be really cool. Enter a package name and it shows you all the dependencies that package has and whether or not they have unnecessary deps that can be replaced, and what to replace them with! (based on )
"I found a bug"
Great, I recommend creating a minimal reproduction, and a clear, written explanation of what the actual behavior and what the expected behavior is
"can we connect on a call"
I recommend creating a minimal repro ...
"i made a video"
I recommend creating a ...
My trust in Safari wasn't very high for obvious reasons. The improvements they made in the past year or so were nice, but long overdue. But now I've just lost *all* trust in Safari, and I just can't take it seriously at all anymore.
We got a small group of people don't some amazing work here, but we need more. The codemods are very easy to implement, even if you've never implemented one before! One codemod only takes about half an hour (max!) to implement, theres just a lot. If you want to help, link below
I believe it's extremely important to speak up about things that you disagree with, because it may resonate with other people and lead to change. Sometimes it wont, but sometimes it does. In this case it has already lead to multiple great PRs to remove bloat, as well as this:
DID YOU KNOW that the browser comes with a built-in state manager? 🤩 It's called the `globalThis` object!
#free
#javascript
#tips
#techfluencer
5 Other TOP javascript tips:
👇🧵
I like how react went full circle with hooks, making you read 5 essays to truly *get* hooks and their rules, only to circle back to introducing a new hook thats not quite a hook and doesnt follow those rules with the most generic and hard to google name
I love how every time the ljharb drama happens, it *does* have a positive effect; people become more aware of the package bloat, and start improving their packages. Thats all I can ask for.
I was building a little SPA with js and client side routing when I realised I needed some service worker stuff.
Then I figured, why not just have the service worker act as the router and send the html instead, and its turning out to be pretty damn awesome.
Cool, out-of-order streaming without using JS to swap out content, but instead using DSD. Pretty nice.
(the script tag in there is the sw registration)
Stoked to finally be able to announce: Custom Elements Manifest 1.0.0
I’m really looking forward to see what kind of new tooling this will unlock. Read all about it here:
I like web components 🤷
Are they perfect? No. Are they a silver bullet? No. But I can write cool stuff, real fast, directly in the browser. I dont need to compile anything, I dont need to set up a toolchain, I can just write javascript in the browser, and have it work.
Yeah, this is really awesome. Since
@astrodotbuild
now supports streaming, you can fetch html, and since response.body is a stream, Astro will render the HTML as it comes in.
Even cooler: This exact code will also work in your service worker. Isomorphic streaming rendering!
This is very much not a dream, I do this for all my libraries.
Ship standard JS, dont bundle, dont minify, dont polyfill, those are all app-level concerns.
Oxc is (almost) single handedly rustifying the js tooling ecosystem lol. Js/ts parser via oxc_parser, node module resolution via oxc_resolve, es-module-lexer equivalent via oxc_module_lexer. A lot of building blocks that I typically use for a lot of tooling that I work on
Re: this
I recently needed a bunch of these components for an app, so I put together a quick repo of accessible, easy to use, native web components (no frameworks/libs).
So here's generic-components:
#webcomponents
#a11y
#js
#vanilla
I still havent seen many good, simple(!), accessible, extensible, zero dep(!) libraries of web components for 'simple' things that are so common like a toggle switch (std switch, anyone?), or accordion, or etc. Theres many novelty components like a 'blink' or whatever.
I’m reviewing a TypeScript code base without JSDoc comments above every function and component:
I don't recommend this.
JSDoc provides actual type safety, with superior autocomplete and documentation, for about the same amount of work.
I wrote down a little case-study of sorts regarding the barrel file rabbit hole I went down, if anyone is interested in learning more about how I approached this
Ever wonder if a page uses custom elements? Try this new Chrome extension:
You might be surprised to find who's using custom elements! Let me know if you find anything cool!
tbh any frontend dev should be able to be productive with any frontend library, react, svelte, lit, vue, whatever. Its all the same shit, component model, lifecycle, state, etc.
@CodingGarden
I'd try Vue for a side project.
But for a business, using Vue instead of React means cutting the talent pool of potential hires in half.
Finding great talent is already hard. Companies can't afford to shoot themselves in the foot by choosing a less-widely-used tech stack.
New blog, who dis? 🎉
On The Bleeding Edge; making projects without a buildstep, using web standards and having fun. Also dropping a bunch of buzzwords like kv-storage, import maps, PWA, and built-in modules.
🔥 Get it while its hot 🔥
axobject-query, refactored to TS and published as cjs/esm (via tshy), so you can also use it in the browser without a buildstep. Will probably take a stab at aria-query next when I'm bored.
(First time using tshy, pretty nice experience!)
Little bit of a quick and dirty one, but here's some cool things you can do with plain old vanilla events. You may not need an expensive library. Just use an event.
It's official. iOS will not support Progressive Web Apps in the EU.
It would be great if Apple provides the basis of this claim:
"We expect this change to affect a small number of users"
🎉 New blog
The year is 2020. Service workers are still rocket science. Humanity still hasn't nailed service worker updates. The search continues.
#pwa
#progressivewebapp
#workbox
#updates
I think its really awesome that at work we stick close to web standards. We write esm code, and no non-standard/no heavy build magic kind of stuff. No ts.
It really, really pays off. It keeps the code super flexible, compatible with tooling, and portable.
Safari 17.4 is here! With 46 features and 146 bug fixes
• menu commands for web apps on Mac
• switch control in HTML
• vertical forms
• align-content everywhere!
• CSS Scoping with
@scope
• more video/audio codecs, including WebM & Vorbis on iOS
Oh god. Some crypto project built some kind of JS library and named it Lit, and now the crypto folks are creating issues on the web component project Lit repo 🤦♂️ Whyyy
Itd be so nice if there were some standardization around JS tooling config files. Instead of automatically picking up config files from the root, pick them up from `config/`. All config files follow `*.config.js` or `*.config.json`.
@jarredsumner
For all of it's woes, I find it hard to think of a solution that allows for easier debugging. If I have an issue, I just open the code locally in node_modules and debug it, which for me is a huge benefit.
Farm seems interesting. First rust-based bundler that actually builds our entire app on first try! Rollup/vite plugin compat. Seems to output a runtime similar to webpack/rspack, which I guess is done for chunks. Seems promising!
And there we go, first release candidate for generic-components
A collection of generic web components with a focus on:
🚹 Accessibility
🏗 Easy to use
🎨 Easy to style
All components are vanilla web components 🙂
Docs:
Github:
Man, have been getting so much mileage out of this pattern to batch updates recently:
(very very clearly inspired by LitElement, just stripped down a lot)
Published an 0.0.1 version and added some documentation :) Decided to go with `swtl` (Service Worker Templating Language).
Will implement out of order streaming sometime this week and do a blog, but Baldurs Gate is too much fun.
> use any react component: installs all of lodash, es5 transpiled dependencies, commonjs everywhere, process.env
> use a web component:
bUt YoU UsEd A hElPeR LiBrArY tO Do iT!!!1
Published an initial version of Barrel Begone. Analyze your package's entrypoints for barrel files, total module graph count, entrypoints leading to imports of other barrel files, and untreeshakeable imports
npx barrel-begone
I recently gave a talk on service worker, and I turned it into a thing. The thing is called The Mental Gymnastics of Service Worker, and hopefully it'll save _you_ some of the headache _i_ had when trying to figure this stuff out.
#pwa
#serviceworker
There are so many awesome things being worked on to help clean up the ecosystem, its fucking great
We have a good amount of quality replacements for packages and a good amount of codemods for them too. Next step is to actually start making PRs to popular projects to replace them
Releasing ✨neoqs✨, a drop-in replacement for the bloated `qs` package
🤌 3.9KB min+brotli (3x smaller than `qs`)
🚥 Zero dependencies
🎹 TypeScript. Throw away
@types
/qs
❎ No polyfills
🛸 ESM-first
📜 Legacy mode: ES5, CommonJS and Node 10+
🌐 Just works™ in all browsers
Congratulations to the 11 projects we've sponsored through the Advanced Web Apps Fund!
We're excited to recognize these projects, and enable their creators to spend more time on them. Applications are still open & reviewed on a rolling basis.