8 ms·
Xeact 0.0.69: A Revolutionary Femtoframework for High Efficiency JavaScript Dev
- jalino23 5y agois this a joke.
- raimondious 5y agoYes
- throwawaybutwhy 5y agoProbably not. These are the corners of the Internet one would rather not visit.
- raimondious 5y agoOh no
- deleted 5y ago[deleted]
- BigJono 5y agoI like it. I doubt I'd go back to a framework where the user's code is responsible for managing the DOM though. I feel like with this you either end up with a bit of "clear and repopulate" boilerplate for each component, or you build half of React yourself (state and automatic rerendering). It feels more like half of a solution to a single problem rather than complete solutions to a smaller number of problems (relative to React). I'd probably compare this to something like Preact, which is relatively lean. The React API has always been very simple already. It's just all the other stuff people use with it that's the problem.
- xena 5y agoAuthor of the post here, yeah for the admin tooling that I derived this from I actually do use "components" (functions that turn javascript objects from an API into HTML elements), but the real reason I discovered this was because I wanted to do it in a way that my Haskell and Rust-ruined brain could grok. I have a hard time with React's reverse PHP stuff but have no problem translating what I can conceptualize the DOM as in my mind into Javascript syntax using this (admittedly clunky) set of wrappers. Consider code like this: let content = div({}, [ h3(feed.title), ul(feed.items.map(item => li([ahref(item.url, item.title)]))) ]); This kind of stuff is way easier for me to deal with than the equivalent in JSX. I don't know why, but It Works For Me :tm:. It also has the advantage of not requiring a separate build step so you can just slap it into a Go binary with a go:embed directive and you're off to the races. Plus as far as I understand it's fairly idiomatic for people to reinvent their own JavaScript frameworks for when they need something between JQuery and React. Xeact (zi-act) is designed to fill that gap. Serve with laundry sauce.
- gorgoiler 5y agoYou might be interested to know that in the alternate universe of Phabricator — the magnum opus of a PHP codebase that is the fourth cousin twice removed of Facebook’s internal PHP stack — there was a function not unlike the one you describe: https://github.com/phacility/libphutil/blob/034cf7cc39940b935e83923dbb1bacbcfe645a85/src/markup/render.php#L24 https://github.com/phacility/libphutil/blob/034cf7cc39940b93... It’s verbose but I learned a lot from it. For example, returning a more specific type than String can eliminate a large class of security / escaping bugs.
- deleted 5y ago[deleted]
- andrewstuart 5y agoI don't know this seems to be snark but it's not entirely clear. They're not happy with React for some reason? If it's real then they've not explained what's good about this. If it's trying to say that vanilla JavaScript does the same thing as React then that's not right. The humour is too indirect/subtle to be clear.
- xena 5y agoAuthor of the post here: If you are not sure this is serious or not I have succeeded at creating enough surrealism to make you not sure. RE: React, to quote my own post: > All the tools require me to do so much bullshit to get them to even compile. I shouldn't need to compile JavaScript to JavaScript in order to deploy stuff to a webpage. I don't want to give Facebook a grant to any patents I end up creating.
- andrewstuart 5y agoYeah I read the patents thing and decided this couldn't be serious because you don't need to grant facebook patents to use React. Saying things like that doesn't give the post credibility, just snark. If I'm wrong, then please show the credible references with links. >>All the tools require me to do so much bullshit to get them to even compile. This is flat out wrong too unless you're referring to the situation pre 2016 before Create React App. It's false information. There's better and more valid criticisms of React such as for example why does it hijack CSS when it really absolutely does not need to and this causes all sorts of problems.
- neetle 5y agoThis library can be dropped into the headers of a html file to be used, rather than a compile step via Create React App. Create React App is likely one of the issues.
- KrishnaShripad 5y agoYou can do the same with React as well.
- xmlninja 5y ago"there are too many tools just to create some html these days, so I created another one" No deal.
- cxr 5y agoAs popular is it has become on Twitter and other social media to react to a piece by manufacturing quotes, it's against the rules here.
- gorgoiler 5y agoVery nice. I’ve been coding for decades and love how much you can learn in just a few seconds from collaborating with someone or in this just looking at their code: https://raw.githubusercontent.com/Xe/Xeact/main/xeact.js https://raw.githubusercontent.com/Xe/Xeact/main/xeact.js New things: * Array.from instead of the old Array.prototype.slice.call salad * Object.assign(x, {}) — ooh shiny! * append(...with_a_splat /* ! */)
- stoned 5y ago> All the tools require me to do so much bullshit to get them to even compile. I shouldn't need to compile JavaScript to JavaScript in order to deploy stuff to a webpage. I've never understood why this is deemed such a big ask by so many people. You can either compile JS-to-JS or have your JS break when it encounters an old browser (which is exceedingly rare, these days, so you don't really need to compile JS-to-JS. Most of the "bullshit" [aka tooling] these days bundles and optimizes your JS). Many languages have compilers that you need to run. Before running a Java program, you need to compile it. And compiling things with `javac` is hardly simple. You need to populate your classpath, configure all kinds of stuff. It's not trivial. So why is it such a big deal when you need to do the same thing when making a webapp? To make meaningful, portable applications in JS, you need to use a compiler. That's both due to the varying runtimes your code will encounter, and due to the fact that your application consists of many files that benefit from being compiled together by tooling versus by you, by hand. Configuring such a compiler (webpack, parcel, rollup, etc) can be of varying levels of complexity. Next.js makes starting a webapp trivial. It's what create-react-app should be. Yeah, if you want to just make an HTML, that's fine, you can just roll some JS and it'll probably work in most browsers. But if you're making an application, then it makes sense to start using some tooling. When has this not been the case in web development? Even before client-side apps really took off, getting your server-driven HTML-emitting application going was hardly simple.
- gorgoiler 5y agoYou present two choices: 1/ no compilation step during development, but it breaks old browsers; 2/ continuous compilation while developing so that you support old browsers; …but there ought to be a third option that would satisfy everyone: 3/ no compilation while developing, and one compile step at release time to support older browsers.
- xena 5y agoIronically this is the kind of thing that ES6 modules actually solves. It's even better if your tool is internal-facing only so that you don't have to bother with the release time older browser compatibility thing.
- deleted 5y ago[deleted]
- sgammon 5y agowake me up when compilers are cool again, we are apparently back to re discovering vanilla js as-a-framework