News for hackers. Stuff that matters.
Re:WebContainers: Run Node.js natively in the browser by throwaway284534 on Thursday May 20, 2021 @02:59PM (#27225552)
I used to teach web development and was always frustrated with just how much effort went into setting up a machine. It would be really nice if a developer could just include a script tag in their project that setup a TypeScript compiler inside service worker. I managed to get the basics down, even fixing relative import statements. Requests like localhost:3000/main.tsx would compile and cache on the fly.

There were a few native file system issues I encountered that this would be perfect for!

Re:WebContainers: Run Node.js natively in the browser by deviantfero on Thursday May 20, 2021 @10:38PM (#27229924)
I wonder if that is the ideal path though, I was an instructor for a few subjects in my university and sometimes the biggest detractor for students was the lack of familiarity with the tool set used by the language,

for example, people sometimes did not know how to freeze their dependencies and use python virtual environments when working with python projects, that lead to problems in collaboration, handing students "magic" prefabricated environments could lead them to believe that that's all there is to it, and explaining that it is not to the student in an edge case might end up being less productive than understanding this process from the get go

you could say that the _effort_ to set up a development machine should be part of the learning experience, at least that's what I think.

I remember seeing my classmates having their first freelance jobs and editing minified css/javascript directly because they did not know anything about the transpiling that goes on or the toolset surrounding javascript and web development

Re:WebContainers: Run Node.js natively in the browser by seanp2k2 on Friday May 21, 2021 @12:15AM (#27230438)
It’s even funnier when those same devs who struggle with packaging and distribution in their best language go on to work at Fortune 500 companies and require constant devops assistance to actually make what they wrote work in even a test env. “But it works on my laptop!”
Re:WebContainers: Run Node.js natively in the browser by nsomaru on Friday May 21, 2021 @12:43AM (#27230583)
“Yes, but we are not shipping your laptop!”
Re:WebContainers: Run Node.js natively in the browser by k__ on Thursday May 20, 2021 @08:54PM (#27229324)
I taught web development at a university last summer with CodeSandbox remotely.

Worked like a charm.

Re:WebContainers: Run Node.js natively in the browser by flanket on Thursday May 20, 2021 @07:06PM (#27228554)
Re:WebContainers: Run Node.js natively in the browser by peteretep on Thursday May 20, 2021 @10:10PM (#27229772)
VS Code seems to allow this with Dev Containers. I can download a repo with a `.devcontainer.json` and be up and running in virtually no time, in a container.
Re:WebContainers: Run Node.js natively in the browser by maniacalrobot on Friday May 21, 2021 @02:35AM (#27231141)
Just wait till you try vscode devcontainers with GitHubs new code spaces.
Re:WebContainers: Run Node.js natively in the browser by tesnirnat on Thursday May 20, 2021 @04:58PM (#27227147)
How did you end up doing this? Do you mind sharing?
Re:WebContainers: Run Node.js natively in the browser by throwaway284534 on Friday May 21, 2021 @04:58PM (#27239884)
Excuse my mess but feel free to poke around:

https://github.com/nirrius/my-server

Re:WebContainers: Run Node.js natively in the browser by Tommek on Thursday May 20, 2021 @05:20PM (#27227447)
Yes web developing is so hard...

sudo apt install apache2 php libapache2-mod-php; vim /var/www/html/index.php

Re:WebContainers: Run Node.js natively in the browser by Kaze404 on Thursday May 20, 2021 @10:40PM (#27229938)
This comment is hilarious. It's like saying "being a doctor is so hard... pulls out an amputation saw"
Re:WebContainers: Run Node.js natively in the browser by phist_mcgee on Thursday May 20, 2021 @09:40PM (#27229606)
That's like saying that driving a car is easy. Foot on gas. Hands on wheel. Drive to destination.

Most things can be simplified to the raw essentials, doesn't mean you're going to achieve a result that people want or need.

Re:WebContainers: Run Node.js natively in the browser by wmichelin on Thursday May 20, 2021 @09:14PM (#27229448)
I see you haven't done anything in 10 years
Re:WebContainers: Run Node.js natively in the browser by seanp2k2 on Friday May 21, 2021 @12:19AM (#27230462)
PHP is actually pretty great these days, you should have a look at what modern PHP has become if you’ve been out of the loop for a while. Have a look at https://phptherightway.com/ if you’re interested.
Re:WebContainers: Run Node.js natively in the browser by ric2b on Sunday May 23, 2021 @10:06AM (#27255083)
Cool, hello-world is easy, now give me a basic bar chart.