Skip to content
Open
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
20 changes: 0 additions & 20 deletions .changeset/dev-only-code-uxf-918.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/docs-shared-helpers-uxf-983.md

This file was deleted.

20 changes: 0 additions & 20 deletions .changeset/dynamic-root-passthrough-uxf-913.md

This file was deleted.

23 changes: 0 additions & 23 deletions .changeset/fallthrough-attributes-uxf-917.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/read-once-uxf-991.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/shared-helpers-angular-uxf-980.md

This file was deleted.

12 changes: 0 additions & 12 deletions .changeset/shared-helpers-closeout-uxf-982.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/shared-helpers-qwik-uxf-981.md

This file was deleted.

10 changes: 0 additions & 10 deletions .changeset/shared-helpers-react-uxf-977.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/shared-helpers-solid-uxf-978.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/shared-helpers-svelte-astro-uxf-979.md

This file was deleted.

31 changes: 31 additions & 0 deletions packages/analyzer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# @unframework.dev/analyzer

## 0.4.0

### Minor Changes

- bde7690: Add `isDev`, for code that runs only in a development build. Import it from `@uxfront/unframework` and write `if (isDev) { … }` at the top of the setup or in client code, to warn a component's author without shipping the warning: `if (isDev) { if (!label) console.warn("IconButton has no accessible name."); }`. Each target writes its framework's own check, which a production build drops: `process.env.NODE_ENV !== "production"` on React, Vue and Svelte, `isDev` from `solid-js/web`, `@solidjs/web` or `@qwik.dev/core/build` on Solid, Solid 2 and Qwik, `ngDevMode` on Angular and `import.meta.env.DEV` on Astro. Any other read of `isDev` is the new error UF2040. A React, Vue or Svelte server reads `process.env.NODE_ENV` as it runs, so start a production server with `NODE_ENV=production`.

`ToolchainContext` takes an optional `mode`, `"production"` or `"development"`, which Qwik's `frameworkEmit` reads.

- bde7690: Pass a consumer's attributes, listeners and ref through to a component whose root is a `<component is>` over tags, on whichever tag renders. An attribute that every tag takes, like `id`, `title`, `aria-*` or `data-*`, and a DOM listener now land on the element that renders, where they used to be UF1002: `<Button href="#docs" id="docs" aria-describedby="hint" onClick={track} />`. An attribute that only some tags take is still UF1002, as `disabled` is on `<component is={href ? "a" : "button"}>`, since `<a>` doesn't take it: declare it as a prop and set it on the `<component is>`. A `ref` on such a component holds the element that renders, typed as the union of the tags' elements: `useTemplateRef<HTMLAnchorElement | HTMLButtonElement>()`.

`ComponentApi` has a new field, `refTags`, the tags a ref may hold. Each target writes the rest its own way, which ADR-0122 records.

On Angular, an element with a static attribute holding `{{` is printed where Angular binds nothing, so a child whose root is one takes nothing that falls through. A parent that passes it an attribute, a listener, `class` or `style` now gets UF1002 on Angular, where the Angular output used to drop it.

- bde7690: Pass a consumer's attributes, listeners and ref through to a component's root on every target. An attribute or a DOM listener a component doesn't declare now lands on its root element, or passes on to its root component, where it used to be UF3035 or UF3036: `<SaveButton id="save" aria-describedby="hint" type="submit" onFocus={track} />`. The consumer's value wins over the root's own, and `class` and `style` merge as before. A `ref` on a component that doesn't call `defineExpose` holds its root element, typed as that element: `useTemplateRef<HTMLButtonElement>()`. To put what a consumer passes on another element, set `defineOptions({ inheritAttrs: false })` and spread the props' rest on it, `function Field({ label, ...rest }: FieldProps)` with `<input {...rest} />`.

Each target writes it its own way, which ADR-0118 records. Two changes to what the outputs declare:

- React's `<Name>Attributes` is now a type alias of the root element's props, without the component's own.
- Angular reserves `ufAttributes`, `ufListeners` and `ufElement` as prop names (UF2003), since a component that takes fallthrough declares them. A hand-written Angular consumer passes an attribute in `[ufAttributes]`, since one written on the host stays on the host.

### Patch Changes

- Updated dependencies [bde7690]
- Updated dependencies [03b6dab]
- Updated dependencies [bde7690]
- Updated dependencies [bde7690]
- Updated dependencies [487bad7]
- @unframework.dev/ir@0.4.0
- @unframework.dev/diagnostics@0.5.0

## 0.3.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unframework.dev/analyzer",
"version": "0.3.0",
"version": "0.4.0",
"description": "The Unframework analyser: scopes, macros and semantic checks over the parsed source, and lowering of the returned JSX into the portable IR.",
"keywords": [
"analyzer",
Expand Down
17 changes: 17 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# @unframework.dev/cli

## 0.3.0

### Minor Changes

- 487bad7: Helpers live in shared modules (ADR-0121). A target puts each helper it emits for a missing primitive through `EmitContext.helper` into one module per helper, `_unframework/<file>` at the root of the output tree, which every output imports. React shares its helpers this way, so a tree holds each once. `compile()` now returns the helper modules beside the components, lists their paths in `CompileResult.helpers`, and takes a `helperRoot` option. A caller that writes only the component files must write the helper modules too. The CLI writes each once per tree, `--package` carries them, and the unplugin loads each from one virtual id per graph, with a `helperRoot` option. UF1104 also covers a shared module that would take a helper module's place.

### Patch Changes

- Updated dependencies [bde7690]
- Updated dependencies [03b6dab]
- Updated dependencies [bde7690]
- Updated dependencies [bde7690]
- Updated dependencies [bde7690]
- Updated dependencies [487bad7]
- @unframework.dev/diagnostics@0.5.0
- @unframework.dev/compiler@0.4.0

## 0.2.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unframework.dev/cli",
"version": "0.2.2",
"version": "0.3.0",
"description": "The `unframework` command line: `build`, `check`, `explain` and `init`.",
"keywords": [
"unframework"
Expand Down
Loading