Is React a Framework? Software Engineer Answering

By definition – React is one of the most popular JavaScript UI libraries nowadays. It comes in second place after jQuery among all web frameworks! React’s popularity has grown rapidly thanks to a simple and declarative API that allows you to build high-performance applications, and that momentum keeps growing. Still, there is often discussion and questioning that React is a framework or library.

Firstly, let’s look what the differents between framework and library? 

The framework belongs to the main() function. It executes some functions, e.g. controlling a collection of windows on the screen. The framework can, in principle, work even if you have not set it up in any way. It does something, e.g. it places an empty window with default widgets. The framework defines the general nature of the program, and your code provides a specific setting. These settings can be very significant, as both a word processor and a spreadsheet can be created using the same framework.

The library is the set of tools used by your code. Your code belongs to the main() and provides the overall structure of the program. A library performs some specific task, such as sending traffic over a network, drawing charts, or something else. The library can do big things, like draw a view of a three-dimensional space full of objects, but only after you tell it about those objects.

The framework can call your code, which in turn calls the library. But your code never calls the framework, except perhaps for system() or exec() functions.

But, is React a Framework? 

We asked our Software Engineers Team for their opinion and they were split into two parts: some maintain the view that React is a library, and others assign it as a Framework. Here are the most outstanding opinions:

From my point of view, React is not a framework, it’s just a library with no specific requirements for project structure. It’s about describing the abstractions of your application, logic, routing, data exchange, and so on. And React simplifies the work with this data, and optimizes the work with it

Anton M. – Software Engineer at Flatlogic.com

From my point of view, React is not a framework, it’s just a library with no specific requirements for project structure. It’s about describing the abstractions of your application, logic, routing, data exchange, and so on. And React simplifies the work with this data, and optimizes the work with it

I know that react calls itself a “library”, and a lot of developers prefer to react to the home page with the title “library”. However, I think that React is more like a framework now, with different targets like web, react native, etc. And the foundation of React is JSX, which is crucial for proper developer experience, and requires a build step, so you can’t just slap a bunch of JSX files into a browser and call it a day. Nowadays when you say “I built this app with React” you don’t mean that you used it on one page or as a modern jquery alternative. You mean that you built everything around react, with its ecosystem, its best practices, etc. And with all those points in mind, I’d rather call react the framework, than a library

Viktor S. – Staff Engineer at Flatlogic.com

We also conducted the research among others software engineers and would like to share with you the most impressive arguments on this point. 

So, is React a Framework or a Library?

React is a Library

React is a JavaScript library for building user interfaces. It is maintained by Facebook and a community of individual developers and companies. React can be used as a base in the development of single-page or mobile applications.

Now Why Library, not a Framework?

different definitions for library and framework:

a framework is a software where you plug your code into
a library is a software that you plug into your code

In terms of this definition, React is a framework. But some people, especially in the frontend world, say a framework has to bring stuff like routers and/or widgets, etc. 

So Angular, and ExtJS are frameworks, but React isn’t, because it only gives you the means to build components and render them into the DOM.

Let’s make it simple, in React we have to include packages for everything it’s not necessary but yes we can add them, thus React is a Library but if we are not given an option to do so with our code then that’s a framework like Angular and Vue.

React is a library because it’s only supposed to deal with the view part of the eco-system, and you can integrate it easily in any project you’re working on currently, it’s something like jQuery, it only helps you with organizing your views into reusable components, of course, the performance is one of the best things about React, especially with the new Fiber algorithm, things will be faster seeing the scheduler mechanism, unlike Angular, it’s a framework that gives you everything you need, most of the things are already built-in, for React you need to create your own/or grab some modules from npm to add extra functionality as need per your project.

It depends on how you use it. If you’re writing a small program and you structure your program around working with React, you are probably thinking of React as a framework.

If you have a big program and you use React as a small part of it just for handling output, then you’re probably thinking of React as a library.

If your program is 90% user interface, and not only your program structure but your data structures are shaped to fit the React system, then you may even think of React as a language. Hey, if TypeScript can be a language, why not React?

React is a library, cause it has mostly evolved into a vast ecosystem that is barely distinguishable from a framework. A framework protects the edges, whereas a library provides a tool for doing certain tasks. React handles exactly one task: abstracted Web Components. It offers an internal state, lifecycles, and external properties, as well as a renderer for a browser or comparable environment through ReactDOM – and nothing more.

This has a few advantages: it is smaller than a full-featured framework, has fewer opinions on how to address problems, and so provides more options.

I’d say React is a library posing as a framework. It feels like working in a framework (esp. with JSX, though using that is optional), but under the hood, it is just a library. This definition is quite good:

a framework is software that you plug your code into (e.g. you work “inside” it).
a library is software that you plug into your code (e.g. you “hand-off” certain tasks to it, or build “on top” of it).

React feels like the first, but is the second. The attached video compares React and Angular and hints at the distinction. Since React treats your code as a black box, you can push the data-binding concerns out to the edges of your system, to be “handed off” to React (i.e. how you would use a library). Angular, on the other hand, forces you to work “inside” their “scopes” using their “directives” to handle data-binding. In Angular, you are passing your data through scopes that observe your data model. You are always at the mercy of whichever directives they are building into their framework scaffolding. You are also working “inside” HTML (JS-in-HTML), with all the constraints that impose (giving more of a framework feeling). But with React, you have less of that feeling, since you have freedom (full power of JS), and can build “on top” of React (HTML/JSX-in-JS). This is good since JS is inherently more powerful than HTML.

React is a Framework

React is a framework. Honestly caring about the difference between a library and a framework is a bit pedantic, so I’d say you can call it either. Having said that, my definitions of the two words are that a library is a collection of functions, and a framework is a way of doing things.

By this definition, React is a framework because it forces you to build UI in the React way instead of the Angular, etc. On the other hand, the dash is a perfect example of a library because it’s just a collection of functions, use them however you want.

JavaScript is known for its abundance of new plugins, frameworks, and other things created by its massive community of developers and designers.

You must be wondering what this fact has to do with the React JS framework and other frameworks. The truth is that many of the leading IT firms have already embraced JavaScript and leveraged its benefits.

That should answer the question and not cause any other debates, right? Well, not exactly; the debate over Is React a framework or library? is as strong as ever.

Over the years, developers, software engineers, and developer communities came up with pros and cons related to the status of React as a library or React as a framework. Let’s analyze them together.

React as a library

React can be easily swapped by some other javascript library offering similar functionalities.
React can be easily plugged into an existing technology stack – and that’s the definition of a library.

React as a framework

Related libraries must work in an opinionated way.
Because of its state and lifecycle on the components, you inverted the control to React.

Are you asking why React was designed as a library and not a framework [1] or why it is classified as a library and not a framework [2]?

[1] Why it was built that way. A library is something you can add to an existing project to enhance it. It does not impose any restrictions or conventions on your application design and you can supplement it with other libraries of your choice to flesh out your application. There is also a shorter learning curve (usually) on a library as you can add it incrementally to your project. A framework on the other hand implies structure and convention, you need to follow the conventions of the framework. In many cases a framework limits you to working within these conventions – you cannot (or it is difficult) to mix a framework with other code.

There are use cases for each.

[2] Why it is not classified as a framework. Based on the definition of a framework it does not fit the bill – it is a library that is added to your code – it does not impose structure – beyond the use of the library itself and it can be mixed in with other code.

React does not solve any structural or architectural problems on the app level. It provides us with a set of methods for better (in my opinion) handling of the front-end. I remember when jQuery did that back in the day, and how that started the revolution… React is now doing the same, just better.

Because React is a library eventually we got Flux and Redux. Both of them are handling real-world problems that come alongside Scaling. Mare library does not think about that.

React is a framework because Redux is referencing it as one (Source). Ah, as I started to hope that something in life is going to be easy. With React and Redux there is a clear layer of separation between the view and data. That is why React is not a complete framework to solve the entire problem.

Conclusion

Soft engineers spend a lot of time talking about what React is. The answer is important for any React soft engineer, no matter their skill level. That is because it indicates what they should know and how they should work when developing any React application. Depending on who you are, a beginner or an advanced React soft engineer, I hope this thoughtful research will improve your development process as you build your next React project.

The post Is React a Framework? Software Engineer Answering appeared first on Flatlogic Blog.

Flatlogic Admin Templates banner

React Material Admin Full Update

As Material UI and React continue to grow and develop it has become clear that React Material Admin can’t live with the outdated versions of those libraries.

What products are affected by the update?

Currently, the updates were released on 2 products:

React Material Admin Full
React Material UI Admin Node.js

What has changed?

The main change is that now those templates are now using React 17 and Material UI 5, previously it was 16 and 4 versions accordingly.

And also we made several minor changes that make this admin dashboard template up-to-date.

Fullcalendar was updated to the 5.11 version
Added Datefns as datepicker library
Updated Apexcharts to version 3.35
Updated Formik library to the latest stable version
Mui-datatables library was updated to version 4
We have added Redux for management CRUD functions and authorization

As a result, the speed and usability of the React Material Admin template increased. Additionally, you don’t need to spend your time updating all those technologies by yourself, so you can focus on developing business features.

Moving forward and Summing Up

The ecosystem of our templates will be constantly updating. Next in line are Vue Material Admin and Angular Material Admin. Additionally, we are working on integrating some of the existing UI components from React Material Admin to the Flatlogic Platform generated react app.

For the rest of our React templates, check our marketplace. If you face any difficulties setting up this or that template or admin dashboard, please feel free to leave us a message on our forumTwitter or Facebook. We will respond to your inquiry as quickly as possible!

Happy developing!

The post React Material Admin Full Update appeared first on Flatlogic Blog.

Flatlogic Admin Templates banner

React v18.0

React 18 is now available on npm!

In our last post, we shared step-by-step instructions for upgrading your app to React 18. In this post, we’ll give an overview of what’s new in React 18, and what it means for the future.

Our latest major version includes out-of-the-box improvements like automatic batching, new APIs like startTransition, and streaming server-side rendering with support for Suspense.

Many of the features in React 18 are built on top of our new concurrent renderer, a behind-the-scenes change that unlocks powerful new capabilities. Concurrent React is opt-in — it’s only enabled when you use a concurrent feature — but we think it will have a big impact on the way people build applications.

We’ve spent years researching and developing support for concurrency in React, and we’ve taken extra care to provide a gradual adoption path for existing users. Last summer, we formed the React 18 Working Group to gather feedback from experts in the community and ensure a smooth upgrade experience for the entire React ecosystem.

In case you missed it, we shared a lot of this vision at React Conf 2021:

In the keynote, we explain how React 18 fits into our mission to make it easy for developers to build great user experiences

Shruti Kapoor demonstrated how to use the new features in React 18

Shaundai Person gave us an overview of streaming server rendering with Suspense

Below is a full overview of what to expect in this release, starting with Concurrent Rendering.

Note for React Native users: React 18 will ship in React Native with the New React Native Architecture. For more information, see the React Conf keynote here.

What is Concurrent React?

The most important addition in React 18 is something we hope you never have to think about: concurrency. We think this is largely true for application developers, though the story may be a bit more complicated for library maintainers.

Concurrency is not a feature, per se. It’s a new behind-the-scenes mechanism that enables React to prepare multiple versions of your UI at the same time. You can think of concurrency as an implementation detail — it’s valuable because of the features that it unlocks. React uses sophisticated techniques in its internal implementation, like priority queues and multiple buffering. But you won’t see those concepts anywhere in our public APIs.

When we design APIs, we try to hide implementation details from developers. As a React developer, you focus on what you want the user experience to look like, and React handles how to deliver that experience. So we don’t expect React developers to know how concurrency works under the hood.

However, Concurrent React is more important than a typical implementation detail — it’s a foundational update to React’s core rendering model. So while it’s not super important to know how concurrency works, it may be worth knowing what it is at a high level.

A key property of Concurrent React is that rendering is interruptible. When you first upgrade to React 18, before adding any concurrent features, updates are rendered the same as in previous versions of React — in a single, uninterrupted, synchronous transaction. With synchronous rendering, once an update starts rendering, nothing can interrupt it until the user can see the result on screen.

In a concurrent render, this is not always the case. React may start rendering an update, pause in the middle, then continue later. It may even abandon an in-progress render altogether. React guarantees that the UI will appear consistent even if a render is interrupted. To do this, it waits to perform DOM mutations until the end, once the entire tree has been evaluated. With this capability, React can prepare new screens in the background without blocking the main thread. This means the UI can respond immediately to user input even if it’s in the middle of a large rendering task, creating a fluid user experience.

Another example is reusable state. Concurrent React can remove sections of the UI from the screen, then add them back later while reusing the previous state. For example, when a user tabs away from a screen and back, React should be able to restore the previous screen in the same state it was in before. In an upcoming minor, we’re planning to add a new component called <Offscreen> that implements this pattern. Similarly, you’ll be able to use Offscreen to prepare new UI in the background so that it’s ready before the user reveals it.

Concurrent rendering is a powerful new tool in React and most of our new features are built to take advantage of it, including Suspense, transitions, and streaming server rendering. But React 18 is just the beginning of what we aim to build on this new foundation.

Gradually Adopting Concurrent Features

Technically, concurrent rendering is a breaking change. Because concurrent rendering is interruptible, components behave slightly differently when it is enabled.

In our testing, we’ve upgraded thousands of components to React 18. What we’ve found is that nearly all existing components “just work” with concurrent rendering, without any changes. However, some of them may require some additional migration effort. Although the changes are usually small, you’ll still have the ability to make them at your own pace. The new rendering behavior in React 18 is only enabled in the parts of your app that use new features.

The overall upgrade strategy is to get your application running on React 18 without breaking existing code. Then you can gradually start adding concurrent features at your own pace. You can use <StrictMode> to help surface concurrency-related bugs during development. Strict Mode doesn’t affect production behavior, but during development it will log extra warnings and double-invoke functions that are expected to be idempotent. It won’t catch everything, but it’s effective at preventing the most common types of mistakes.

After you upgrade to React 18, you’ll be able to start using concurrent features immediately. For example, you can use startTransition to navigate between screens without blocking user input. Or useDeferredValue to throttle expensive re-renders.

However, long term, we expect the main way you’ll add concurrency to your app is by using a concurrent-enabled library or framework. In most cases, you won’t interact with concurrent APIs directly. For example, instead of developers calling startTransition whenever they navigate to a new screen, router libraries will automatically wrap navigations in startTransition.

It may take some time for libraries to upgrade to be concurrent compatible. We’ve provided new APIs to make it easier for libraries to take advantage of concurrent features. In the meantime, please be patient with maintainers as we work to gradually migrate the React ecosystem.

For more info, see our previous post: How to upgrade to React 18.

Suspense in Data Frameworks

In React 18, you can start using Suspense for data fetching in opinionated frameworks like Relay, Next, Hydrogen, or Remix. Ad hoc data fetching with Suspense is technically possible, but still not recommended as a general strategy.

In the future, we may expose additional primitives that could make it easier to access your data with Suspense, perhaps without the use an opinionated framework. However, Suspense works best when it’s deeply integrated into your application’s architecture: your router, your data layer, and your server rendering environment. So even long term, we expect that libraries and frameworks will play a crucial role in the React ecosystem.

As in previous versions of React, you can also use Suspense for code splitting on the client with React.lazy. But our vision for Suspense has always been about much more than loading code — the goal is to extend support for Suspense so that eventually, the same declarative Suspense fallback can handle any asynchronous operation (loading code, data, images, etc).

Server Components is Still in Development

Server Components is an upcoming feature that allows developers to build apps that span the server and client, combining the rich interactivity of client-side apps with the improved performance of traditional server rendering. Server Components is not inherently coupled to Concurrent React, but it’s designed to work best with concurrent features like Suspense and streaming server rendering.

Server Components is still experimental, but we expect to release an initial version in a minor 18.x release. In the meantime, we’re working with frameworks like Next, Hydrogen, and Remix to advance the proposal and get it ready for broad adoption.

What’s New in React 18

New Feature: Automatic Batching

Batching is when React groups multiple state updates into a single re-render for better performance. Without automatic batching, we only batched updates inside React event handlers. Updates inside of promises, setTimeout, native event handlers, or any other event were not batched in React by default. With automatic batching, these updates will be batched automatically:

// Before: only React events were batched.
setTimeout(() => {
setCount(c => c + 1);
setFlag(f => !f);
// React will render twice, once for each state update (no batching)
}, 1000);

// After: updates inside of timeouts, promises,
// native event handlers or any other event are batched.`
setTimeout(() => {
setCount(c => c + 1);
setFlag(f => !f);
// React will only re-render once at the end (that’s batching!)
}, 1000);

For more info, see this post for Automatic batching for fewer renders in React 18.

New Feature: Transitions

A transition is a new concept in React to distinguish between urgent and non-urgent updates.

Urgent updates reflect direct interaction, like typing, clicking, pressing, and so on.

Transition updates transition the UI from one view to another.

Urgent updates like typing, clicking, or pressing, need immediate response to match our intuitions about how physical objects behave. Otherwise they feel “wrong”. However, transitions are different because the user doesn’t expect to see every intermediate value on screen.

For example, when you select a filter in a dropdown, you expect the filter button itself to respond immediately when you click. However, the actual results may transition separately. A small delay would be imperceptible and often expected. And if you change the filter again before the results are done rendering, you only care to see the latest results.

Typically, for the best user experience, a single user input should result in both an urgent update and a non-urgent one. You can use startTransition API inside an input event to inform React which updates are urgent and which are “transitions”:

import {startTransition} from ‘react’;

// Urgent: Show what was typed
setInputValue(input);

// Mark any state updates inside as transitions
startTransition(() => {
// Transition: Show the results
setSearchQuery(input);
});

Updates wrapped in startTransition are handled as non-urgent and will be interrupted if more urgent updates like clicks or key presses come in. If a transition gets interrupted by the user (for example, by typing multiple characters in a row), React will throw out the stale rendering work that wasn’t finished and render only the latest update.

useTransition: a hook to start transitions, including a value to track the pending state.

startTransition: a method to start transitions when the hook cannot be used.

Transitions will opt in to concurrent rendering, which allows the update to be interrupted. If the content re-suspends, transitions also tell React to continue showing the current content while rendering the transition content in the background (see the Suspense RFC for more info).

See docs for transitions here.

New Suspense Features

Suspense lets you declaratively specify the loading state for a part of the component tree if it’s not yet ready to be displayed:

<Suspense fallback={<Spinner />}>
<Comments />
</Suspense>

Suspense makes the “UI loading state” a first-class declarative concept in the React programming model. This lets us build higher-level features on top of it.

We introduced a limited version of Suspense several years ago. However, the only supported use case was code splitting with React.lazy, and it wasn’t supported at all when rendering on the server.

In React 18, we’ve added support for Suspense on the server and expanded its capabilities using concurrent rendering features.

Suspense in React 18 works best when combined with the transition API. If you suspend during a transition, React will prevent already-visible content from being replaced by a fallback. Instead, React will delay the render until enough data has loaded to prevent a bad loading state.

For more, see the RFC for Suspense in React 18.

New Client and Server Rendering APIs

In this release we took the opportunity to redesign the APIs we expose for rendering on the client and server. These changes allow users to continue using the old APIs in React 17 mode while they upgrade to the new APIs in React 18.

React DOM Client

These new APIs are now exported from react-dom/client:

createRoot: New method to create a root to render or unmount. Use it instead of ReactDOM.render. New features in React 18 don’t work without it.

hydrateRoot: New method to hydrate a server rendered application. Use it instead of ReactDOM.hydrate in conjunction with the new React DOM Server APIs. New features in React 18 don’t work without it.

Both createRoot and hydrateRoot accept a new option called onRecoverableError in case you want to be notified when React recovers from errors during rendering or hydration for logging. By default, React will use reportError, or console.error in the older browsers.

See docs for React DOM Client here.

React DOM Server

These new APIs are now exported from react-dom/server and have full support for streaming Suspense on the server:

renderToPipeableStream: for streaming in Node environments.

renderToReadableStream: for modern edge runtime environments, such as Deno and Cloudflare workers.

The existing renderToString method keeps working but is discouraged.

See docs for React DOM Server here.

New Strict Mode Behaviors

In the future, we’d like to add a feature that allows React to add and remove sections of the UI while preserving state. For example, when a user tabs away from a screen and back, React should be able to immediately show the previous screen. To do this, React would unmount and remount trees using the same component state as before.

This feature will give React apps better performance out-of-the-box, but requires components to be resilient to effects being mounted and destroyed multiple times. Most effects will work without any changes, but some effects assume they are only mounted or destroyed once.

To help surface these issues, React 18 introduces a new development-only check to Strict Mode. This new check will automatically unmount and remount every component, whenever a component mounts for the first time, restoring the previous state on the second mount.

Before this change, React would mount the component and create the effects:

* React mounts the component.
* Layout effects are created.
* Effects are created.

With Strict Mode in React 18, React will simulate unmounting and remounting the component in development mode:

* React mounts the component.
* Layout effects are created.
* Effects are created.
* React simulates unmounting the component.
* Layout effects are destroyed.
* Effects are destroyed.
* React simulates mounting the component with the previous state.
* Layout effects are created.
* Effects are created.

See docs for ensuring resusable state here.

New Hooks

useId

useId is a new hook for generating unique IDs on both the client and server, while avoiding hydration mismatches. It is primarily useful for component libraries integrating with accessibility APIs that require unique IDs. This solves an issue that already exists in React 17 and below, but it’s even more important in React 18 because of how the new streaming server renderer delivers HTML out-of-order. See docs here.

useTransition

useTransition and startTransition let you mark some state updates as not urgent. Other state updates are considered urgent by default. React will allow urgent state updates (for example, updating a text input) to interrupt non-urgent state updates (for example, rendering a list of search results). See docs here

useDeferredValue

useDeferredValue lets you defer re-rendering a non-urgent part of the tree. It is similar to debouncing, but has a few advantages compared to it. There is no fixed time delay, so React will attempt the deferred render right after the first render is reflected on the screen. The deferred render is interruptible and doesn’t block user input. See docs here.

useSyncExternalStore

useSyncExternalStore is a new hook that allows external stores to support concurrent reads by forcing updates to the store to be synchronous. It removes the need for useEffect when implementing subscriptions to external data sources, and is recommended for any library that integrates with state external to React. See docs here.

Note

useSyncExternalStore is intended to be used by libraries, not application code.

useInsertionEffect

useInsertionEffect is a new hook that allows CSS-in-JS libraries to address performance issues of injecting styles in render. Unless you’ve already built a CSS-in-JS library we don’t expect you to ever use this. This hook will run after the DOM is mutated, but before layout effects read the new layout. This solves an issue that already exists in React 17 and below, but is even more important in React 18 because React yields to the browser during concurrent rendering, giving it a chance to recalculate layout. See docs here.

Note

useInsertionEffect is intended to be used by libraries, not application code.

Changelog

React

Add useTransition and useDeferredValue to separate urgent updates from transitions. (#10426, #10715, #15593, #15272, #15578, #15769, #17058, #18796, #19121, #19703, #19719, #19724, #20672, #20976 by @acdlite, @lunaruan, @rickhanlonii, and @sebmarkbage)
Add useId for generating unique IDs. (#17322, #18576, #22644, #22672, #21260 by @acdlite, @lunaruan, and @sebmarkbage)
Add useSyncExternalStore to help external store libraries integrate with React. (#15022, #18000, #18771, #22211, #22292, #22239, #22347, #23150 by @acdlite, @bvaughn, and @drarmstr)
Add startTransition as a version of useTransition without pending feedback. (#19696 by @rickhanlonii)
Add useInsertionEffect for CSS-in-JS libraries. (#21913 by @rickhanlonii)
Make Suspense remount layout effects when content reappears. (#19322, #19374, #19523, #20625, #21079 by @acdlite, @bvaughn, and @lunaruan)
Make <StrictMode> re-run effects to check for restorable state. (#19523 , #21418 by @bvaughn and @lunaruan)
Assume Symbols are always available. (#23348 by @sebmarkbage)
Remove object-assign polyfill. (#23351 by @sebmarkbage)
Remove unsupported unstable_changedBits API. (#20953 by @acdlite)
Allow components to render undefined. (#21869 by @rickhanlonii)
Flush useEffect resulting from discrete events like clicks synchronously. (#21150 by @acdlite)
Suspense fallback={undefined} now behaves the same as null and isn’t ignored. (#21854 by @rickhanlonii)
Consider all lazy() resolving to the same component equivalent. (#20357 by @sebmarkbage)
Don’t patch console during first render. (#22308 by @lunaruan)
Improve memory usage. (#21039 by @bgirard)
Improve messages if string coercion throws (Temporal.*, Symbol, etc.) (#22064 by @justingrant)
Use setImmediate when available over MessageChannel. (#20834 by @gaearon)
Fix context failing to propagate inside suspended trees. (#23095 by @gaearon)
Fix useReducer observing incorrect props by removing the eager bailout mechanism. (#22445 by @josephsavona)
Fix setState being ignored in Safari when appending iframes. (#23111 by @gaearon)
Fix a crash when rendering ZonedDateTime in the tree. (#20617 by @dimaqq)
Fix a crash when document is set to null in tests. (#22695 by @SimenB)
Fix onLoad not triggering when concurrent features are on. (#23316 by @gnoff)
Fix a warning when a selector returns NaN. (#23333 by @hachibeeDI)
Fix a crash when document is set to null in tests. (#22695 by @SimenB)
Fix the generated license header. (#23004 by @vitaliemiron)
Add package.json as one of the entry points. (#22954 by @Jack)
Allow suspending outside a Suspense boundary. (#23267 by @acdlite)
Log a recoverable error whenever hydration fails. (#23319 by @acdlite)

React DOM

Add createRoot and hydrateRoot. (#10239, #11225, #12117, #13732, #15502, #15532, #17035, #17165, #20669, #20748, #20888, #21072, #21417, #21652, #21687, #23207, #23385 by @acdlite, @bvaughn, @gaearon, @lunaruan, @rickhanlonii, @trueadm, and @sebmarkbage)
Add selective hydration. (#14717, #14884, #16725, #16880, #17004, #22416, #22629, #22448, #22856, #23176 by @acdlite, @gaearon, @salazarm, and @sebmarkbage)
Add aria-description to the list of known ARIA attributes. (#22142 by @mahyareb)
Add onResize event to video elements. (#21973 by @rileyjshaw)
Add imageSizes and imageSrcSet to known props. (#22550 by @eps1lon)
Allow non-string <option> children if value is provided. (#21431 by @sebmarkbage)
Fix aspectRatio style not being applied. (#21100 by @gaearon)
Warn if renderSubtreeIntoContainer is called. (#23355 by @acdlite)

React DOM Server

Add the new streaming renderer. (#14144, #20970, #21056, #21255, #21200, #21257, #21276, #22443, #22450, #23247, #24025, #24030 by @sebmarkbage)
Fix context providers in SSR when handling multiple requests. (#23171 by @frandiox)
Revert to client render on text mismatch. (#23354 by @acdlite)
Deprecate renderToNodeStream. (#23359 by @sebmarkbage)
Fix a spurious error log in the new server renderer. (#24043 by @eps1lon)
Fix a bug in the new server renderer. (#22617 by @shuding)
Ignore function and symbol values inside custom elements on the server. (#21157 by @sebmarkbage)

React DOM Test Utils

Throw when act is used in production. (#21686 by @acdlite)
Support disabling spurious act warnings with global.IS_REACT_ACT_ENVIRONMENT. (#22561 by @acdlite)
Expand act warning to cover all APIs that might schedule React work. (#22607 by @acdlite)
Make act batch updates. (#21797 by @acdlite)
Remove warning for dangling passive effects. (#22609 by @acdlite)

React Refresh

Track late-mounted roots in Fast Refresh. (#22740 by @anc95)
Add exports field to package.json. (#23087 by @otakustay)

Server Components (Experimental)

Add Server Context support. (#23244 by @salazarm)
Add lazy support. (#24068 by @gnoff)
Update webpack plugin for webpack 5 (#22739 by @michenly)
Fix a mistake in the Node loader. (#22537 by @btea)
Use globalThis instead of window for edge environments. (#22777 by @huozhi)

Flatlogic Admin Templates banner

What is Material UI

Introduction

Material-UI (MUI) is a CSS framework that provides React components out-of-the-box and follows Google’s Material Design launched in 2014. MUI makes it possible to use different components to create a UI for a company’s web and mobile apps. Google uses Material Design to guarantee that no matter how users interact with the products they use, they will have a consistent experience. Material Design includes guidelines for typography, grid, space, scale, color, images, etc. And it also allows designers to build deliberate designs with hierarchy, meaning, and a focus on results.

The MUI library for React has over 76k stars on GitHub and is one of the most improved UI libraries. You can build an incredibly stylish application in a short amount of time with pre-styled components, as well as tune and expand these components according to your needs. It is based on Leaner Style Sheets (LESS), a CSS development extension.

You can also install the MUI into your application using yarn:

yarn add @material-ui/core

or npm:

npm i @material-ui/core

Why use Material UI?

Here are the reasons why developers prefer to integrate MUI into their applications:

Pre-designed UI components. MUI supplies multiple pre-designed components from which you easily approach and attach to your application, enabling an attractive, easy-to-use, and visually engaging design and rapid implementation. 

Material Design. Material Design is a well-thought-out design system that describes the value and use cases of components. With Material Design, for example, you can use the Material Icons, meaning choosing icons that match your design system.

Adjustable theme. MUI provides simple installation and adjustment themes to use and globally implement for all components available to you, making it a highly functional and dynamic experience. By doing so, the theme color of the component, information about the palette, and surface properties, and some other styles can be customized, meaning that all your components can be consistent.

Well-structured documentation. MUI has clearly understandable and well-structured documentation, which includes guides with code examples to practice with.

Widespread support. MUI has great support for fixing bugs and issues, due to its constantly updatable library. In small releases, for all issues found, the team provides fixes. And as a user, you can participate in influencing what additions to the library will be added in the future. The team sends a feedback survey to all library developers every year in order to fix any issues and make the Material UI more usable, also you can tweet them feedback on the official account: @MaterialUI.

Community. Here you can find basic links with support and examples of using the MUI.

Who uses Material UI and its integrations?

Node.js, React, Next.js, Emotion, and etc, represent some of the most popular tools that are integrated with Material-UI. About 214 companies use Material UI in their technology stacks, here are some of them:

UNIQLO
Medium
Scale
Frontend
Google
SkyQuest Tech Stack

How to create your Material UI React application using the Flatlogic Platform

There are two ways to build your application on the Flatlogic Platform: 

Create a simple and clear frontend application, generated by the CLI framework, 

or

Build a CRUD application with frontend+backend+database.  

Creating your CRUD application with Flatlogic

Step 1. Choosing the Tech Stack

In this step, you’re setting the name of your application and choosing the stack: Frontend, Backend, and Database.

Step 2. Choosing the Starter Template

In this step, you’re choosing the design of the web app. Here you can find the Material Template for your application.

Step 3. Schema Editor

In this part you will need to know which application you want to build, that is, CRM or E-commerce, also in this part you build a database schema i.e. tables and relationships between them.

If you are not familiar with database design and it is difficult for you to understand what tables are, we have prepared several ready-made example schemas of real-world apps that you can build your app upon modification:

E-commerce app;
Time tracking app;
Books store;
Chat (messaging) app;
Blog.

Afterwards, you can deploy your application and in a few minutes, you will get a fully functional CMS for your React Application with Material Design.

Suggested Articles:

What is Angular – Flatlogic Tech Glossary
What is Webpack – Flatlogic Tech Glossary
How to Create a Vue Application [Learn the Ropes!]

The post What is Material UI appeared first on Flatlogic Blog.

Flatlogic Admin Templates banner

What is React?

Introduction

Why use React?
Virtual Document Object Model (VDOM)
JSX
React Native

Main Components
Function Components
Class Components

Benefits
Who uses React

How to build your first application on ReactHow to create your app on Reactjs from the terminal of your IDE

How to create your app with Flatlogic Platform
Creating a CRUD application with Flatlogic
Creating a one-page application with Flatlogic

Introduction: What is React

React.js was released by a software engineer working for Facebook – Jordane Walke in 2011. React is a JavaScript library focused on creating declarative user interfaces (UIs) using a component-based concept. It’s used for handling the view layer and can be used for web and mobile apps. React’s main goal is to be extensive, fast,  declarative, flexible, and simple. 

React is not a framework, it is specifically a library.  The explanation for this is that React only deals with rendering the UIs and reserves many things at the discretion of individual projects. The standard set of tools for creating an application using ReactJS is frequently called the stack.

Why use React?

Let’s take a more detailed look at what sets React library aside against other frameworks and libraries and makes it so powerful and popular for application development.

Virtual Document Object Model (VDOM)

The Document Object Model (DOM) is an API for valid HTML and well-formed XML documents.

A virtual DOM is a representation of a real DOM that is built/manipulated by browsers. Advanced libraries, such as React, generate a tree of elements in memory equivalent to the real DOM, which forms the virtual DOM in a declarative way. The virtual DOM is one of the features that make the framework so fast and reliable.

Image source: https://miro.medium.com/max/1400/1*HyoU7X-SMyT8xQD1PjrRGw.png

JSX 

React uses a syntax extension to JavaScript called JSX. We use it to create ‘elements’.

JSX uses Babel preprocessors to convert HTML-like text in JavaScript files into JavaScript objects to be parsed.

React doesn’t require the use of JSX, but most developers find that it makes for a more user-friendly experience within the JavaScript code.

We use JSX to create React components, so this is why it is an important part of ReactJS.

React Native

React Native is an open-source JavaScript framework for building apps on different platforms, such as iOS, Android, and UPD. It is React-based and gives all its greatness to mobile app development.

React Native uses JavaScript to build the UI of an application but also uses OS-native representations. It allows code to be implemented in OS-native languages (Swift and Objective-C for iOS and Java and Kotlin for Android) for more sophisticated functions.

Main components 

ReactJS is a component-based library where components make our code reusable and split our UI into different pieces. Components are divided into two types, Class components and Function components. All React components follow the separation of concerns design principle, meaning that we should separate our application into different sections to address separate concerns.

Function components.

React components work similarly to JavaScript functions. A component takes random inputs, which we call props, and must always return a React element that defines what is intended to be displayed to the user.

The simple method to specify a React component is to define a JavaScript function and return a React element. The React component must always return a React element, or it will throw an error.

We’ve defined a ReactJS component called HelloWorld that takes one prop, which stands for properties and returns a ReactJS element, in this case, a simple h1 element. 

Class components.

The Class component must have the extends `React.Component` statement. This statement sets up a `React.Component` subclass that allows your component to access `React.Component` functions.

The component must also have a `render()` method, which returns HTML.

Benefits 

So the main question is why you should choose ReactJS as a frontend development stack while there are a lot of others. Here are some reasons:

Speedless. React allows developers to use individual parts of their application on both the client and server sides, and any changes they make will not affect the application’s logic. This makes the development process extremely fast.

Components support. The use of HTML tags and JS codes makes it easy to work with a huge dataset containing the DOM. React acts as an intermediary that represents the DOM and helps you decide which component requires changes to get accurate results.

Easy to use and learn. ReactJS is incredibly user-friendly and makes any UI interactive. It also allows you to quickly and efficiently build applications, which is time-saving for clients and developers alike.

SEO Friendly. A common problem complained by most web developers is that traditional JavaScript frameworks often have problems with SEO.  ReactJS solves this problem by helping developers navigate different search engines easily through the fact that the ReactJS application can run on the server, and the virtual DOM renders and returns it to the browser as a  web page.

One-way Data Binding. One-way data-binding implies that absolutely anyone can trace all the changes that have been made to a segment of the data.  This is also one of the reasons that make React so easy.

Who uses React?

Here is the list of popular ReactJS websites:

Facebook
Atlassian
Uber Eats
Netflix
Airbnb
Trello
Grammarly
Outlook.com
Codecademy
Dropbox

How to build your first application on React

Creating your app on React.js from the terminal of your IDE

First, you should install the framework package using `npx create-react-app`

`npx create-react-app my-app`, where is the `my-app` name of your application.

The next step is navigating into your new application.

`cd my-app`

And the last step is to start your application.

`npm start` 

In the end, you will have only a frontend application without any database and backend, which takes a lot of work to get a full-fledged application.

How to create your app with Flatlogic Platform

There are two ways to build your application on the Flatlogic Platform: you can create a simple and clear frontend application, generated by the framework CLI, or the CRUD application with frontend+backend+database.

Creating a CRUD application with Flatlogic

1 Step. Choosing the Tech Stack

In this step, you’re setting the name of your application and choosing the stack: Frontend, Backend, and Database.

2 Step. Choosing the Starter Template

In this step, you’re choosing the design of the web app.

3 Step. Schema Editor

In this part you will need to know which application you want to build, that is, CRM or E-commerce, also in this part you build a database schema i.e. tables and relationships between them.

If you are not familiar with database design and it is difficult for you to understand what tables are, we have prepared several ready-made example schemas of real-world apps that you can build your app upon modification:

E-commerce app;
Time tracking app;
Books store;
Chat (messaging) app;
Blog.

At the final, you can male a deploy of your application and in a few minutes, you will get a fully functional CMS for your Application.

Creating a one-page application with Flatlogic 

You can create a frontend-only app with the Flatlogic Platform. This assumes you host the back-end somewhere else or do not need it at all. To generate a one-page application you don’t need to enter anything in the terminal of your IDE, you just need to go to the page of creating an application on the Flatlogic website and make only 2 steps:

1 Step. Choosing the Tech Stack

In this step, you set the name of your application and choose the stack: React as Frontend, No-Backend as Backend.

2 Step. Choosing the Starter Template

In this step, you choose the design of the web app. Since this is a standard one-page application created using the CLI framework, it will have the design of a standard one-page ReactJS CLI application.

At the final, you can deploy your app and in a few minutes, you will get a one-page React application, which you can further modify as you like.

The post What is React? appeared first on Flatlogic Blog.

Flatlogic Admin Templates banner

4 Best Angular.JS Themes and Templates for 2022

The task of creating an admin panel for creating and editing content often arises in the web development process. The task, in general, is trivial, but it is not so easy to make a convenient admin panel.

A Couple Of Words About AngularJS

AngularJS is an MVC framework. Includes its own high-level ajax implementation, built-in unit, and e2e tests (Jasmine for unit testing, a special testing server is launched for end-to-end tests).

Angular.JS works according to the MVC scheme (Model-View-Controller – model-view-controller) – it divides the application into three separate parts that can be changed independently of each other.

Model
Provides information (and responds to controller commands).

View
Responsible for displaying model data and monitoring changes.

Controller
Reacts to user input and notifies the model to update.

“AngularJS is not completely MVC; the controller will never have a direct reference to the view. This is great because it keeps the controller independent of the view, and also allows us to easily test the controller without needing to instantiate a DOM.”

Shyam Seshadri, AngularJS: Up and Running: Enhanced Productivity with Structured Web Apps

Most developers would choose the newest version of Angular to work with. This is a choice that no one will argue in the modern web development world. If you are new to Angular please note that AngularJS refers to the first version of the framework. Then there was a complete rethinking of technology. It was a great breakthrough, but it caused so much pain. The migration from one version to another took lots of time and effort. But in rare cases, you still need to use the old version – AngularJS. So this article is useful in these cases.

If you need admin templates with the newest version of Angular, you can check out Angular templates made by Flatlogic. Or we have several articles on Angular dashboards in our blog:

Top 10 Angular Material Admin Dashboard Templates

Top Angular Admin Templates

Despite all the pain that the new version caused, frontenders liked those changes. It made the framework much more flexible and scalable. Plus drastically changed technology in terms of speed and lightweight. And of course, as with every software update, it reduced drastically the number of bugs. And added some new:)

Check out Flatlogic Angular Templates!

Theme Support
E-Commerce Section
Fully Documented Codebase

This opened up huge perspectives for enterprise-like software. And to these days when we compare React and Angular, for example, we always point out this indisputable plus – it is perfect for gigantic enterprise apps.

To be fair we need to point out some minuses. This framework needs additional optimization to make the application load and work faster. Of course, it depends on the technology you compare Angular with. But in general, you will spend more time chasing the speed of your dream, though there are many ways to do this.

Do you like this article?
You might want to read:

Top 10+ Simple Admin Themes and Templates

Another pretty obvious minus is too complicated directive API. I don’t mean that it is inconvenient, I’m just saying that very flexible. There is always the possibility that you will modify it the way you really shouldn’t. In simple terms: too much freedom. The easiest way to avoid the mistakes with API is to study carefully the documentation.

An Opinionated List of AngularJS Admin Dashboard Templates

So, let’s proceed to the review of admin panels made with AngularJS.

Sing App AngularJS

Image source: https://flatlogic.com/templates/sing-app-angularjs/demo

DEMO
MORE INFO
DOCUMENTATION

This admin template is created by Flatlogic Team using Angular.js and Bootstrap. Sing App Angular.js is made beautiful and stylish. The background color of the buttons changes after clicking them. Design connoisseurs will also notice the light glow from the navbar and the mesmerizing effect of smoothly opening tabs.

This dashboard template is multifunctional. It has charts, using them you are able to easily operate your data. From the dashboard, you get statistics, for instance, you see the number of visits. This information is available on the map and on the progress bars. In addition, you can find our other useful information, such as the user base growth, traffic values, market stats, and etc.

Developers have included forms, grid options, and a bunch of UI elements. For easy navigation, there’s a search field on the navbar, and a left sidebar that you can fix on the page or leave it collapsing. Sing App Angular.js is a multipage multifunctional responsive template that that takes its rightful place in this top.

Slant Admin

Image source: http://jaybabani.com/slant/site/

DEMO
MORE INFO

Slant Admin is positioned on the market as multiple admin themes in one. Let’s see why. But first, let’s pay attention to the technical stuffing. The basis of the template is AngularJS and Bootstrap. To build the project, developers connected Grunt and Bower. If you have heard nothing about Bower, this is a package manager that helps automatize the work, for example, you don’t have to download the files of frameworks or libraries manually.

Slant Admin is created developer-friendly. This template contains different blanks. Among its sections, we can find Dashboard, APPS, User Interface, Forms, Charts, etc. For UI content, there are many elements starting with Typography, Progress Bars, Icons, and ending with Image Cropper, Section Panels, Counter Tiles. There are also many pages, such as the Login page, Forgot password page, Error pages.

This is a responsive good-looking template. You can select the layout type for the sidebar. A nice finding is when you select the category from the left, the category name is duplicated on the navbar in the form of the tab.

This product contains 9 admin themes. They are the following: General Admin, Hospital Admin, University Admin Music Admin, CRM Admin, Freelance Admin, Blog Admin, E-commerce Admin, Social Media Admin. It means that Slant Admin can be a solution to the needs of different spheres of life. That’s why this product is called “multiple admin themes in one”.

Angular Material Dashboard


Image source: https://flatlogic.com/templates/angular-material-dashboard/demo

DEMO
MORE INFO

Another sample of coding with Angular.js framework is Angular Material Dashboard. Created with Angular Material design, the template’s interface looks self-contained and stylish. 

One of the main advantages that keep an eye is an informative multisector dashboard. From the dashboard, you will find out about the following:

the number of site visitors;
the number of warnings;
memory load;
Server Control Panel management;
usage statistics;
enabling or disabling of Autocomplete Input;
database performance;
TODO list. 

It’s very convenient to operate data due to integrated graphics for data visualization. In addition to the dashboard, there’s a table section and a profile page with the necessary fields. If you look through the demo, you’ll find the sharing option via connection to Twitter and GitHub. 

If you are considering creating an application like CMS, SAAS, project management tools, and if you looking for a smart template free of charge, then Angular Material Dashboard is the one that will help you achieve your goal. 

CoreUI for AngularJS


Image source: https://coreui.io/v1/demo/AngularJS_Demo/#!/dashboard

DEMO
MORE INFO

CoreUI is an admin template that is created with Angular.js and Bootstrap. This is a free template, in addition, free updates are provided. It’s an open-source project, however, everyone can donate to support it. 

The template doesn’t look like raw material, it looks like a well-designed ready-to-use dashboard. On the top of the screen, there’s a navbar; from the left side – a sidebar, and the main content in the center. What’s interesting is that the main content has its own navbar with the Home, Dashboard, and Settings buttons.

This project boasts an impressive list of UI elements. These elements are various and numerous. The list includes buttons (social buttons as a bonus), forms, tables, switches, icons (font awesome, flags), 4 types of charts; login, registration, error pages. CoreUI contains SCSS source files and 5 plugins, such as Angular Animate, Angular Breadcrumb, Angular Chart.js, Angular Loading Bar, and Chart.js. 

The color scheme of this admin dashboard is pleasant to the eye due to its dark sidebar theme and light theme of the main content. However, the color theme is represented with only one style, so you can’t switch to another scheme.

The team anticipated the expectations of more demanding users and released an extended version –  CoreUI PRO for AngularJS. This template contains UI kits for emailing and invoicing. Here you can apply more plugins (standard version plugins + Angular DateRangePicker, Angular DateRangePicker, Angular Translate, Angular UI Calendar, Angular UI Mask, Full Calendar, Toastr). What is more, in terms of the visual part, a PRO version can be switched to dark mode.

A Couple of Words About The Migration Possibilities

Some developers nowadays seek to migrate from AngularJS to the newest version of Angular. This journey can not be not easy, nor fast. Mainly because you will ask yourself a question, what if Google decide to change everything once again without backward compatibility. But in 2022 so far the transition to the new version is relatively easy.

Going back to the migration from AngularJS we must say that the sooner you start, the cheaper it would be. Every year Angular team makes lots of changes, so it is not always easy to keep up with those changes. 
But the Angular team developed two tools that are aimed to help you with that. 

The first.
ngMigration Assistant
This command-line tool recommends the best migration option by analyzing an app.

The second.
ngMigrationForum
The most useful part of a forum in my opinion is a Migration Paths Overview. It suggests several options for you (the same as ngMigration Assistant):

Incremental migration,
ngUpgrade,
Angular elements,
Routing,
Code conversion,
Rewriting from scratch.

You might also like these articles:

Top 7+ Node.js React Templates and Themes for Your Admin Panel

Top 7 Awesome Vue Material Admin Dashboard Templates Worth Your Attention

Top 10 Angular Material Admin Dashboard Templates

The post 4 Best Angular.JS Themes and Templates for 2022 appeared first on Flatlogic Blog.

Flatlogic Admin Templates banner