On the current typescript / anti-typescript internet drama I saw someone mention javascript without a build step.

Do you think we’re already there?

Last time I attempted it:

  • there were too many libraries I couldn’t import
  • JSX (using babel) had a warning saying you shouldn’t do it in the browser for production
  • there was some advice against not using a bundler, because several requests for different .js files is slower and bigger than a bundled package
2 points
*

It’s doable and although I would best describe the dev experience as “ok”, it is improving over time.

Per your bullets

  • use newer module based js libraries, yes this is limiting but getting better support over time, and you still have to deal with issues cause by different library types when using a bundler

  • JSX will require a build step at some point, pushing that to runtime doesn’t improve anything. Instead I would favor lit html

  • probably true, but I would start without and wrap a bundler around the project when it becomes necessary, smaller projects will have a negligible effect. You should benchmark the differences yourself, and if you use es modules everywhere wrapping a bundler around it will be easy.

With the above you can get all the usual niceties too: hot reloading, lazy loading, etc

permalink
report
reply
3 points

Isn’t Babel part of the build step? I might not be misunderstanding with what you mean by build step here.

In general, you probably can’t avoid a bundler for the browser without significant compromises on performance and developer experience.

permalink
report
reply
1 point

I’m asking mostly out of curiosity, but I had a use case that I would like to completely avoid a build step. At work we have a very old web interface, that when I attempt to sell the idea of any major improvement the answer is “this is end of life, we are rewriting it”. But the rewrite will take a long time, and it is easier to make gradual improvements without introducing new tooling. This one is from the 90s, there the JS is in a folder and is shipped as is.

permalink
report
parent
reply
-1 points

Does it still make sense to use javascript? I thought WASM would make JS obsolete and introduce web UI frameworks in other languages.

permalink
report
reply
3 points

WASM’s biggest holdback is that it cannot directly access the DOM. Until then, JS will still have a prominent place in building anything rendered in a browser.

permalink
report
parent
reply
1 point

That’s actually a myth and real world performance isn’t affected by this. See this video from leptos creator which is one of the more popular wasm ui framework https://youtu.be/4KtotxNAwME?si=D_vWV1LPQI-C9j8G

The biggest issue is actually the size of the payload since you need to ship the entire app and language runtime.

permalink
report
parent
reply
2 points

It’s not a question of performance - it’s just the fact that you need to use JS to modify the DOM in WASM. Until there is access to the DOM from WASM, there simply will be a place for JS in nearly every web app and it’s not because it’s fast, it’s because there are still certain things just need to be done using JS.

My point is really nothing to do with performance and I agree with the video you’ve linked: WASM is fast enough today. Whenever you can truly stop using JavaScript, I’ll be the first in line. You can already use WASM and eliminate huge portions of JS - but for anything beyond a very simple UI, you always end up with something that needs to be called in JS.

permalink
report
parent
reply
1 point

Here is an alternative Piped link(s):

https://piped.video/4KtotxNAwME?si=D_vWV1LPQI-C9j8G

Piped is a privacy-respecting open-source alternative frontend to YouTube.

I’m open-source, check me out at GitHub.

permalink
report
parent
reply
1 point

Absolutely. WASM is still not that good or easy.

permalink
report
parent
reply
2 points

A lot of the WASM ecosystem is still pretty rough

permalink
report
parent
reply
13 points

The real answer to the question you didn’t ask is: just don’t involve yourself in internet drama’s.

Tell me instead, what is the problem with a build step and typescript?

permalink
report
reply
2 points

Well it’s an extra step that you’re only doing to address this problem.

permalink
report
parent
reply
0 points

Are you one of those “types are noobs” people?

permalink
report
parent
reply
2 points

No

permalink
report
parent
reply
6 points

Just use WASM

If only…

permalink
report
reply

Programming

!programming@programming.dev

Create post

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



Community stats

  • 3.2K

    Monthly active users

  • 1.8K

    Posts

  • 30K

    Comments