Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
7b665cd
feat(extractor): compile Devup UI elements to React Native styles
owjs3901 Nov 19, 2026
c352820
test(extractor): cover the React Native target and wire codeExtractNa…
owjs3901 Nov 19, 2026
5c2691a
fix(extractor): convert style values read at runtime on React Native …
owjs3901 Nov 19, 2026
200d61d
test(extractor): drop the needless raw string hashes and note runtime…
owjs3901 Nov 19, 2026
f0c31ad
feat(metro-plugin): compile Devup UI for React Native in Metro
owjs3901 Nov 19, 2026
694249c
Merge remote-tracking branch 'origin/main' into feat/react-native-metro
owjs3901 Nov 19, 2026
2717c03
ci: drop the react-native-core pull request branch now that it is merged
owjs3901 Nov 19, 2026
6bf5393
feat(native): theme tokens, multiple themes and the React Native runtime
owjs3901 Nov 20, 2026
140a470
ci: load the React Native runtime entry with a react-native stand-in
owjs3901 Nov 20, 2026
065a54c
test(native): cover theme merges and a typography a theme lacks
owjs3901 Nov 20, 2026
b61c854
feat(native): responsive values, responsive tokens and orientation on…
owjs3901 Nov 21, 2026
4daea34
fix(verify-dist): give the react-native stand-in Dimensions
owjs3901 Nov 21, 2026
6c2b6f2
feat(native): press styles through Pressable on React Native
owjs3901 Nov 21, 2026
0fd0de6
wip(native): css() and className on React Native
owjs3901 Nov 21, 2026
33b23f3
wip(native): drop a probe test
owjs3901 Nov 21, 2026
90bd808
fix(native): apply theme, orientation and press blocks after the othe…
owjs3901 Nov 21, 2026
a62bbc4
Merge branch 'feat/react-native-pressed' into feat/react-native-css
owjs3901 Nov 21, 2026
3ba5930
test(native): cover a static style checked against one kept in order
owjs3901 Nov 21, 2026
897e66c
feat(native): css() as CSS text, README and changepack
owjs3901 Nov 21, 2026
ed6ec74
Merge branch 'feat/react-native-pressed' into feat/react-native-css
owjs3901 Nov 21, 2026
4f8a95a
test(native): pass classes to style_code in the merged test
owjs3901 Nov 21, 2026
fb7882a
test(native): cover css() parts around state blocks and empty objects
owjs3901 Nov 21, 2026
7d52b64
test(native): cover a static style checked against a state block
owjs3901 Nov 21, 2026
5078394
Merge branch 'feat/react-native-pressed' into feat/react-native-css
owjs3901 Nov 21, 2026
044555e
feat(native): styled() on React Native
owjs3901 Nov 21, 2026
88a60b4
feat(native): hover, focus and disabled styles on React Native
owjs3901 Nov 21, 2026
7619acd
feat(native): animations and transitions on react-native-reanimated
owjs3901 Nov 21, 2026
8f4f040
feat(native): css() and className on React Native (#1046)
owjs3901 Nov 25, 2026
d69078d
feat(native): responsive values, responsive tokens and orientation on…
owjs3901 Nov 25, 2026
adb6e46
Merge origin/main into feat/react-native-themes
owjs3901 Nov 28, 2026
dfba63b
Merge origin/feat/react-native-themes into feat/react-native-pressed
owjs3901 Nov 28, 2026
1803ed6
Merge origin/feat/react-native-pressed into feat/react-native-styled
owjs3901 Nov 28, 2026
93a45bd
Merge origin/main into feat/react-native-pressed
owjs3901 Nov 28, 2026
c3c924d
Merge origin/feat/react-native-styled into feat/react-native-states
owjs3901 Nov 28, 2026
0c97325
Merge origin/main into feat/react-native-pressed
owjs3901 Nov 28, 2026
41b5c85
Merge origin/feat/react-native-pressed into feat/react-native-styled
owjs3901 Nov 28, 2026
9daae42
Merge origin/feat/react-native-styled into feat/react-native-states
owjs3901 Nov 28, 2026
d683fa2
Merge origin/feat/react-native-states into feat/react-native-animations
owjs3901 Nov 28, 2026
34caf28
Merge origin/main into feat/react-native-pressed
owjs3901 Nov 28, 2026
44b7337
Merge origin/feat/react-native-pressed into feat/react-native-styled
owjs3901 Nov 28, 2026
0b2a16f
Merge origin/feat/react-native-styled into feat/react-native-states
owjs3901 Nov 28, 2026
e363f8d
Merge origin/feat/react-native-states into feat/react-native-animations
owjs3901 Nov 28, 2026
15d61a8
feat(native): hover, focus and disabled styles on React Native (#1048)
owjs3901 Nov 28, 2026
ac22019
feat(native): compile styled-components/native and @emotion/native (#…
owjs3901 Nov 28, 2026
5b9e58b
Merge origin/main into feat/react-native-styled
owjs3901 Nov 28, 2026
86a4d5b
Merge feat/react-native-styled into feat/react-native-animations
owjs3901 Nov 28, 2026
8fb3988
feat(expo): export and check the example on the web (#1051)
owjs3901 Nov 29, 2026
731946e
Merge origin/main into feat/react-native-animations
owjs3901 Nov 29, 2026
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
7 changes: 7 additions & 0 deletions .changepacks/changepack_log_metro_expo_web.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"changes": {
"packages/metro-plugin/package.json": "Patch"
},
"note": "Document Expo web (part of #411): Metro compiles the web build through react-native-web with the same output as iOS and Android, which the Expo example now exports and checks in Chromium.",
"date": "2026-11-21T00:00:00.000Z"
}
7 changes: 7 additions & 0 deletions .changepacks/changepack_log_metro_reanimated.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"changes": {
"packages/metro-plugin/package.json": "Patch"
},
"note": "`withDevupUI()` tells the compiler whether the project has react-native-reanimated, which runs `keyframes()` and the `animation*` and `transition*` props on React Native; without it, they are build errors asking to install it.",
"date": "2026-11-21T00:00:00.000Z"
}
7 changes: 7 additions & 0 deletions .changepacks/changepack_log_metro_types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"changes": {
"packages/metro-plugin/package.json": "Patch"
},
"note": "Write `df/theme.d.ts` (the tokens of devup.json) and `df/native.d.ts` (React Native props for each component) when Metro reads the config, with a `distDir` option, as the web plugins do.",
"date": "2026-11-21T00:00:00.000Z"
}
8 changes: 8 additions & 0 deletions .changepacks/changepack_log_react_native_animations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"changes": {
"bindings/devup-ui-binding/package.json": "Patch",
"bindings/devup-ui-wasm/package.json": "Patch"
},
"note": "`codeExtractNative` compiles `keyframes()` and the `animation*` and `transition*` props for React Native on react-native-reanimated (part of #411): `keyframes()` becomes the keyframes object Reanimated reads, and an element taking an animation or a transition renders Reanimated's animated component. It takes a new `reanimated` argument telling whether the app has react-native-reanimated; without it, these are build errors asking to install it. Web output is unchanged.",
"date": "2026-11-21T00:00:00.000Z"
}
8 changes: 8 additions & 0 deletions .changepacks/changepack_log_react_native_compat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"changes": {
"bindings/devup-ui-binding/package.json": "Patch",
"bindings/devup-ui-wasm/package.json": "Patch"
},
"note": "`codeExtractNative` compiles `styled-components/native` and `@emotion/native` (part of #411): their `styled` (including `styled.View` and any other `styled.Name`) and `css` compile as Devup UI's with numbers as pixels, function parts receive `props.theme` from the runtime's `ThemeProvider`, and `ThemeProvider`, `useTheme` and `withTheme` import from the React Native runtime. Web output is unchanged.",
"date": "2026-11-21T00:00:00.000Z"
}
7 changes: 7 additions & 0 deletions .changepacks/changepack_log_react_native_compat_runtime.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"changes": {
"packages/react/package.json": "Patch"
},
"note": "`@devup-ui/react/native` adds `ThemeProvider`, `useStyledTheme` and `withTheme`, the theme context the build imports for styled-components and Emotion on React Native. They share the context and `withTheme` of the web compat entry. The runtime grows from 702 B to 1,185 B min+gzip.",
"date": "2026-11-21T00:00:00.000Z"
}
7 changes: 7 additions & 0 deletions .changepacks/changepack_log_react_native_types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"changes": {
"packages/react/package.json": "Patch"
},
"note": "Add `@devup-ui/react/native/types`, which types each component as the React Native component it renders (`Box` takes `ViewProps`, `Button` takes `PressableProps`, ...) through the new `DevupElementProps` augmentation point. Web types are unchanged.",
"date": "2026-11-21T00:00:00.000Z"
}
2 changes: 1 addition & 1 deletion apps/expo/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"name": "Devup UI Expo",
"slug": "devup-ui-expo",
"version": "0.1.0",
"platforms": ["ios", "android"]
"platforms": ["ios", "android", "web"]
}
}
17 changes: 13 additions & 4 deletions apps/expo/check-bundle.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
// runtime; src/Badge.tsx is styled the same in every theme and at every
// width, so it must not use the runtime. Its buttons take press styles, which
// React Native's `Pressable` applies through a function for `style`, and its
// input a focus style, which the runtime's `Focused` applies.
// input a focus style, which the runtime's `Focused` applies. Its card fades
// in and its logo fades, which react-native-reanimated runs.
import { readdirSync, readFileSync } from 'node:fs'
import { join } from 'node:path'

Expand All @@ -19,9 +20,12 @@ const RUNTIME_NAMES =
const APP_HOOKS = ['useThemeIndex', 'useBreakpoint', 'useLandscape', 'Focused']
/** Modules of @devup-ui/react, by the path Metro resolves */
const REACT_PACKAGE = /(^|[\\/])(@devup-ui[\\/]react|packages[\\/]react)[\\/]/
/** The React Native runtime among them */
/**
* The React Native runtime among them, with the theme context of
* styled-components and Emotion it shares with the web build
*/
const NATIVE_RUNTIME =
/(^|[\\/])(@devup-ui[\\/]react|packages[\\/]react)[\\/]dist[\\/]native[\\/]/
/(^|[\\/])(@devup-ui[\\/]react|packages[\\/]react)[\\/]dist[\\/](native[\\/]|utils[\\/](theme-context|with-theme)\.)/
const root = join(import.meta.dirname, 'dist', '_expo', 'static', 'js')
const failures = []

Expand Down Expand Up @@ -110,7 +114,7 @@ function runtimeUsers(code, locate) {
return users
}

for (const platform of ['ios', 'android']) {
for (const platform of ['ios', 'android', 'web']) {
const directory = join(root, platform)
const bundles = readdirSync(directory).filter((file) => file.endsWith('.js'))
if (bundles.length === 0) failures.push(`${platform}: no JavaScript bundle`)
Expand All @@ -124,6 +128,8 @@ for (const platform of ['ios', 'android']) {
'backgroundColor:"#4330d9"',
'StyleSheet',
'style:({pressed:',
'animationName:',
'transitionProperty:"opacity"',
]) {
if (!code.replaceAll(' ', '').includes(style)) {
failures.push(`${platform}/${file}: lacks ${style}`)
Expand All @@ -138,6 +144,9 @@ for (const platform of ['ios', 'android']) {
failures.push(`${platform}/${file}: bundles ${source}`)
}
}
if (!sources.some((source) => /react-native-reanimated/.test(source))) {
failures.push(`${platform}/${file}: lacks react-native-reanimated`)
}
if (!sources.some((source) => NATIVE_RUNTIME.test(source))) {
failures.push(`${platform}/${file}: lacks @devup-ui/react/native`)
}
Expand Down
102 changes: 102 additions & 0 deletions apps/expo/check-web.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// Opens the web export (`expo export --platform web` wrote dist/) in Chromium
// and checks that react-native-web renders the styles Devup UI compiled: the
// card takes the theme's color and switches with the theme, the input takes
// its focus style through the runtime's `Focused`, and the button, a
// `Pressable`, counts a press.
import { createReadStream, existsSync, statSync } from 'node:fs'
import { createServer } from 'node:http'
import { extname, join, normalize } from 'node:path'

import { chromium } from '@playwright/test'

const root = join(import.meta.dirname, 'dist')
const TYPES = {
'.html': 'text/html',
'.js': 'text/javascript',
'.json': 'application/json',
'.png': 'image/png',
}

const server = createServer((request, response) => {
const path = join(root, normalize(new URL(request.url, 'http://x').pathname))
if (!path.startsWith(root)) {
response.writeHead(404).end()
return
}
// A path that is no file is the app's page
const file =
existsSync(path) && statSync(path).isFile()
? path
: join(root, 'index.html')
response.writeHead(200, {
'content-type': TYPES[extname(file)] ?? 'application/octet-stream',
})
createReadStream(file).pipe(response)
})
await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve))
const url = `http://127.0.0.1:${server.address().port}/`

const failures = []
/** Fail with `message` unless `actual` is `expected` */
function expectEqual(actual, expected, message) {
if (actual !== expected) {
failures.push(`${message}: expected ${expected}, got ${actual}`)
}
}

const browser = await chromium.launch()
try {
const page = await browser.newPage({ colorScheme: 'light' })
const errors = []
page.on('pageerror', (error) => errors.push(error.message))
await page.goto(url)
const card = page.getByTestId('card')
const name = page.getByTestId('name')
const count = page.getByTestId('count')
await card.waitFor()
/** The computed style `property` of `locator` */
const style = (locator, property) =>
locator.evaluate(
(element, property) => getComputedStyle(element)[property],
property,
)

expectEqual(
await style(card, 'backgroundColor'),
'rgb(255, 255, 255)',
'the card in the light theme',
)
expectEqual(
await style(count, 'backgroundColor'),
'rgb(90, 68, 255)',
'the count button',
)
await name.focus()
expectEqual(
await style(name, 'borderTopColor'),
'rgb(90, 68, 255)',
'the focused input',
)
await count.click()
expectEqual(
(await count.textContent())?.trim(),
'Pressed 1 times',
'the count after a press',
)
await page.getByTestId('theme').click()
expectEqual(
await style(card, 'backgroundColor'),
'rgb(31, 31, 46)',
'the card in the dark theme',
)
for (const error of errors) failures.push(`page error: ${error}`)
} finally {
await browser.close()
server.close()
}

if (failures.length > 0) {
console.error(failures.join('\n'))
process.exit(1)
}
console.info('web: react-native-web renders the compiled styles')
13 changes: 10 additions & 3 deletions apps/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,21 @@
"main": "index.ts",
"scripts": {
"start": "expo start",
"export": "expo export --platform ios --platform android --no-bytecode --source-maps",
"check": "node check-bundle.mjs"
"export": "expo export --platform ios --platform android --platform web --no-bytecode --source-maps",
"check": "node check-bundle.mjs",
"check:web": "node check-web.mjs",
"typecheck": "bun ../../node_modules/@typescript/native/bin/tsc --noEmit"
},
"dependencies": {
"@devup-ui/react": "workspace:^",
"@expo/metro-runtime": "~58.0.17",
"expo": "~58.0.26",
"react": "^19.3.1",
"react-native": "0.88.1"
"react-dom": "^19.3.1",
"react-native": "0.88.1",
"react-native-reanimated": "~4.7.1",
"react-native-web": "~0.21.4",
"react-native-worklets": "0.13.0"
},
"devDependencies": {
"@devup-ui/metro-plugin": "workspace:^",
Expand Down
16 changes: 16 additions & 0 deletions apps/expo/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Flex,
Image,
Input,
keyframes,
setTheme,
Text,
useTheme,
Expand All @@ -16,6 +17,12 @@ import { Badge } from './Badge'
/** The shape both buttons share */
const button = css({ borderRadius: '8px', px: 5, py: 3 })

/** The card fading in, which react-native-reanimated runs */
const fadeIn = keyframes({
from: { opacity: 0 },
to: { opacity: 1 },
})

export function App() {
const [name, setName] = useState('')
const [count, setCount] = useState(0)
Expand All @@ -34,19 +41,25 @@ export function App() {
<Image
borderRadius="16px"
h="64px"
opacity={name ? 1 : 0.6}
src="https://reactnative.dev/img/tiny_logo.png"
transitionDuration="300ms"
transitionProperty="opacity"
w="64px"
/>
<Text color="$text" typography="title">
Devup UI on React Native
</Text>
<Badge label={`${theme ?? 'light'} theme`} />
<Box
animationDuration="400ms"
animationName={fadeIn}
bg="$card"
borderRadius="$radius"
boxShadow="$raised"
maxW={[null, null, '480px']}
p={[4, null, 6]}
testID="card"
w="100%"
>
<Text color="$muted" fontSize="14px" mb={2}>
Expand All @@ -60,6 +73,7 @@ export function App() {
onChangeText={setName}
px={3}
py={2}
testID="name"
value={name}
/>
<Text color={name ? '$text' : '$placeholder'} mt={2}>
Expand All @@ -76,6 +90,7 @@ export function App() {
bg="#5a44ff"
className={button}
onPress={() => setCount(count + 1)}
testID="count"
>
<Text color="#fff" fontWeight="600">
Pressed {count} times
Expand All @@ -86,6 +101,7 @@ export function App() {
border="1px solid $border"
className={button}
onPress={() => setTheme(theme === 'dark' ? 'light' : 'dark')}
testID="theme"
>
<Text color="$text">
Switch to {theme === 'dark' ? 'light' : 'dark'}
Expand Down
1 change: 1 addition & 0 deletions apps/landing/src/app/(detail)/docs/LeftMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export function LeftMenu() {
<MenuItem to="/docs/features">{t('features')}</MenuItem>
<MenuItem to="/docs/limitations">{t('limitations')}</MenuItem>
<MenuItem to="/docs/build-errors">{t('buildErrors')}</MenuItem>
<MenuItem to="/docs/react-native">React Native</MenuItem>
<MenuItem
subMenu={[
{
Expand Down
Loading
Loading