Menu

JOPS Meets Next.js: Class-Based SPAs Inside Server-Rendered Apps
📰

JOPS Meets Next.js: Class-Based SPAs Inside Server-Rendered Apps

DEV Community: nextjs·Arik Wald·3 days ago
#GAnlp3zr
#devtonextjs#devto#dev#details#jops
Reading 0:00
15s threshold

When we shipped hybrid mobile support in JOPS 1.0.13, we said the next step was to examine how JOPS and Next.js could work together. With jops-core 1.1.0 , that work is done: a complete JOPS single-page app can now run inside a page of a Next.js app, next to React, with Next.js Route Handlers as its backend.

This isn't JOPS competing with React. Next.js keeps everything it does best: server rendering, data fetching, routing and the React ecosystem. JOPS adds class-based views with an Android-style lifecycle on the pages that need them. One codebase, two models, each where it fits.

Why bring classes into a Next.js app

Object-oriented design is how most backend and mobile developers think: Java, C#, Kotlin, Swift, Android and UIKit are all built around classes. Modern React has moved the other way. Server Components are async functions, and React's newest features are built for function components.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.