Earlier quoted context omitted.
You write all your code in TS - great. You run node with the TS support - great. That doesn't explain how your front-end TS code is transformed into JS. You seem to be suggesting that node does it automatically, but it doesn't. The explanation of your setup isn't adding up.
> That doesn't explain how your front-end TS code is transformed into JS. Node will do that at run time. Its automatic. Functions do not have to execute to receive this benefit. They just have to be imported. Ensure you are using a very recent version of Node.
Why Vanilla JavaScript
131–140 of 176 posts
Re: Why Vanilla JavaScript
#132I use Svelte 5 (without SvelteKit) for my SPA's, after doing my first SPA in vanilla JS. Then I discovered Svelte. Svelte is very close to the platform and still solves a lot of problems: for reactivity, modularity and CSS cascading (and in version 5 it is not too "magical"). A lot of the critique of frameworks in this article does not apply to Svelte.
And sure, there is a build step. I have never felt like this was a problem with Svelte, but then I don't have experience working on a colossal Svelte app. Does it become one?
Re: Why Vanilla JavaScript
#133Re: Why Vanilla JavaScript
#134Earlier quoted context omitted.
> That doesn't explain how your front-end TS code is transformed into JS. Node will do that at run time. Its automatic. Functions do not have to execute to receive this benefit. They just have to be imported. Ensure you are using a very recent version of Node.
Yes, but how does your http server deliver the imported code to the front-end? Are you using some type of streaming bundler that does real time builds? Something isn't making sense here.
Since I am not handcuffed by some giant framework I have maximum flexibility to do what makes sense.
Re: Why Vanilla JavaScript
#135Earlier quoted context omitted.
it can be faster, but is it correct? React was invented because jQuery style state management collapsed into unmanageable code past a certain size
And it wasn't composable, state was kept in the DOM. Even with higher level libs like backbone we didn't have a component-oriented way like now. Each component had to manually manage all of its child components.
Re: Why Vanilla JavaScript
#136Earlier quoted context omitted.
You can say that without being demeaning. These are random people acting in good faith. Also - sometimes it is actually useful to make a mini-thing instead of bringing in enterprise messes.
These people are perfectly fine with depicting React developers as corporate zombies that can't think for themselves. Good faith is bidirectional.
Re: Why Vanilla JavaScript
#137What’s the Idiomatic Vanilla JavaScript way to bind data and UI in a web browser?
What are you really asking? You use data to populate content or inform your logic.
Re: Why Vanilla JavaScript
#138Some good history of the JS ecosystem here but the underlying message is all the same, frameworks scale and provide structure but you don't need them. Very easy to agree up to this point. Author then elaborates in the absence of using a common-knowledge framework you can create some tighter solution that achieves just the part you need. This is "fun" programming, and the author is suitably impressed with themselves f…
We practice engineering. As engineers, we need to understand the realities of each project we take on. Those realities are not limited to the marketing bullet points we might apply to the imagined product someday, which is what early career folk might naively call "the requirements". Among the most critical realities to consider exist outside the product definition entirely, and have to do with the environment in whi…
Stronger: that should be standard operating procedure. Unless there's a pressing need (if not absolute necessity) to do otherwise.
Re: Why Vanilla JavaScript
#139Earlier quoted context omitted.
What are you really asking? You use data to populate content or inform your logic.
When the user changes a value in the UI, the data must reflect the change. When a value changes in the data, the UI must reflect the change. That’s “binding.” What’s the idiomatic way to solve this automatically?
Re: Why Vanilla JavaScript
#140Earlier quoted context omitted.
Yes, but how does your http server deliver the imported code to the front-end? Are you using some type of streaming bundler that does real time builds? Something isn't making sense here.
On application startup I assemble together the various front end files I need and store this in memory as a string. When the server sees a request for the desired page I respond with the desired string. Since I am not handcuffed by some giant framework I have maximum flexibility to do what makes sense.
So in other words, you created your own bundler?
Node isn't actually doing the work for you on the front-end.