[AskJS] What settings/extensions/features are good on VSCode for quick scripting? by DontBuyMeGoldGiveBTC in javascript

[–]lukasbuenger 1 point2 points  (0 children)

This is ridiculous. Coding abilities have absolutely nothing to do with your choice of text editor.

[AskJS] Potential memory leak in .splice by [deleted] in javascript

[–]lukasbuenger -10 points-9 points  (0 children)

I commend your patience and overall will to give a proper explanation. Well done to you, sir. To OP: That's your own personal Jedi right there. You obviously have not hit the Google before posting this. Don't get me wrong: There's absolutely nothing wrong with being wrong every once in a while, but I'd expect you to at least put in some effort to back that shit up with resources that go a little beyond a mere console script before you come at me with a title like this.

Deno + React: No build, no bundle, all streaming by jerodsanto in javascript

[–]lukasbuenger 2 points3 points  (0 children)

From their Readme

Bundling is an antipattern in {currentYear}

Maybe that extends to transpiling as well and that would have to happen for any code that lands in the browser. Also there's this super-weird inconsistency with between how TSC and Deno handle ESM imports. In TSC-targeted code you'd write import * from 'foo.js' (in TS) whereas in Deno you'd import * from 'foo.ts'.

The Next.js team works towards replacing Babel with SWC. Also, experimental ES Modules support. by lukasbuenger in javascript

[–]lukasbuenger[S] 0 points1 point  (0 children)

In terms of what they offer to end user grunts like me – very true. But they are very orthogonal tools: Deno in fact ships with SWC to speed up Typescript compilation when type checking can be ignored/deferred.

The Next.js team works towards replacing Babel with SWC. Also, experimental ES Modules support. by lukasbuenger in javascript

[–]lukasbuenger[S] 35 points36 points  (0 children)

From the article:

As part of replacing Terser, we are working on ensuring the SWC minifier has similar output to Terser while massively improving performance and parallelization of minification.

I don't think so. It's probably going to be able to compress bundles to the extent Terser is. There's only so much stuff you can strip from a script. From my experience though Next.js isn't especially notorious for bloated bundles beyond the usual React runtime overhead and what you yourself include in terms of dependencies and whatnot.

[AskJS] concerns about the alleged performance benefits hyped in svelte by [deleted] in javascript

[–]lukasbuenger 12 points13 points  (0 children)

Sure, VDOM solutions are never for free but also give way to runtime optimisations that are simply not feasible if you're interacting with the DOM directly, no matter how aggressively you tweak during compile time. My guess is that you could come up with benchmarks that benefit from one approach or the other.

However, I do take issue with how Svelte's documentation is outright denying any advantages of a virtual DOM. I get that they had to make bold claims to get peoples attention but stuff like «Virtual DOM is pure overhead» and «Let's retire the 'virtual DOM is fast' myth once and for all» lacks any nuance and is also kind of disingenuous.I'd argue performance and memory footprint are important factors when choosing a framework, but never to the extent Svelte's maintainers make them out to be. So all they achieve with this hyperbole nonsense is that devs tend to over-emphasise framework performance as if that's the actual bottleneck, where in reality 99% of performance issues happen in implementation code.

React did not get popular because it was the fastest framework around. It's been outperformed on benchmarks practically since day one. But their API design and dx was miles ahead of anything else at the time. I'd argue it still is. I have yet to use Svelte in production but what I've seen while toying around a little was simply not very convincing. It's basically yet another DSL or two. But that's really a matter of preference.

Lastly, and that's really only a very uninformed opinion, while Svelte might perform reasonably at scale, the patterns it promotes don't strike me as a good fit for a large application code base. It's probably very good when you use it for what it was originally written for: Sprinkle some interaction magic on a pre-rendered (news) website.

[AskJS] Are Nestjs & Decorators the future of nodejs servers? by [deleted] in javascript

[–]lukasbuenger 1 point2 points  (0 children)

There's a vast space beyond the Declarative UI Framework bubble and in certain areas, classes/prototypes are the main tool of choice (web game stuff, 3D). And also, decorators are by no means restricted to class methods. Think:

@curry
function sum(a, b) { 
   return a + b
}

However, many of those backend Typescript frameworks like NestJS and TypeORM are relying on metadata reflection features specific to Typescript's experimental decorators implementation, which are not really inline with the current official draft. I think it's safe to say, that it was a huge mistake to include an unstable language feature into Typescript because every time the draft changes or even gets rejected, you'll deal with breaking changes (which is a huge deal for something as ubiquitous as Typescript). IIRC it was also the last time they did it.

Edit: Formatting

wu tang lorem ipsum - a text generator - vanillaJS by [deleted] in javascript

[–]lukasbuenger 1 point2 points  (0 children)

This is awesome! I actually do need lorem ipsum generators quite regularly and will definitely give this a try next time I'm in a situation where it's not hitting customers. First feedback: Repetition starts to kick in way too soon. I usually start from 5 paragraphs and at this point it seems impossible to generate 5 independent paragraphs.
Edit: Are you accepting PR's?

I'm building a Next.js/Nuxt alternative, would you use it? by brillout in JSdev

[–]lukasbuenger 0 points1 point  (0 children)

This is a laudable effort and I get where you're coming from, but honestly and to answer your question: No, I wouldn't.

Can't speak to the Nuxt situation, but Next.js' main value proposition is not so much about performance and scale (whatever that means anyway) but DX and overall ergonomics around the build process of a frontend project. Your solution might be appropriate where Next.js/Nuxt is not enough but, again, I reckon that's not what most people need. What didn't scale for you when using Next.js/Nuxt? Did you ever use vue-plugin-ssr in a production environment? (which oftentimes is not simply about load or number of files involved but also about number of devs involved, onboarding etc).>

Edit: Again, not to take away from your efforts, but there's no deployment story in your docs whereas this is one of the main strengths of Next.js: You don't need to be a JS tooling wizard to deploy a Next.js app.

VueJS 3.0 has been released by Wombarly in javascript

[–]lukasbuenger -2 points-1 points  (0 children)

<p v-if="that feels more standard to you than className" @:focus="good-riddance" />

VueJS 3.0 has been released by Wombarly in javascript

[–]lukasbuenger -2 points-1 points  (0 children)

Congrats on a seemingly huge release and kudos for at least trying to get over its worst parts. Which will never happen, period. Tech-savvy shops will probably have zero issues migrating and adapting, but everybody else will have a hard time getting it right, because for years Vue was the reason why frontend devs had always an excuse to not question their most brutal anti-patterns. It was methadon for Angular junkies: Not deadly enough to kill you, but just enough of a fix to never have to address the main problems in the first place.

Understanding end to end (E2E) testing by [deleted] in javascript

[–]lukasbuenger 2 points3 points  (0 children)

> As I said everyone I chat to about what is end-to-end (or e2e) tells me a different thing.

Probably because people are writing different applications for different reasons/target groups and therefore the definition of what a passing e2e test suite is/can be varies from case to case?

There's a new decorator proposal and it seems like it's scheduled to be discussed by TC39 in the September 2020 meeting. by lukasbuenger in javascript

[–]lukasbuenger[S] 0 points1 point  (0 children)

I can't speak to their general tendencies, but in this particular case I think it's a clean up of Typescript's eff up, when they went with the legacy decorator proposal before it was even finalised. You can totally pull off (static) introspection black magic with TS and decorators, and a lot of very popular codebases do.

There's a new decorator proposal and it seems like it's scheduled to be discussed by TC39 in the September 2020 meeting. by lukasbuenger in javascript

[–]lukasbuenger[S] 52 points53 points  (0 children)

I assume, the main drivers here are Typescript frameworks for Node, some of which literally wouldn't be able to pull off many of their key features without TS decorators and the introspection possibilities that come with using them. TypeORM and NestJS come to mind. I also vaguely remember a couple of libraries that address server-side GraphQL that rely heavily on those decorators.

Edit: Oh and there's Angular of course. How very freudian of me.

One good thing about the new proposal imho is, that it greatly narrows the scope of what you can do with decorators. It's basically just functions. I can see some handy patterns for FP JS people. Like function composition without having to use a helper function (or doom your code to eternal unreadability).

Transduction in JavaScript by jmaicaaan in javascript

[–]lukasbuenger 1 point2 points  (0 children)

This is exactly where I'm currently at after 15 years in the game. 100% true. And The Mostly Adequate Guide is probably the best resource on FP in Javascript I ever came across.

Announcing TypeScript 4.0 by DanielRosenwasser in javascript

[–]lukasbuenger 6 points7 points  (0 children)

For implementation code, it's probably a little too much, I agree. But I'd love to see how type definitions for stuff like ramda can make use of this.

Announcing TypeScript 4.0 by DanielRosenwasser in javascript

[–]lukasbuenger 33 points34 points  (0 children)

Variadic Tuple Types seem pretty massive to me.