Earlier quoted context omitted.
You don't "need" an application framework. People have been building websites (even SPAs) before the 2010s and they didn't "need" these frameworks. Given what we know today, I'll grant you that in some cases people would want to use a framework, but it's hardly a necessity unless the context provides more specific requirements.
Its can be convenient to have some kind of reusable conponents. Like listviews wtih certain functionality. Same for routing. Caching etc.
jQuery v4.0 Beta
321–330 of 404 posts
Re: jQuery v4.0 Beta
#322Earlier quoted context omitted.
No, the "industry" is not going to move away from React (or Vue or Solid or Svelte), but idiots on HackerNews (and Reddit and Twitter and Mastodon, etc) might finally stop conflating web SITES and web APPS. One can dream.
From the guidelines: "Be kind. Don't be snarky. Converse curiously; don't cross-examine. Edit out swipes."
Re: jQuery v4.0 Beta
#323Earlier quoted context omitted.
I don't know what you think that link shows (I don't know what John thought it showed, either—it's a classic "talking to one's own head, instead of who you're trying to communicate with" situation, and David Baron's confusion on the mailing list at the time is understandable). To reiterate: > The argument for querySelector / querySelectorAll calls is literally mimicked from John Resig's grounbreaking API design No, i…
Using CSS to select elements within the browser arguably only became popular because of jQuery, (and Prototype, Mojo, etc.). The browser inbuilt suggestion at the time was to programmatically navigate the DOM, or maybe use XPath. Proposing CSS selectors as a browser API before it became dominant in the wild via alternatives would have got a "why do we need another option?" response.
Re: jQuery v4.0 Beta
#324For the functions that are being removed, is there a list of the native replacements. eg $.isNumeric() == parseFloat() ?
A guide would be nice but you can always look at the jQuery implementations. isNumeric: https://github.com/jquery/jquery/blob/bf48c21d225c31f0f9b544...
Re: jQuery v4.0 Beta
#325So I am super glad to read that jquery continues to be so relevant even now. And am glad my cofounder and CTO always continued to back this rather than looked at moving the stack.
Re: jQuery v4.0 Beta
#326Awesome. My problem is I've been waiting for 4.0 soooo long I ended up making my own jQuery with some key differences: * Animations, tweens, timelines use pure CSS, instead of jQuery's custom system. * Use one element or lists transparently. * Inline Locality of Behavior. No more inventing unique "one time" names. * Vanilla first. Zero dependencies. 1 file. Under 340 lines. https://github.com/gnat/surreal That said,…
Do you have an article/screencast on how the locality of behavior is implemented in both surreal and its companion project css-scope-inline? I'd love to understand it so I can maintain it longterm and add it to my own projects.
I'd love to talk with you about your philosophy of the web. I think we could sync up about some things!
Re: jQuery v4.0 Beta
#327For those of you who are curious what drives jQuery in 2024 and beyond, you need to remember that WordPress is still more than 1/3 of the web, and the majority of installations and so many plugins critically rely on jQuery. Yes, seriously. Any advances to removing deprecated APIs or functions are great. jQuery will probably be around dominantly on the web for years to come.
I was going to post on HN not long ago and didn't, about how I still can't find a great event chain handling / bubbling model that lets me use both DOM members and abstract class instances to trigger interchangeable events. I've built my own event dispatchers here and there, but jQuery just does everything right. Although event handling is almost the only thing I still use jQuery for, it's so useful that I still incl…
document.querySelector('#something').dispatchEvent(
new CustomEvent('myCustomEvent', {...options})
);
and document.querySelector('#something-else').addEventListener('myCustomEvent', () => {...});
You don't even need CustomEvents if you don't need to carry extra data with the event. You can just do new Event('myCustomEvent')
and dispatch it.For triggering 'click' events and such, you can create and dispatch native events, as described here [1].
More verbose than jquery, like most native DOM APIs, but works well.
If you're not dealing with a DOM element and just need to dispatch/listen from a class, try out EventTarget [2]?
Your class can inherit from EventTarget, and it gets dispatchEvent and addEventListener, just like a DOM element and you can use any of the above things with it:
class Test extends EventTarget {
...
}
let foo = new Test();
foo.dispatchEvent(...);
[1] https://developer.mozilla.org/en-US/docs/Web/Events/Creating...[2] https://developer.mozilla.org/en-US/docs/Web/API/EventTarget
Re: jQuery v4.0 Beta
#328Earlier quoted context omitted.
You don’t run your JS through babel or minification?
why would I? for a small project those efficiencies wont make a difference on my $20 godaddy hosting account. i dont want some tool or process getting in my way. if i have a problem then i will look for a solution.
I do like SPA also, but some of the nicest projects I've worked with could be run locally by launching `python3 -m http.server 8008' on the right folder.
I'm happier when I can do something without a processing step, or the need for a package.json. Need a third-party script? Vendor it, and never have to worry about supply-chain attacks.
Re: jQuery v4.0 Beta
#329Earlier quoted context omitted.
The fact that Wordpress runs so much of the web sometimes wakes me in a cold sweat. If you're a dev worth their salt and knows proven engineering and design patterns, then Wordpress code is absolutely terrifying to look through.
See comments like yours do that for me. I will see you in the 30 meetings needed for the new form on the contact page.
Maybe on meeting 27 they will put the damn thing on and save themselves the headache of getting out of RBLs.
If theres one thing WP developers cant write its contact forms! :)
P.S. Wordpress is fine in general.
Re: jQuery v4.0 Beta
#330Earlier quoted context omitted.
This very much depends on what you are building and how experienced you are. If you just want a few pages, no need for background workers or database migrations, PHP is still the king. You download one of many single-executable LAMP servers, and start writing your index.php. Deploy? Just copy files to server. Zero downtime deploy? Copy files to server and use symlink to atomically switch versions. Dependencies? Compo…
PHP is great for getting started, but I think it gives you a fundamentally flawed idea of how the web works. You tend to think in files, and not worry about what Apache or Nginx are actually doing. Then when you switch to node, or basically any other language, you wonder where your file based logic is, and everything feels annoying and painful. Do you really need to host your own server to run a single file? Yes, you…
Nowadays the basics are just abstracted away and talking with developers today who might even have never seen the basic version of an on old-school Webserver or a simple HTTP request executed manually via telnet runs sometimes into really weird error and root causes analysis.
So sometimes I wish the younger developers would know a bit more from the old world while the older developers now a bit more of the new world of web technologies (apache and a cgi driven bash script are not always the best solution even if you can squeeze ultimately everything into making even that work depending on your time and sadistic level :-)).
Most of the modern solutions out there have been developed to solve very specific problems for a certain group of people (see the difference between React and Angular in that regard) and not always the solution everyone seems to use is the best for your problem, team and business.