Web Dev Without Tools (2021)
danthedev.com
danthedev.com
> So you can't open your index.html over the file:// protocol.
It's not a dealbreaker but that is a significant inconvenience for me. I do local development over file:// a lot.
One thing I'm wondering about is dynamic loading of modules. Say my main.js should only load extra.js under certain circumstances. How does that look?
There are no conditional top level imports, but you can call import("thing") which gives you a promise for the module.
I am not affiliated with Vite in any way, I just really like it for vanilla web dev.
The only thing to note for purists, it creates .vite folder which you have to ignore.
Not meaning to pick at anything here, but to me web dev necessarily requires knowledge and configuration of a web server.
What's being sent to the browser in a production setting is an HTTP message, not just the web content.
Many features of a non-trivial web page/app will at least require HTTP headers to be set. The "file://" protocol handles this by mocking the full HTTP response for you in the browser, but any deviation from that response on an actual web server has the potential to break your page. I wouldn't rely on opening files directly.
Also following this approach, so much liberating not to have "all these dependencies", and having to learn them.
Been writing vanilla css, html, js, (and sometimes using static site generators) to help split the logic between `/content` (markdown, org, txt, json) and `/assets` (js,css,pdf).
When all this is plugged to git, is deployed/published with CI/CD, and served as static pages (jamstack style, git provider pages), things are great!
So it was really a no-brainer for me to go along on the entire JS ecosystem ride of the 2010's, purely for the purpose of trying to get my computer to do what I wanted it to do (as opposed to making "apps" for everyone else).
In 2012, I started working on the code of the project now acronymically known as LOTW (Linux on the Web [1]), but I suppose it could just as easily have gone by the letters WDWT (Web Dev Without Tools).
[1] See: https://linuxontheweb.github.io/
I take this one step further- I like to start some web prototypes with a single HTML file (Single File App). All you need is an editor and a browser.
Jsdoc and copilot make this pretty rapid now too :)
The irony of this sentence is there was a time before these tools existed when we also did complex web development (for at least a good 15-20 years) in the browsers as they existed.
But now you don't need a lot of what they do anymore.
I would also like to give a shout-out to Caddy if you need a more configurable web server. After dealing with complex config in Apache and nginx, Caddy is a real treat to use.
# run this in your project directory
python -m SimpleHTTPServer
This is python2, for python3 it's: python -m http.server