🌶️ take: most #javascript code isn't suitable for multiple runtimes (sometimes ppl call this "isomorphic") and it's sort of silly to rely on compilation to get away with it.

the only exception I've seen is validation logic but that should run on backend regardless. and that's about it.

#nodejs does not have browser event handlers and it probably shouldn't anyhow.

ALL browser client code runs in events. Clicks. Taps. Form submit. Etc. Etc.

Zero of those events really make any semantic sense on the backend.

I know this seems heretical to bootcamp wisdom aka 'modern' javascript. But it's worth examining why they'd want to sell that fiction.

Follow

@brianleroux

Generating HTML/DOM nodes and validation are the only kinds of functionality I see myself using isomorphic code for.

Since validation code without any server code usually is very short, I imagine most of isomorphic code is for HTML/DOM generation, in order to gain some performance or be able to serve a no-JS version without having to code it specifically.

But I have never used node.js on server, so...

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.