Show HN: A JavaScript UI library for imperative JSX
The @matry/dom npm package introduces a web framework for imperative JSX, aiming to enhance UI engineering by offering a more imperative approach compared to React. It provides control over rendering and flexibility in UI design. Developers are cautioned against using it in production before version 1.0.0.
Read original articleThe @matry/dom npm package offers a web framework for imperative JSX, providing a new approach to UI engineering. Created initially for the Matry editor, it is now available under the MIT license for broader use. The framework aims to address issues with React, offering a more imperative way to create and update the DOM using JSX. By providing functions like Replace, Append, and Set Content, developers can maintain declarative UI while keeping business logic imperative. Matry allows for complete control over rendering, enabling high performance and compatibility with common libraries. While it introduces new concepts and considerations compared to React, it offers advantages such as platform-oriented thinking and flexibility in UI design. Developers are advised not to use Matry in production until version 1.0.0 and can look forward to upcoming features like TypeScript support and enhanced functionality for SSR. Installation and configuration with Vite are recommended for getting started with Matry.
Related
AdonisJS
AdonisJS is a TypeScript-first web framework for Node.js, emphasizing type-safety, intellisense, and performance. It offers testing support, official packages like Lucid for SQL ORM, Auth for authentication, and a vibrant community.
Understanding React Compiler
React's core architecture simplifies development but can lead to performance issues. The React team introduced the React Compiler to automate performance tuning by rewriting code. Transpilers like Babel convert JSX for efficiency. Compilers, transpilers, and optimizers analyze and produce equivalent code. React Compiler enhances functionality using Abstract Syntax Trees, memoization, and hook storage for optimized performance.
Show HN: OSS React Components for Dashboards
Installing Tremor Raw for React v18.2.0+ with Tailwind CSS v3.4+. Compatible with Next.js, Vite, Remix. Resources: Tremor Blocks, Figma UI Kit, Remix Icon. Footer: bug reporting, Tremor Labs, Inc. rights.
Enhancing New York Times Web Performance with React 18
The New York Times upgraded to React 18 for better performance and new features like Concurrent Mode and server-side rendering. Challenges with "embedded interactives" were overcome, leading to improved website performance.
Ant Design – the second most popular React UI framework
Ant Design is a React UI library on GitHub, featuring enterprise-level UI design components in TypeScript. It supports multilingual features and enables extensive theme customization via CSS-in-JS.
As others have hinted at, this feels like jQuery with different syntax and more limitations. In its current form, I can't imagine choosing this over jQuery (in part because I already know jQuery, and in part because the limited reach of your selectors feels like it would be a roadblock very quickly).
Perhaps you could reshape this to be an extension of jQuery, where this alternative jsx syntax is available if you want it, but the full power of jQuery's selectors is also available (without having to mix two libraries with overlapping purpose)?
That aside, I can't imagine abandoning React for this. That would feel like a step backwards to me. IMO, the most valuable thing React brought to the ecosystem is a simple way to make reusable components. Much of React's convenience is because of its functional nature: each component instance has an isolated scope/context, making it easy to reason over the behavior of a small widget without worrying about external effects from the larger application.
From what I can see in your examples, you're relying on things like global identifiers/keys, which I think leads to a mess in a large application. Take your counter example: what if my application needs 5 such counters? Can I do this without significant code duplication? I could probably wrap it in a function, but I'd likely need to pass in some unique id to distinguish between the 5 usages. This is a huge part of what React does for you, just keeping track of which component instances go where in the DOM (without needing DOM `id`s everywhere).
It could be that I'm missing something. It'd be great to see some larger examples of a more complex application with widget reuse, to see how that feels.
Also look into SolidJS for dropping the "functional" component model while still retaining JSX - it looks similar to React but works more like Vue, running components as setup functions only on initial render and doing state updates with mutations via signals.
Back in the jQuery days, a lot of my hatred towards "JavaScript" was actually imperative UI code in hindsight. In the years since, I now enjoy declarative UI more but see some developers bang their head against declarative UI frameworks. It's an interesting contrast.
And here's an app built using this lib: https://github.com/wisercoder/eureka/tree/master/webapp/Clie...
(Not trying to discourage you, just linking it)
That's one of the main points of templating in the first place: to write the code for a piece of output once, with all of the bindings that can affect it.
What happens here if you update the JSX for an element in one place and forget to do so in the others?
I don’t understand this premise at all. Are you saying your UI should be shaped by your application state? That doesn’t make any sense to me, surely the application state exists to implement a desired UI?
setContent(css`p[key=counter]{ content: 'The count is ${count}'}; }`);
Related
AdonisJS
AdonisJS is a TypeScript-first web framework for Node.js, emphasizing type-safety, intellisense, and performance. It offers testing support, official packages like Lucid for SQL ORM, Auth for authentication, and a vibrant community.
Understanding React Compiler
React's core architecture simplifies development but can lead to performance issues. The React team introduced the React Compiler to automate performance tuning by rewriting code. Transpilers like Babel convert JSX for efficiency. Compilers, transpilers, and optimizers analyze and produce equivalent code. React Compiler enhances functionality using Abstract Syntax Trees, memoization, and hook storage for optimized performance.
Show HN: OSS React Components for Dashboards
Installing Tremor Raw for React v18.2.0+ with Tailwind CSS v3.4+. Compatible with Next.js, Vite, Remix. Resources: Tremor Blocks, Figma UI Kit, Remix Icon. Footer: bug reporting, Tremor Labs, Inc. rights.
Enhancing New York Times Web Performance with React 18
The New York Times upgraded to React 18 for better performance and new features like Concurrent Mode and server-side rendering. Challenges with "embedded interactives" were overcome, leading to improved website performance.
Ant Design – the second most popular React UI framework
Ant Design is a React UI library on GitHub, featuring enterprise-level UI design components in TypeScript. It supports multilingual features and enables extensive theme customization via CSS-in-JS.