Cross-Framework Libraries with Native Experiences Using React

Rate this content
Bookmark

In this talk titled “Empowering Developers: Creating Cross-Framework Libraries with Native Experiences Using React,” we will explore a unified development strategy that enables software to be used across multiple frameworks without sacrificing the native experience for any user group. This approach not only extends the reach of software solutions but also optimizes development processes by allowing teams to write code in React—our framework of choice—and deploy it seamlessly across Angular, Vue, and others.

This talk has been presented at React Summit 2024, check out the latest edition of this React Conference.

FAQ

Composer's Decay addresses the challenge of reaching developers who have different preferences for building apps with their favorite frameworks.

Sisense is focused on embedding analytics everywhere it is possible, including for developers.

Sisense prefers React because of its vast community, the existing React components in their organization, and the strong market presence of React.

Sisense ensures a native experience by building everything in React and then using a bridge to adapt the React components to different frameworks, such as Angular and Vue.js.

Sisense initially started with web components using lead element and Stencil but found limitations and decided to use React with a bridging strategy instead.

In Angular, Sisense created a component adapter that passes React components and context through Angular services, allowing the React component to render and re-render within Angular.

TypeScript ensures a consistent API commitment across different frameworks, making it easier to serve the same functionality in various frameworks without changing the APIs.

Sisense abstracts the business logic to ensure a consistent experience, using React hooks internally but adapting them to Angular services or Vue composables as needed.

The vision is to call one function that renders React components internally, providing a seamless experience for developers in their preferred frameworks while keeping React hidden.

Reusing components allows Sisense to maintain and improve their libraries based on internal feedback, ensuring consistent quality and functionality across projects.

Ray Luxembourg
Ray Luxembourg
7 min
14 Jun, 2024

Comments

Sign in or register to post your comment.
Video Summary and Transcription
The Talk discusses building cross-framework libraries using React to provide a superior experience for developers across different frameworks. The speaker explains the strategy of rendering React components internally and bridging them to different frameworks. They emphasize the importance of simplicity, understandability, and adherence to best practices in third-party libraries. The speaker also highlights the significance of creating a bridge layer and implementing a complete abstraction to ensure the library's reusability and maintenance.

1. Building Cross-Framework Libraries with React

Short description:

I'm going to talk about how we are building cross-framework libraries using purely React and providing a superior experience for developers across different frameworks. At Sisense, we are building business intelligence applications and highly focused on embedding analytics everywhere, including for developers. The challenge is how do we reach more developers? Developers have high standards for third-party libraries. They want simplicity, understandability, and adherence to best practices. To meet these expectations, we need to reach developers across frameworks and leverage React as our primary tool.

Thank you for joining me today. I'm going to talk about how we are building cross-framework libraries using purely React and providing a superior experience for developers across different frameworks. At Sisense, we are building business intelligence applications, and we're highly focused on embedding analytics everywhere it is possible, and developers are no exception.

Our Composer's Decay, which we build, is to address the developer market that everybody has their own preference of building their own apps with their favourite frameworks. The challenge is how do we reach more developers? It's basically very simple. Developers have high standards for third-party libraries. They want it to be simple. They want to not go every second to the commentations. They want it to be understandable and follow the best practices of their own framework. And, to reach those developers, we need to meet those expectations.

To put it simply, the requirement is to reach those developers across frameworks, and utilise our organisation work force and future work force, which is React, which is still going strong in the work market. What is a native experience? In React, we know the JSX clearly, but in Vue.js, we have this templating syntax, and, in Angular, something similar, right? That's basically on the HTML part. In the business experience, React uses hooks, Vue uses something similar, but they call it composables, but in Angular, you have something called services. Clearly, they have differences in their business logic implementation, but we need to provide the same experience across all of those frameworks, while still developing only in React.

2. Implementing React Bridge and Abstraction

Short description:

Our strategy is to build everything with React and bridge it to provide the best experience across frameworks. We write all our components and UI in React, leveraging its vast community and existing components. By rendering React components internally and providing a superior experience, we meet developers' expectations. We achieve this by creating a bridge layer, such as the component adapter in Angular, to render React components within different frameworks. We ensure business logic works by implementing a complete abstraction and utilizing TypeScript for consistent APIs. Reusing and maintaining the library internally and externally is crucial for success.

Our implementation strategies, we've first started, when I joined this effort, we had the POC with web components first, so we build the web components using a lead element, and we tried Stencil, and then we figured out that we need the bridge to create the native experience to make sure it is robust and scalable. In order to reach those frameworks, and web components is not that strong in the work force environment, and our organisation is not that proficient in web components development, and we found out that web components had some limitation at the time of research. Clearly, it was an option, but it was not as robust as we hoped it would be. But since we require a bridge anyway, so why not go with React, why we can't just build everything in React and then do some magic bridge, hopefully with one line of code, if possible? So, the strategy that I come up with is we're going to build everything with React, we will have a clear guidelines of how we do it, and then we bridge this with littlest effort to make it work with best experience across frameworks.

So of course, the choice for React was that there is a vast community, I think you know all the selling points, and we want to reuse also that we already have components in our organisation that has been using React, and we have the work force, and the market is strong like I said. So what is it about the React approach? We write all our components, all our UI in React. And the vision that I have seen is that if I can just call one function to render the React components internally hidden from the developers while still providing them the superior experience that they used to in their own framework, this could work. And what I know about React, we have an entry point where all we need is an element to mount React on, the component, the props, and optionally the context, and that is all that is required to render a React application. I use that as a basis to implement a solution. So in the bridge layer, what we're doing in the bridge layer, here's an example from Angular. So basically, we have created a very simple version of that mounting point called the component adapter where we pass the React component, we pass the context from the Angular site through their native solution which is the services, and we have a function that knows how to pass the arguments to a create element function with the React component that we desire to render, and then we will only apply this like whenever there is a life-cycle hook for changes, we just recall that function. Basically, we are re-rendering the React component inside Angular, and this is completely hidden from the developers. This is internal implementation. The end result that they get is on the right side, as you see, it's a basic Angular component, regular syntax, and of course, on the business side, they just do the regular Angular stuff. So in order for the business logic to work, we have to make sure we have a complete abstraction. For example, we do implement hooks in React, but the underlying business logic that is inside the hook is not framework agnostic. So basically, we can call those functions inside Angular and just wrap it and get the services or in the view composables. Basically, we serve everyone the way they want to. An example of implementing the execute query service is basically we call the execute query function, which is not framework agnostic, and we just get the same experience. What's important here is TypeScript. TypeScript is basically the secret ingredient to make this work because our commitment to the APIs, to the developer side is the same commitment across frameworks. Just because it's served a different way doesn't mean we have to change the APIs.

On the finishing notes, what's really important is to completely reuse what you are building inside your organization. Once you reuse it in other projects, you basically your own developer that is giving you yourself feedback, and always maintain that library, and you have to give the same commitment internally and externally, and then this library is working very well. That's it on my side. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. Thank you.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Building Better Websites with Remix
React Summit Remote Edition 2021React Summit Remote Edition 2021
33 min
Building Better Websites with Remix
Top Content
Remix is a web framework built on React Router that focuses on web fundamentals, accessibility, performance, and flexibility. It delivers real HTML and SEO benefits, and allows for automatic updating of meta tags and styles. It provides features like login functionality, session management, and error handling. Remix is a server-rendered framework that can enhance sites with JavaScript but doesn't require it for basic functionality. It aims to create quality HTML-driven documents and is flexible for use with different web technologies and stacks.
Speeding Up Your React App With Less JavaScript
React Summit 2023React Summit 2023
32 min
Speeding Up Your React App With Less JavaScript
Top Content
Watch video: Speeding Up Your React App With Less JavaScript
Mishko, the creator of Angular and AngularJS, discusses the challenges of website performance and JavaScript hydration. He explains the differences between client-side and server-side rendering and introduces Quik as a solution for efficient component hydration. Mishko demonstrates examples of state management and intercommunication using Quik. He highlights the performance benefits of using Quik with React and emphasizes the importance of reducing JavaScript size for better performance. Finally, he mentions the use of QUIC in both MPA and SPA applications for improved startup performance.
Full Stack Documentation
JSNation 2022JSNation 2022
28 min
Full Stack Documentation
Top Content
The Talk discusses the shift to full-stack frameworks and the challenges of full-stack documentation. It highlights the power of interactive tutorials and the importance of user testing in software development. The Talk also introduces learn.svelte.dev, a platform for learning full-stack tools, and discusses the roadmap for SvelteKit and its documentation.
SolidJS: Why All the Suspense?
JSNation 2023JSNation 2023
28 min
SolidJS: Why All the Suspense?
Top Content
Suspense is a mechanism for orchestrating asynchronous state changes in JavaScript frameworks. It ensures async consistency in UIs and helps avoid trust erosion and inconsistencies. Suspense boundaries are used to hoist data fetching and create consistency zones based on the user interface. They can handle loading states of multiple resources and control state loading in applications. Suspense can be used for transitions, providing a smoother user experience and allowing prioritization of important content.
From GraphQL Zero to GraphQL Hero with RedwoodJS
GraphQL Galaxy 2021GraphQL Galaxy 2021
32 min
From GraphQL Zero to GraphQL Hero with RedwoodJS
Top Content
Tom Pressenwurter introduces Redwood.js, a full stack app framework for building GraphQL APIs easily and maintainably. He demonstrates a Redwood.js application with a React-based front end and a Node.js API. Redwood.js offers a simplified folder structure and schema for organizing the application. It provides easy data manipulation and CRUD operations through GraphQL functions. Redwood.js allows for easy implementation of new queries and directives, including authentication and limiting access to data. It is a stable and production-ready framework that integrates well with other front-end technologies.
RedwoodJS: The Full-Stack React App Framework of Your Dreams
React Summit Remote Edition 2021React Summit Remote Edition 2021
43 min
RedwoodJS: The Full-Stack React App Framework of Your Dreams
Top Content
Redwood JS is a full stack React app framework that simplifies development and testing. It uses a directory structure to organize code and provides easy data fetching with cells. Redwood eliminates boilerplate and integrates Jest and Storybook. It supports pre-rendering and provides solutions for authentication and deployment. Redwood is a cross-client framework that allows for building web and mobile applications without duplicating work.

Workshops on related topic

Building WebApps That Light Up the Internet with QwikCity
JSNation 2023JSNation 2023
170 min
Building WebApps That Light Up the Internet with QwikCity
Featured WorkshopFree
Miško Hevery
Miško Hevery
Building instant-on web applications at scale have been elusive. Real-world sites need tracking, analytics, and complex user interfaces and interactions. We always start with the best intentions but end up with a less-than-ideal site.
QwikCity is a new meta-framework that allows you to build large-scale applications with constant startup-up performance. We will look at how to build a QwikCity application and what makes it unique. The workshop will show you how to set up a QwikCitp project. How routing works with layout. The demo application will fetch data and present it to the user in an editable form. And finally, how one can use authentication. All of the basic parts for any large-scale applications.
Along the way, we will also look at what makes Qwik unique, and how resumability enables constant startup performance no matter the application complexity.
Back to the Roots With Remix
React Summit 2023React Summit 2023
106 min
Back to the Roots With Remix
Featured Workshop
Alex Korzhikov
Pavlik Kiselev
2 authors
The modern web would be different without rich client-side applications supported by powerful frameworks: React, Angular, Vue, Lit, and many others. These frameworks rely on client-side JavaScript, which is their core. However, there are other approaches to rendering. One of them (quite old, by the way) is server-side rendering entirely without JavaScript. Let's find out if this is a good idea and how Remix can help us with it?
Prerequisites- Good understanding of JavaScript or TypeScript- It would help to have experience with React, Redux, Node.js and writing FrontEnd and BackEnd applications- Preinstall Node.js, npm- We prefer to use VSCode, but also cloud IDEs such as codesandbox (other IDEs are also ok)
Let AI Be Your Docs
JSNation 2024JSNation 2024
69 min
Let AI Be Your Docs
Workshop
Jesse Hall
Jesse Hall
Join our dynamic workshop to craft an AI-powered documentation portal. Learn to integrate OpenAI's ChatGPT with Next.js 14, Tailwind CSS, and cutting-edge tech to deliver instant code solutions and summaries. This hands-on session will equip you with the knowledge to revolutionize how users interact with documentation, turning tedious searches into efficient, intelligent discovery.
Key Takeaways:
- Practical experience in creating an AI-driven documentation site.- Understanding the integration of AI into user experiences.- Hands-on skills with the latest web development technologies.- Strategies for deploying and maintaining intelligent documentation resources.
Table of contents:- Introduction to AI in Documentation- Setting Up the Environment- Building the Documentation Structure- Integrating ChatGPT for Interactive Docs
Learn Fastify One Plugin at a Time
Node Congress 2021Node Congress 2021
128 min
Learn Fastify One Plugin at a Time
Workshop
Matteo Collina
Matteo Collina
Fastify is an HTTP framework for Node.js that focuses on providing a good developer experience without compromising on performance metrics. What makes Fastify special are not its technical details, but its community which is wide open for contributions of any kind. Part of the secret sauce is Fastify plugin architecture that enabled developers to write more than a hundred plugins.This hands-on workshop is structured around a series of exercises that covers from basics "hello world", to how to structure a project, perform database access and authentication.

https://github.com/nearform/the-fastify-workshop
Build a Universal Reactive Data Library with Starbeam
JSNation 2023JSNation 2023
66 min
Build a Universal Reactive Data Library with Starbeam
WorkshopFree
Yehuda Katz
Yehuda Katz
This session will focus on Starbeam's universal building blocks. We'll use Starbeam to build a data library that works in multiple frameworks.We'll write a library that caches and updates data, and supports relationships, sorting and filtering.Rather than fetching data directly, it will work with asynchronously fetched data, including data fetched after initial render. Data fetched and updated through web sockets will also work well.All of these features will be reactive, of course.Imagine you filter your data by its title, and then you update the title of a record to match the filter: any output relying on the filtered data will update to reflect the updated filter.In 90 minutes, you'll build an awesome reactive data library and learn a powerful new tool for building reactive systems. The best part: the library works in any framework, even though you don't think about (or depend on) any framework when you built it.
Table of contents- Storing a Fetched Record in a Cell- Storing multiple records in a reactive Map- Reactive iteration is normal iteration- Reactive filtering is normal filtering- Fetching more records and updating the Map- Reactive sorting is normal sorting (is this getting a bit repetitive?)- Modelling cache invalidation as data- Bonus: reactive relationships
Build a Product Page with Shopify’s Hydrogen Framework
React Advanced 2022React Advanced 2022
81 min
Build a Product Page with Shopify’s Hydrogen Framework
WorkshopFree
David Witt
David Witt
Get hands on with Hydrogen, a React-based framework for building headless storefronts. Hydrogen is built for Shopify commerce with all the features you need for a production-ready storefront. It provides a quick start, build-fast environment so you can focus on the fun stuff - building unique commerce experiences. In this workshop we’ll scaffold a new storefront and rapidly build a product page. We’ll cover how to get started, file-based routing, fetching data from the Storefront API, Hydrogen’s built-in components and how to apply styling with Tailwind.You will know:- Get started with the hello-world template on StackBlitz- File-based routing to create a /products/example route- Dynamic routing /products/:handle- Hit the Storefront API with GraphQL- Move the query into the Hydrogen app- Update the query to fetch a product by handle- Display title, price, image & description.- Tailwind styling- Variant picker and buy now button- Bonus if there’s time: Collections page
Prerequisites: - A Chromium-based browser (StackBlitz)- Ideally experience with React. A general web development background would be fine.