Earlier quoted context omitted.
> block the entire page, really? talk about burning down the village to save it I'm curious for what the other approach is. Users find it annoying to refresh the page and have their dark-mode setting change, or have their dark-mode setting change while navigating the site. So I have to block paint until I can query local storage in order to avoid flashing, what's the alternative? Below someone suggested using cookies…
You don't need to hide the entire page until fully rendered. You inline in the head just the bits of CSS/JS you need and set styles from there, so if you are in dark mode, it's set to dark before anything has rendered, without needing to block a huge amount of time. You can see how it works on my site https://gwern.net/ - set dark mode in the toggle (assuming it is not your system setting already), and refresh or for…
How to build a website without frameworks and tons of libraries
231–240 of 270 posts
Re: How to build a website without frameworks and tons of libraries
#232Earlier quoted context omitted.
I see your point. My recommendation if you wish to improve your designs is to do them outside of CSS if you don't already. With something like figma or Penpot you will have your fonts, palette, spacing and layout all predefined. Then once all your views are created using these common elements, you only need to transcribe them as classes in your CSS and use those few classes where needed in your HTML. I'm not a design…
See, my problem is that I don't want to get good. I just want to ship.
Re: How to build a website without frameworks and tons of libraries
#233I believe the most minimalistic and productive way is to just use php. The language was specifically just created for that. If it's a simple site then you don't need composer you don't need router logic. just create separate files for header footer navigation and include them on each page.
We are being simple, and I consider a simple PHP site about one step above HTML and CSS in required complexity, and about 5 steps below anything else in regards to tooling/setup/execution.
Re: How to build a website without frameworks and tons of libraries
#234Earlier quoted context omitted.
try the tutorial? https://learn.svelte.dev/tutorial/introducing-sveltekit
There's a fairly high barrier for people to commit to installing a tool and building with it, especially if you haven't shown them what they'll get out. Docs look good otherwise.
(Of course it doesn't work for me with my normal firefox security settings, but running it in Chrome/Chromium is easy enough.)
Re: How to build a website without frameworks and tons of libraries
#235I’m just really tired of this debate about “frameworks” and “complexity”. If your client asks you for a custom CMS with a multi-stage publishing workflow with i18n and regulation-compliant a11y, you’ll need high-powered tools to build it in the time clients expect. Lots of clients in enterprise are like this, which is why the demand for this stuff is so high. If you’re working in B2C this may be surprising, but this…
I agree. Furthermore if you're trying to do anything complex and you don't use a framework, you just end up creating another framework. But this time there are no updates or help on Stack overflow for the person who inherits the code.
An architecture concept just needs a page or two of docs and diagrams to understand, and the code is right there in the app. You don't need a framework to implement relevant design patterns.
Those apps can also last longer, because there's less pressure to rewrite in React/Svelte/Solid/etc when the existing code isn't dependent on some obsolete framework - Ember/Angular 1/etc.
Re: How to build a website without frameworks and tons of libraries
#236A tiny mostly static website written by one person certainly doesn’t need anything special. A website/webapp with millions of visits per day and a ton of stakeholders requesting features every week, on the other hand... It all depends on the use case, like most stuff.
If you want a team of people that don't know HTML or rest of the stack to edit, manage and deploy it then you're going to need a more complex abstraction.
The alternative might be a training programme for new staff in HTML, CSS, git and rsync.
You're trading one type of complexity for another. As you say, it all comes down to use cases.
Re: How to build a website without frameworks and tons of libraries
#237As someone who was around when people still wrote apps in plain HTML and .js files without a build step, I'm surprised to read stuff like 'the simple toolchain for building our web: Watchdog.py detects the file change and ... renders Jinja template into index.html and ... calls Tailwind CSS CLI to generate styles.min.css...' You don't need any of those tools. You can build a fast website and even a complex reactive w…
Do you ned a lot of experience to know how to start browser-native tools? I wouldn't have a clue how to start with Web Components and all the other things, to build a I don't think I have the energy to move off from Sveltekit to a new thing, without having to re-learn everything and make a ton of mistakes
So if you're curious about the concept, check out Custom Elements. Same thing, but no Shadow DOM. I found them to work quite well for a toy project I made a couple years ago.
Re: How to build a website without frameworks and tons of libraries
#238Earlier quoted context omitted.
I agree. Furthermore if you're trying to do anything complex and you don't use a framework, you just end up creating another framework. But this time there are no updates or help on Stack overflow for the person who inherits the code.
Eh, I read this a lot. An app architecture is not a framework, frameworks get complicated because they have to be generalised enough to serve multiple projects with different requirements which leads to a ton of abstraction. Then because they're complicated they're difficult to learn. An architecture concept just needs a page or two of docs and diagrams to understand, and the code is right there in the app. You don't…
i.e. a framework.
> Then because they're complicated they're difficult to learn.
It's easier to learn a publicly available framework, as there is lots of help on Stackoverflow, and usually the popular frameworks have good, or just existing, documentation.
> existing code isn't dependent on some obsolete framework - Ember/Angular 1/etc.
The "app architecture" can also become obsolete. But now instead of a migration path, you're stuck with the person who made the "app architecture" most likely having left the company.
Re: How to build a website without frameworks and tons of libraries
#239I use Astro for my websites, because I'm familiar with the framework and have used it for many of my clients. Even though Astro is a framework, it doesn't feel like one when creating content inside it.