Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions apps/landing/src/app/(detail)/docs/limitations/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ A dynamic value such as `width` becomes a CSS variable set in `style`, so a comp
- Inside `<ClassNames>`, `cx(getClass())` is a build error; put the result in a variable first, which then joins as a class.
- `withComponent` takes a tag name or a component written as a name or `a.b`. A target only the runtime knows, as `withComponent(make())`, is a build error: the styled component compiles to a plain function with no `withComponent`. Pass the target directly, or render with `as`.
- The plugins read `jsxImportSource` from the `tsconfig.json` (or `jsconfig.json`) in the working directory. Opt out with `importAliases: { '@emotion/react/jsx-runtime': false }`.
- The Bun plugin compiles `.ts`, `.tsx`, `.jsx` and `.mjs` files, but `.js` files only inside `@devup-ui` packages: Devup UI code in a `.js` file of your own project reaches the runtime placeholders. Use `.jsx`, `.tsx` or `.mjs` for it. A Bun runtime plugin must return the source of every file it matches, and Bun reads that source as an ES module, so matching `.js` files would break CommonJS ones.
- Code that only the runtime can compute — other globals, `Date`, `Math.random`, `new`, classes, async code — is never run by the build; on an element it stays a CSS variable, elsewhere it is a build error.

## Build errors
Expand Down
13 changes: 13 additions & 0 deletions packages/bun-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@ module in the bundle. Imports of the packages Devup UI takes the place of
Class names are short in `Bun.build` and readable under the runtime; pass
`debug` to choose.

## Compiled Files

`.ts`, `.tsx`, `.jsx` and `.mjs` files are compiled wherever they are, and
`.js` files only inside `@devup-ui` packages. Devup UI code in a `.js` file of
your own project is not compiled and reaches the runtime placeholders
(`Cannot run on the runtime`). Give such files a `.jsx`, `.tsx` or `.mjs`
extension.

The runtime cannot take those files on. A Bun runtime plugin must return the
source of every file its filter matches, it cannot hand a file back to Bun, and
Bun reads returned source as an ES module, so a CommonJS `.js` file
(`require`, `module.exports`) it matched would stop loading.

## Compiler Engine

The native compiler is selected by default, including the zero-config preload.
Expand Down
Loading