Opens profile photo
Follow
@webreflection@mastodon.social ๐Ÿฅ
@WebReflection
Web, Mobile, IoT: all JS things since 00's - opinions are my own โ„ข
Berlin, Germanymedium.com/@WebReflectionJoined May 2009

@webreflection@mastodon.social ๐Ÿฅโ€™s Tweets

Pinned Tweet
as promised, you can now extend builtins DOM elements with nonchalance and without needing at all the customElements global registry. In fact, no polyfill is even needed and all modern browsers will just work. Production size? 226 bytes up to 655 bytes!
1
37
to compare apples to apples I ended up proposing an alternative solutions that reasons well with JS prototypal inheritance nature, doesn't leak even secrets on foreign, non class related, objects ๐Ÿ˜ฑ, and it performs as well if not better as lazy accessors!
1
Show this thread
it's "stage 4" they say ... "it's done" they say ... well change stages logic as 4 is when everyone starts using new features and concerns like this should be addressed ๐Ÿคท TL;DR OOP in JS like this requires a book a part because everyone else can "eff" off already ๐Ÿ˜ข
1
Show this thread
probably no need to wait extra time as most people doesn't know or got it wrong, while others maybe cheated ๐Ÿ˜œ if you want to understand what happens and why class fields can be dangerous/problematic read this ๐Ÿ‘‹
Quote Tweet
JS Class fields potentially harmful (but TS class fields too) webreflection.medium.com/js-class-field
Show this thread
Show this thread
this is a reminder that for structuredClone there is this polyfill that does much more, allowing serialization that can be stored in any DB too ๐Ÿ˜‰ I am not sure why core-js or Babel didn't consider it but if you know, let me know ๐Ÿ‘‹
1
3
Back to OOP basics ... (I had a moment today!) class A { constructor() { console.log(this.sub); // ? } } class B extends A { sub = 'B'; } class C extends B { get sub() { return 'C' } } const b = new B; // ? b.sub; // ? const c = new C; // ? c.sub; // ?
  • B, B, C, C
    25.4%
  • undefined, B, C, B
    21.1%
  • undefined, B, C, C
    24.6%
  • I don't even
    28.9%
114 votesFinal results
5
9
Show this thread
I fully respect that developer intent and effort and yet I feel responsible for both of us wasting more time than needed ... Lesson learned: next time I'll think twice before asking for a PR ... prioritization over wasted time looks like a better way forward in general.
2
4
Show this thread
latest LinkeDOM issue + PR was a good example from a developer that already went through the repo before ... the PR changed 16 files instead of 3 (2 better changes + test coverage). I've spent more time to review the PR and discuss the Issue than fixing it myself right away ๐Ÿ˜…
1
3
Show this thread
what I've noticed over many years of OSS projects and contribution is that small projects receive PRs without related issues (also annoying) while bigger projects always start from an issue and rarely get the outsourced contribution, as that can take forever if not your code/repo
1
1
Show this thread
imho, the reason "PR welcome" doesn't often work is directly related to the size and complexity of the project. Reading all gotchas behind a bug or a feature request can take pretty long time (specially to do the PR right). Maybe we should lower our expectations when we ask that.
1
8
Show this thread
The DOM is missing a way to relate a tag name to its constructor, consequentially missing a way to also know all tag names possibly available on the DOM. I've used manual / hacky ways to map HTML.A to HTMLAnchorElement + all others but it ends here ๐Ÿฅณ
5
13
Show this thread
builtin-exend and the hell not supporting these bring to the Web ... bloated, slower, less accessibility friendly, do you still believe WebKit position on this is justified by Liskov substitution, when all the odds are against not supporting it?
2
while everyone seems to be OK with Rust .unwrap(), mostly nobody seems to welcome .valueOf() in JS. Here where it's handy: * signals, to implicitly "cast" for math or string opertaions * proxies, as convention to return the wrapped value, when desired * Object(primitive) ๐Ÿฆ„
1
5
Once upon a time, Firefox implemented an Object.prototype. watch/unwatch ... those pages now state accessors or Proxies are a better way to do so, so I've brought watch/unwatch back via Proxy (which seems legit) ๐Ÿ˜‡ Meet proxy-pants/watcher
4
P.S. to me ... I've found astonishing I've used HTTP Web Archive service to grab my old code from a "not mine anymore" domain and managed to reproduce this 15 years later without changing a single char in the code: this is the Web Standards feature I've been standing for till now
12
Show this thread
worth clarifying: the reason is *not* that `thing` in this example is the same, the reason is that templates literals passed to tags are always the same, equally with function('same-string') always receive the same 'same-string' reference ... never cache templates tags ever ๐Ÿ‘‹
1
Show this thread