!jsSjXenzDAnqfOlJYU:matrix.org

Node.js

346 Members
Node.js is a JavaScript runtime | https://nodejs.org/ | ✨ 🐒 πŸš€ ✨ | Mission statement: http://bit.ly/28Ix9uj38 Servers

Load older messages


SenderMessageTime
20 Nov 2021
@darkon:matrix.orgmoritz
In reply to @joepie91:pixie.town
so I'd recommend either using JS as-is and learning how to use its abstraction capabilities to write reliable and maintainable code, or if you really want static typing, to use a language that was actually designed for it from the start
Thx for the long answer. But the question was more on the techincal side using TS in Node.js instead of JS. Does Node have any issues working with TS instead JS? In frontend we are using TS, so it would be nice, to have same language in backend. All docs for Node are using JS for example, but why? Does Node not work well with TS? Or is it just historical because Node in the beginning was only supporting JS? If the question is not so clear, sorry for that, i am not a native english speaker, i try my best to be clear here :-)
13:13:53
@joepie91:pixie.townjoepie91 πŸ³οΈβ€πŸŒˆ moritz: right, so TS is just a language that compiles to JS, it's not a language that you run directly in anything 13:15:02
@joepie91:pixie.townjoepie91 πŸ³οΈβ€πŸŒˆthat's also why its type system is so limited, it needs to work around the design that JS has because it ultimately needs to be turned into JS to run it13:15:24
@joepie91:pixie.townjoepie91 πŸ³οΈβ€πŸŒˆie. there's no such thing as a "typescript runtime"13:15:37
@joepie91:pixie.townjoepie91 πŸ³οΈβ€πŸŒˆthat means that: 1) you can use TS anywhere you use JS, as long as you do the build step in some way, and 2) nothing 'runs' TS, everything runs JS, and so all documentation will be using JS because that's the language that's actually being used, you can think of TS as an unofficial third-party layer on top of it13:16:31
@joepie91:pixie.townjoepie91 πŸ³οΈβ€πŸŒˆdoes that make sense?13:17:18
@darkon:matrix.orgmoritz
In reply to @joepie91:pixie.town
does that make sense?
Yes, this i already know.
13:17:34
@darkon:matrix.orgmoritzI know what TS is and how it works. But i am not sure about TS with Node.13:18:15
@joepie91:pixie.townjoepie91 πŸ³οΈβ€πŸŒˆ what I am trying to say is that "how TS works" means that there cannot be issues with TS in Node, from a technical perspective 13:18:37
@joepie91:pixie.townjoepie91 πŸ³οΈβ€πŸŒˆbut that because of that, there's also no reason for the Node docs to mention TS at all, it's just a third-party tool13:19:02
@joepie91:pixie.townjoepie91 πŸ³οΈβ€πŸŒˆ * what I am trying to say is that "how TS works" means that there cannot be issues with TS in Node, from a technical perspective 13:19:51
@darkon:matrix.orgmoritz
In reply to @joepie91:pixie.town
what I am trying to say is that "how TS works" means that there cannot be issues with TS in Node, from a technical perspective
Ok, i understand :-)
13:22:10
@darkon:matrix.orgmoritzSo i only need to do this extra step: compile TS to JS to get Node running. 13:25:54
@darkon:matrix.orgmoritzI found this https://www.digitalocean.com/community/tutorials/setting-up-a-node-project-with-typescript I guess this is exactly doing, what i want. 13:26:13
@darkon:matrix.orgmoritzSo it is time for me to learn TS now :-D13:27:57
@joepie91:pixie.townjoepie91 πŸ³οΈβ€πŸŒˆ
In reply to @darkon:matrix.org
So i only need to do this extra step: compile TS to JS to get Node running.
basically. you can either set up tsc to manually compile or auto-compile on file changes, or use a wrapper like ts-node that makes it look like you are running TS in Node by compiling it behind the scenes whenever you run your code
13:46:14
@joepie91:pixie.townjoepie91 πŸ³οΈβ€πŸŒˆ moritz: at a glance that tutorial looks okay 13:46:46
@joepie91:pixie.townjoepie91 πŸ³οΈβ€πŸŒˆit doesn't tell you to use webpack, which is good13:46:55
@joepie91:pixie.townjoepie91 πŸ³οΈβ€πŸŒˆ(a lot of the bad tutorial writers don't understand the difference between a compiler/transpiler and a bundler, and think that you need webpack to run TS in Node)13:47:14
23 Nov 2021
@server_stats:nordgedanken.dev@server_stats:nordgedanken.dev left the room.02:42:10
24 Nov 2021
@darrinde:matrix.org@darrinde:matrix.org left the room.08:44:33
@waldteufel:matrix.orgwaldteufel joined the room.12:13:17
@o:matrix.orpheuslummis.infoOrpheus changed their profile picture.22:13:37
25 Nov 2021
@mgourab:matrix.org@mgourab:matrix.org left the room.04:39:16
26 Nov 2021
@jvaldesgonzalez:matrix.orgJavier Alejandro ValdΓ©s GonzΓ‘lez joined the room.18:10:17
@mindranger:matrix.orgmindranger changed their profile picture.21:05:09
27 Nov 2021
@arehandoro:one.ems.hostArehandoro changed their display name from Arehandoro to Alejandro.23:00:55
28 Nov 2021
@arehandoro:one.ems.hostArehandoro changed their display name from Alejandro to Arehandoro.13:12:06
29 Nov 2021
@pvzh:matrix.orgPavel joined the room.08:04:26
@vishaljoshi:matrix.orgvishaljoshi joined the room.18:40:18

There are no newer messages yet.


Back to Room List