Skip to content

Commit cfc4285

Browse files
janechuCopilot
andcommitted
Move core helpers to subpath exports
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c656538 commit cfc4285

505 files changed

Lines changed: 20048 additions & 634 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "major",
3+
"comment": "Move core helpers such as Updates, Observable, attr, html, css, template directives, volatile, and ArrayObserver to dedicated fast-element subpath exports.",
4+
"packageName": "@microsoft/fast-element",
5+
"email": "7559015+janechu@users.noreply.github.com",
6+
"dependentChangeType": "none"
7+
}

examples/todo-app/src/todo-app.styles.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { css } from "@microsoft/fast-element/styles.js";
2-
1+
import { css } from "@microsoft/fast-element/css.js";
32
export const styles = css`
43
:host {
54
display: block;

examples/todo-app/src/todo-app.template.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { html, repeat } from "@microsoft/fast-element";
21
import { twoWay } from "@microsoft/fast-element/binding/two-way.js";
2+
import { repeat } from "@microsoft/fast-element/directives/repeat.js";
3+
import { html } from "@microsoft/fast-element/html.js";
34
import type { TodoApp } from "./todo-app.js";
45
import type { Todo } from "./todo-list.js";
56
import "./todo-form.js";
@@ -34,7 +35,7 @@ export const template = html<TodoApp>`
3435
&times;
3536
</button>
3637
</li>
37-
`
38+
`,
3839
)}
3940
</ul>
4041
`;

examples/todo-app/src/todo-form.styles.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { css } from "@microsoft/fast-element/styles.js";
2-
1+
import { css } from "@microsoft/fast-element/css.js";
32
export const styles = css`
43
form {
54
display: flex;

examples/todo-app/src/todo-form.template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { html } from "@microsoft/fast-element";
21
import { twoWay } from "@microsoft/fast-element/binding/two-way.js";
2+
import { html } from "@microsoft/fast-element/html.js";
33
import type { TodoForm } from "./todo-form.js";
44

55
export const template = html<TodoForm>`

examples/todo-app/src/todo-form.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { customElement, FASTElement, observable } from "@microsoft/fast-element";
1+
import { customElement, FASTElement } from "@microsoft/fast-element";
2+
import { observable } from "@microsoft/fast-element/observable.js";
23
import { styles } from "./todo-form.styles.js";
34
import { template } from "./todo-form.template.js";
45
import { TodoList } from "./todo-list.js";

examples/todo-app/src/todo-list.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { Observable, observable, volatile } from "@microsoft/fast-element";
21
import { Context } from "@microsoft/fast-element/context.js";
2+
import { Observable, observable } from "@microsoft/fast-element/observable.js";
33
import { reactive } from "@microsoft/fast-element/state.js";
4+
import { volatile } from "@microsoft/fast-element/volatile.js";
45

56
export type Todo = { description: string; done: boolean };
67
export type TodoListFilter = "all" | "active" | "completed";

packages/fast-element/ARCHITECTURE_HTML_TAGGED_TEMPLATE_LITERAL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# `html` tagged template literal
22

3-
The `html` export from `@microsoft/fast-element` is used to create the template logic for the custom element.
3+
The `html` export from `@microsoft/fast-element/html.js` is used to create the template logic for the custom element.
44

55
## Pre-processing the `html` tagged template literal contents
66

@@ -33,4 +33,4 @@ flowchart TD
3333
C --> E
3434
F[When a <code>createObserver</code> is called, the instance of the one time binding is returned which includes a bind method returning the arrow function executed against the controller source and context]
3535
B --> F
36-
```
36+
```

packages/fast-element/ARCHITECTURE_OVERVIEW.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Let's step back from defining the Custom Element and consider what is happening
2828

2929
First, a global `FAST` property will be created if one does not already exist, typically in browser on the `window`.
3030

31-
Additionally, when Custom Elements are included in a script a few things might happen even before a Custom Element gets detected by the browser. First, there are initial side effects caused by the use of decorators. These include the `attr` and `observable` decorators made available by the `@microsoft/fast-element` package.
31+
Additionally, when Custom Elements are included in a script a few things might happen even before a Custom Element gets detected by the browser. First, there are initial side effects caused by the use of decorators. These include the `attr` decorator from `@microsoft/fast-element/attr.js` and the `observable` decorator from `@microsoft/fast-element/observable.js`.
3232

3333
Here is a basic flow of what code is executed and when during initial load of a script that contains a FAST defined Custom Element:
3434

@@ -49,4 +49,4 @@ flowchart TD
4949
I@{ shape: dbl-circ, label: "The lifecycle steps for <code>FASTElement</code> are executed" }
5050
G --> H
5151
H --> I
52-
```
52+
```

packages/fast-element/DECLARATIVE_DESIGN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ registry-aware declarative template bridge.
5858
|---|---|
5959
| **Server-agnostic rendering** | Templates are plain HTML strings with no dependency on Node.js or any specific SSR framework. |
6060
| **Progressive enhancement** | Components can be server-rendered and then hydrated client-side without a full re-render. |
61-
| **FAST parity** | The declarative syntax maps 1-to-1 to `@microsoft/fast-element` directives (`repeat`, `when`, `slotted`, `children`, `ref`). |
61+
| **FAST parity** | The declarative syntax maps 1-to-1 to FAST Element directive helpers (`repeat`, `when`, `slotted`, `children`, `ref`) from their `@microsoft/fast-element/directives/*` subpaths. |
6262
| **Minimal authoring overhead** | Component authors write HTML, not tagged template strings, while retaining full reactive capabilities. |
6363

6464
---

0 commit comments

Comments
 (0)