Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: react@19 and nextjs support #1644

Draft
wants to merge 20 commits into
base: release-3.0.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .changeset/chilled-years-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'@siemens/ix-react': major
---

- Add `nextjs@15` support.
- Introduced new `ssr` components, which must be utilized on the server side.

Page.tsx:

```
import { IxBlind } from '@siemens/ix-react/ssr';

export default async function Home() {
return (
<div className={styles.page}>
<main className={styles.main}>
<IxBlind></IxBlind>
</main>
</div>
);
}
```
5 changes: 5 additions & 0 deletions .changeset/happy-otters-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@siemens/ix-react': major
---

Add `react@19` support
2 changes: 1 addition & 1 deletion .github/workflows/actions/turbo/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ runs:
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 20
node-version: 22
cache: 'pnpm'

- name: Get pnpm store directory
Expand Down
3 changes: 2 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"@stencil-community/eslint-plugin": "^0.7.2",
"@stencil-community/postcss": "^2.2.0",
"@stencil/angular-output-target": "^0.9.0",
"@stencil/react-output-target": "^0.7.1",
"@stencil/core": "^4.23.2",
"@stencil/react-output-target": "^0.8.2",
"@stencil/sass": "^3.0.12",
"@stencil/vue-output-target": "0.8.8",
"@testing-library/dom": "^10.4.0",
Expand Down
11 changes: 8 additions & 3 deletions packages/core/stencil.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { postcss } from '@stencil-community/postcss';
import { angularOutputTarget } from '@stencil/angular-output-target';
import { Config } from '@stencil/core';
import { reactOutputTarget } from './scripts/build/react';
import { reactOutputTarget } from '@stencil/react-output-target';
import { sass } from '@stencil/sass';
import { vueOutputTarget } from '@stencil/vue-output-target';
import autoprefixer from 'autoprefixer';
Expand Down Expand Up @@ -100,8 +100,13 @@ export const config: Config = {
...getAngularConfig(),
reactOutputTarget({
stencilPackageName: corePackageName,
outDir: '../react/src/components',
esModules: true,
outDir: '../react/src',
excludeComponents: ['ix-tree', 'ix-tree-item', 'ix-icon'],
}),
reactOutputTarget({
stencilPackageName: corePackageName,
outDir: '../react/src/ssr',
hydrateModule: '@siemens/ix/hydrate',
excludeComponents: ['ix-tree', 'ix-tree-item', 'ix-icon'],
}),
{
Expand Down
40 changes: 40 additions & 0 deletions packages/nextjs-test-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# env files (can opt-in for committing if needed)
.env*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
36 changes: 36 additions & 0 deletions packages/nextjs-test-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
7 changes: 7 additions & 0 deletions packages/nextjs-test-app/next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
/* config options here */
};

export default nextConfig;
22 changes: 22 additions & 0 deletions packages/nextjs-test-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "nextjs-test-app",
"version": "0.1.0",
"private": true,
"scripts": {
"build": "next build",
"start": "next dev"
},
"dependencies": {
"@siemens/ix": "workspace:*",
"@siemens/ix-react": "workspace:*",
"next": "^15.1.4",
"react": "^19",
"react-dom": "^19"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"typescript": "^5"
}
}
Binary file added packages/nextjs-test-app/src/app/favicon.ico
Binary file not shown.
42 changes: 42 additions & 0 deletions packages/nextjs-test-app/src/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
:root {
--background: #ffffff;
--foreground: #171717;
}

@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
}

html,
body {
max-width: 100vw;
overflow-x: hidden;
}

body {
color: var(--foreground);
background: var(--background);
font-family: Arial, Helvetica, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

* {
box-sizing: border-box;
padding: 0;
margin: 0;
}

a {
color: inherit;
text-decoration: none;
}

@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
}
}
20 changes: 20 additions & 0 deletions packages/nextjs-test-app/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { Metadata } from 'next';
import './globals.css';
import '@siemens/ix/dist/siemens-ix/siemens-ix.css';

export const metadata: Metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
17 changes: 17 additions & 0 deletions packages/nextjs-test-app/src/app/page.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.page {
display: grid;
grid-template-rows: 20px 1fr 20px;
align-items: center;
justify-items: center;
min-height: 100svh;
padding: 80px;
gap: 64px;
}

.main {
display: flex;
flex-direction: column;
gap: 32px;
grid-row-start: 2;
width: 100%;
}
12 changes: 12 additions & 0 deletions packages/nextjs-test-app/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import styles from './page.module.css';
import { IxBlind } from '@siemens/ix-react/ssr';

export default async function Home() {
return (
<div className={styles.page}>
<main className={styles.main}>
<IxBlind label="Test">Hello World!</IxBlind>
</main>
</div>
);
}
27 changes: 27 additions & 0 deletions packages/nextjs-test-app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
10 changes: 5 additions & 5 deletions packages/react-test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
"echarts-for-react": "~3.0.2",
"echarts-gl": "^2.0.9",
"html-test-app": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19",
"react-dom": "^19",
"react-hook-form": "^7.52.1",
"react-router-dom": "^6.25.1",
"web-vitals": "^2.1.4"
},
"devDependencies": {
"@types/react": "^18",
"@types/react-dom": "^18",
"@vitejs/plugin-react": "^4.3.2",
"@types/react": "^19",
"@types/react-dom": "^19",
"@vitejs/plugin-react": "^4.3.4",
"rollup-plugin-react-scoped-css": "^1.1.0",
"typescript": "^5.5.3",
"typescript-eslint": "^8.7.0",
Expand Down
14 changes: 9 additions & 5 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
".": {
"import": "./dist/index.js",
"types": "./dist/types/index.d.ts"
},
"./ssr": {
"import": "./dist/ssr.js",
"types": "./dist/types/ssr/components.d.ts"
}
},
"scripts": {
Expand All @@ -46,8 +50,8 @@
"happy-dom": "^14.12.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^18",
"react-dom": "^18",
"rimraf": "^6.0.1",
"rollup": "^4.24.0",
"rollup-plugin-preserve-directives": "^0.4.0",
Expand All @@ -57,12 +61,12 @@
},
"peerDependencies": {
"@siemens/ix-icons": "0.0.0-pr-72-20250227071449",
"react": ">=18.3.1",
"react-dom": ">=18.3.1"
"react": "^18 || ^19",
"react-dom": "^18 || ^19"
},
"dependencies": {
"@siemens/ix": "~2.7.0",
"@stencil/react-output-target": "^0.7.1",
"@stencil/react-output-target": "^0.8.2",
"tslib": "*"
}
}
11 changes: 8 additions & 3 deletions packages/react/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@ const __dirname = resolve();
const external = ['react', 'react-dom', 'react-dom/client', 'tslib'];

export default {
input: 'src/index.ts',
output: [
{
dir: 'dist/',
dir: 'dist',
entryFileNames: '[name].js',
chunkFileNames: '[name]-[hash].js',
format: 'es',
sourcemap: true,
preserveModules: true,
},
],
input: {
index: 'src/index.ts',
ssr: 'src/ssr/components.ts',
},

plugins: [
typescript({
tsconfig: resolve(__dirname, 'tsconfig.lib.json'),
Expand All @@ -30,7 +34,8 @@ export default {
id.startsWith('@siemens/ix') ||
id.startsWith('@siemens/ix/hydrate') ||
id.startsWith('@siemens/ix-icons') ||
id.startsWith('@stencil/react-output-target')
id.startsWith('@stencil/react-output-target') ||
id.startsWith('@stencil/react-output-target/runtime')
);
},
};
Loading
Loading