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
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@ jobs:
- name: Test the library compiler host
run: bun run test:library

# The application host resolves a consumer's declared runtime by reading
# `solid-layouts`'s built entry off disk, so the runtime has to exist
# before these run. Without this the job fails on a missing
# `packages/solid-layouts/dist/index.js`, which reads as a broken
# resolver rather than an unbuilt dependency.
- name: Build the runtime the application host resolves against
working-directory: packages/solid-layouts
run: bun install --frozen-lockfile && bun run build

- name: Test the application compiler host
run: bun run test:application

Expand Down
12 changes: 6 additions & 6 deletions Test-UI/bundle/components/button/Button.generated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ type ButtonProps = Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "disabled">
className?: string;
};

const Button: Layout<typeof button, ButtonProps> = ({ slot, children }, p) => {
const Button: Layout<typeof button, ButtonProps> = (_stable, p) => {
const disabled = Boolean(p.isDisabled) || Boolean(p.isPending);

return (
<button
type="button"
{...slot.root}
{..._stable.slot.root}
data-pending={p.isPending ? "true" : "false"}
data-selected={p.isSelected ? "true" : "false"}
disabled={disabled}
Expand All @@ -45,14 +45,14 @@ const Button: Layout<typeof button, ButtonProps> = ({ slot, children }, p) => {
}}
>
<Show when={p.isPending}>
<span {...slot.spinner} aria-hidden="true" />
<span {..._stable.slot.spinner} aria-hidden="true" />
</Show>
<Show when={p.startIcon}>
<span {...slot.startIcon}>{p.startIcon}</span>
<span {..._stable.slot.startIcon}>{p.startIcon}</span>
</Show>
{children}
{_stable.children}
<Show when={p.endIcon}>
<span {...slot.endIcon}>{p.endIcon}</span>
<span {..._stable.slot.endIcon}>{p.endIcon}</span>
</Show>
</button>
);
Expand Down
14 changes: 7 additions & 7 deletions Test-UI/bundle/components/chip/Chip.generated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,32 @@ export type ChipProps = Omit<JSX.HTMLAttributes<HTMLSpanElement>, "color"> & {
className?: string;
};

const Chip: Layout<typeof chip, ChipProps> = ({ slot, children }, p) => (
const Chip: Layout<typeof chip, ChipProps> = (_stable, p) => (
<span
{...slot.root}
{..._stable.slot.root}
data-disabled={p.isDisabled ? "true" : "false"}
data-removable={p.onRemove ? "true" : "false"}
>
<Show when={p.startIcon}>
<span {...slot.startIcon}>{p.startIcon}</span>
<span {..._stable.slot.startIcon}>{p.startIcon}</span>
</Show>
<span {...slot.label}>{children}</span>
<span {..._stable.slot.label}>{_stable.children}</span>
<Show when={p.onRemove && p.endIcon}>
<button
type="button"
{...slot.remove}
{..._stable.slot.remove}
aria-label={p.removeButtonLabel ?? "Remove"}
disabled={Boolean(p.isDisabled)}
onClick={(event) => {
event.stopPropagation();
p.onRemove?.();
}}
>
<span {...slot.removeIcon}>{p.endIcon}</span>
<span {..._stable.slot.removeIcon}>{p.endIcon}</span>
</button>
</Show>
<Show when={!p.onRemove && p.endIcon}>
<span {...slot.endIcon}>{p.endIcon}</span>
<span {..._stable.slot.endIcon}>{p.endIcon}</span>
</Show>
</span>
);
Expand Down
6 changes: 3 additions & 3 deletions Test-UI/bundle/components/flex/Flex.generated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ export type FlexProps = Omit<JSX.HTMLAttributes<HTMLElement>, "ref"> & {
className?: string;
};

const Flex: Layout<typeof flex, FlexProps> = ({ slot, children }, p) => (
<Dynamic component={p.as ?? "div"} {...slot.root}>
{children}
const Flex: Layout<typeof flex, FlexProps> = (_stable, p) => (
<Dynamic component={p.as ?? "div"} {..._stable.slot.root}>
{_stable.children}
</Dynamic>
);

Expand Down
6 changes: 3 additions & 3 deletions Test-UI/bundle/components/icon/Icon.generated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ export type IconProps = IComponentBaseProps & {
name?: string;
};

const Icon: Layout<typeof icon, IconProps> = ({ slot, children }, p) => {
const Icon: Layout<typeof icon, IconProps> = (_stable, p) => {
const width = p.width ?? 24;
const height = p.height ?? 24;

const classes = createMemo(() =>
twMerge(slot.root.class, p.name, p.class, p.className),
twMerge(_stable.slot.root.class, p.name, p.class, p.className),
);

return (
<span
{...slot.root}
{..._stable.slot.root}
{...{ class: classes() }}
style={{
width: `${width}px`,
Expand Down
8 changes: 4 additions & 4 deletions fixtures/cases/bare-identifiers/output.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import type { Layout } from "solid-layouts";
import { Show } from "solid-js";
import { accordionTrigger } from "./Accordion.recipe";

export const AccordionTriggerLayout: Layout<typeof accordionTrigger> = ({ slot, children }, p) => (
<button {...slot.root} type="button">
{children}
export const AccordionTriggerLayout: Layout<typeof accordionTrigger> = (_stable, p) => (
<button {..._stable.slot.root} type="button">
{_stable.children}
<Show when={p.showIndicator}>
<span {...slot.indicator} />
<span {..._stable.slot.indicator} />
</Show>
</button>
);
4 changes: 2 additions & 2 deletions packages/rsbuild-plugin-solid-layouts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rsbuild-plugin-solid-layouts",
"version": "0.1.3",
"version": "0.1.4",
"description": "Rsbuild integration for the Solid Layouts library and application compilers",
"license": "MIT",
"type": "module",
Expand All @@ -19,7 +19,7 @@
"index.d.ts"
],
"dependencies": {
"solid-layouts-oxc": "0.1.6"
"solid-layouts-oxc": "0.1.7"
},
"peerDependencies": {
"@rsbuild/core": ">=1.3.0"
Expand Down
Loading
Loading