Live data from Hacker News

Plain Vanilla Web

plainvanillaweb.com

661–670 of 715 posts

Re: Plain Vanilla Web

#661
post #634

Earlier quoted context omitted.

Reactivity features are helpful, but in my opinion they're only helpful in a problem that largely shouldn't exist. For a vast majority of websites out there state largely lives on the server. Reactivity is only helpful when the state reacted to is client side, and for that most sites that's only going to happen when we decide to keep a duplicate copy of state in the client rather than rendering on the back end where…

Yes and for those cases it’s kind of already solved decently like with htmx or just plain old forms and post requests. I think those old ways are underrated. But, for a chat app it isn’t gonna cut it. Or a collaborative app, where changes need to be pushed to the client. Or maps, or similar. Or anything which needs offline working. (I’m working on a desktop app where majority of state is owned by and lives on the cli…

Not sure if its an unpopular opinion here, but in those kinds of cases I think browsers are just a bad deployment target for the problem.

Dealing with cross-platform issues and app store policies can be frustrating, but the web was fundamentally designed for documents and it just doesn't lend itself well to complex, mostly or entirely clients side apps.

Re: Plain Vanilla Web

#662

Earlier quoted context omitted.

That's primarily because many SPAs aggressively prevent caching of all xhr responses using headers (which are ofc defined from the BE side) And the reason for that is mainly to prevent edge cases and make sure people in CRUD apps see up-to-date content. The experience with a no-cache max-age=0 server-rendered site would be very similar. All of the headaches around custom routing code + restoration of state are pretty…

No, this proves my point. Back in my days of backend programming, Varnish was the "magic" that made servers (especially CMSs) feel fast. Memcached is another common go-to cache. Browser caching isn't a replacement as the first request for every endpoint is still going to be slow. Yet somehow, APIs aren't treated with the same requirements for performance as web pages.

[deleted]

Re: Plain Vanilla Web

#663
Am I misunderstanding something, or is the routing example suggesting I put an entire HTML webpage inside a JS string? This doesn't look like a reasonable alternative to React with JSX.

https://plainvanillaweb.com/pages/applications.html

Also, "the hash-based routing approach is effectively invisible to search engines."

Re: Plain Vanilla Web

#664
post #589

I know I am in the VAST minority, or perhaps the only one, but I cannot stand frameworks. Sure, there may be a lot of power in them, but there is also a lot of bloat and complexity. IMHO, this "power" can easily be achieved with libraries instead of an IOC framework. After you learn a, typically terse and confusing, framework language, you have to know that framework language along with the base language (Java, C#, J…

Big corps and certain teams need some standard to agree on. The problem is that often times, someone in charge pushes the wrong framework without due diligence, and either nobody speaks up or they ignore the feedback.

Oh and it's way worse when said framework is home-grown. They can make something totally broken, and they don't take criticism well.

Re: Plain Vanilla Web

#665

my issue with doing web development without frameworks is how to best manage the app state. In react things like redux help with this, but in my experience state management becomes a mess without frameworks, maybe it's a skill issue on my side I don't know.

You can use Redux outside of React, you also have this option, RxJS.

Re: Plain Vanilla Web

#666

Note that you can make things even simpler than this: just use vanilla JS to compose HTML strings, and plug them into divs using innerHTML = "...". When your state changes due to user input, just rebuild the page using the new data. I've been building many simple apps using this technique, it works fine. I'm sure there is some kind of performance hit; it's almost never an issue. I have never seen any browser compatib…

Yes, you can kiss reactivity good-bye and just render the whole page on any state change.

No, generating HTML string and setting innerHTML is unsafe and slower than necessary. It is better to create DOM elements programmatically. HTML is for serialization of the DOM tree; if everything is done in javascript then you don't need HTML as an intermediate step.

Re: Plain Vanilla Web

#667
post #520

Earlier quoted context omitted.

> The web is supposed to degrade gracefully if you are missing browser features, up to and including images turned off. I agree. (This should also include CSS, TLS, cookies, and many other things; I often disable CSS, and it should work just as well if CSS is disabled just as much as if pictures or JavaScripts or cookies are disabled.) However, there are some uses where JavaScripts may be helpful e.g. if a web page h…

No, TLS should always be required. We should be moving away from plaintext anything on the wire, if for no other reason than privacy (but also for integrity, injecting scripts into an HTTP response is a nasty attack surface).

A lot of people argue about this both for and against.

However, TLS does not entirely help all of these things, especially with the way it is commonly used with HTTPS (although it can be used in a more secure way, it usually isn't). Although it prevents spies from injecting scripts, it does not prevent the server operator from modifying them from what the user expects (and it is not necessarily the software the user intends to run), nor does it help against someone taking over the domain name and then legitimately putting something else there instead (and stealing cookies, etc; X.509 client authentication would prevent theft of authentication though). To verify that a file is not modified, cryptographic hashes will help much better (whether or not TLS is used; TLS still prevents spies from seeing which files you are looking for though, and prevents spies from obtaining a copy of a file that is intended to be secret). However, these are not inherently problems with TLS; they are problems with the implementation, problems with HTML, problems with HTTPS, and problems with the expectations.

Another issue with TLS is proxies; if you want to deliberately run a proxy on your own computer (so that it is protected from spies, etc), you will have to decrypt and encrypt the data twice. This is also a problem with the implementation, and not an inherent problem with TLS itself; an implementation could easily allow unencrypted proxies of encrypted connections, but doesn't.

Self-signed certificates are commonly used with Gemini protocol and can be used with other "small web" protocols that support TLS. If you know the server's certificate from some other source (TOFU is a common way, but you could have another way), then self-signed will work, although it should be possible for the end-user to specify to require a specific server certificate (and adding this information into the URL would make it possible to pass a URL that includes this information, which may sometimes be helpful).

Web of trust for X.509 certificates is something that I had thought of, and I had some ideas to make up a file format for that purpose. This will be a DER file which has a digital signature, and specifies hashes (and possibly other details) of certificates that you are aware of and will contain details about what parts of the certificate you trust and in what ways you trust them (e.g. you can say that you trust the common name, or that you understand a specific extension but have been unable to verify it, etc), as well as optional comments. Note that this can be used whether or not the certificate is self-signed; certificate authorities can still be used too (which still have uses, e.g. if the authority is partially being delegated).

Another problem with certificates is securely superseding them (especially self-signed certificates). X.509 does not allow to add an extra field of unsigned extensions after the signature (and an extension inside of the certificate clearly cannot sign the certificate itself, since it would interfere) (although an extra field could be added, implementations that do not understand it may reject the extra field), so this could be done in two other ways instead. One is to add an extension into the certificate specifying the superseding key (for security, this can be different than the certificate's own key, and the corresponding private key may be stored on a separate computer that is not connected to the internet and may also be passworded for additional security), and optionally links to sources of the superseding file; the superseding file is then a DER file that lists the certificates being superseded and what they are superseded by. This means that even if the keys (or other details in the certificate, such as names, or expiry dates) are changed, trusting someone else is not necessary, and no other third-party authority is needed to verify if it is actually the same person/organization, or if it is someone else who has taken over the domain name, or if spies are changing the certificate, etc.

Web of trust can be used together with superseding certificates.

DANE would also be a good thing to use, although it won't help by itself, for many reasons. For example, in case the domain name is taken over by someone else or if the DNS is not itself secure (or whoever owns the DNS tampers with it). However, it can be used in combination with other methods in order to improve security.

However, I think that allowing unencrypted connections is just simpler anyways; if the user does not need or want this privacy and security compared with wasting extra computing power or whatever, or wants to use older software that does not support this version of TLS, or is connecting only to other programs on the same computer (which will have its own security mechanisms, making TLS unnecessary (except for testing purposes)), or for whatever other reason, then allowing unencrypted connections is helpful, especially for read-only public data. Integrity can often be verified better in ways other than TLS anyways, as I had mentioned. I think there are many reasons why unencrypted connections should remain an option where possible; however, servers and clients should be made to allow TLS where possible, too, in case you do want this security, but it should not normally be mandatory (especially for read-only public data).

Re: Plain Vanilla Web

#668
post #433

Earlier quoted context omitted.

> People romanticize businesses like this but there’s a reason you’re not posting the link You are correct that I was a worried about an HN hug of orders for brass tacks. > I guess I’ve spent enough time dealing with things like non-payment or doing work for trades that never arrive that I just don’t romanticize this stuff any more. In this case there isn't much of a choice. When the last manufacture of brass tacks c…

> I understand your sentiment but it was perfectly normal to pump gas before paying in the U.S. for a very long time and still is in many places. I had a friend who worked at a gas station in high school. Filing police reports for people who filled up and left without paying was a standard part of operations. This was in a nice area, too. Often people just forgot and drove away. They had recourse because they had sec…

til you have to pay for your fuel before filling up in the USA.

Re: Plain Vanilla Web

#669
post #31

Earlier quoted context omitted.

You can get smooth transitions with just css too with @view-transition https://developer.mozilla.org/en-US/docs/Web/CSS/@view-trans...

This feels like bringing the annoying transitions people used to use between slides in PowerPoint to the web. There's nothing smooth about the transition in the linked demo, it's quite jarring.

The point is there's no reload flash as you switch between pages. The specific transition is up to the author.

Re: Plain Vanilla Web

#670

Earlier quoted context omitted.

Holy moly, that's pretentious. I was genuinely curious because i never faced the kind of issue a web development team would have, it wasn't about counter argumenting. You could have just said "x and y".

I'm not trying to be pretentious, but wrangling an HN thread is hard and I don't have time to get into an argument about a bunch of different implementation details. Rather than just ignore your post I decided to respond explaining why I couldn't answer. The only valid short answer is what I said: that it really depends on the details and how they all work together. I truly can't give you features in isolation that w…

Well thank you for at least being willing to reason.

I get its complicated, wasn't trying to nail you or web framework.

Post reply on HN