Hacker News new | ask | show | jobs
by austin-cheney 14 days ago
Since you need just a little help…

Yes, I push all my TS code through Node for type stripping. No, Node is not executing browser code. No, I am not suggesting Node is running in the browser.

For extra extra extra clarity importing functions in JavaScript does not execute them. They still have to be called for them to execute.

I am still willing to fix your code for a consultation fee.

1 comments

yeah this is a bit confusing. so you strip the types from the frontend and serve the .ts file as .js file? That's a transpiler/bundler.
Confusing or not it works for me. No compile step and no build step. The application starts up in 0.2 seconds on Linux and about 1.2 seconds on Windows.
it is confusing the way you are explaining it, so much that even you can't understand.

You do have a build step, you just think that doing that using node script is the same as not having one, I guess.

Yeah, IMO they are just making stuff up. Even as explained what they're saying makes no sense. Ultimately, there needs to be some entrypoint into the client-side script, node has no built in way to serve source code it's type-stripped over http.
If Node is your web server then node does have a way to serve the code to the browser... or you could just have node write the stripped code to a file for your other web server. It sounds like you are not even trying to think through this. I recommend putting fingers on keyboard and just trying to find your way through the solution instead of complaining about how impossible life is.
> I recommend putting fingers on keyboard and just trying to find your way through the solution instead of complaining about how impossible life is.

I recommend you stop making stuff up online. We're 10 layers deep into this thread and you still can't explain how any of this works in a coherent way.

If any of this is real, why don't you attach a link from the node documention or an article that explains this technique that allows node to serve type stripped imports over http.

I'm not asking for a link to the http stack, I'm asking you to explain how you run a node app that consumes your typescript source code and serves it over http without a bundler.