Skip to content

refactor: remove fast-element sideEffects metadata#7493

Merged
janechu merged 2 commits intoreleases/fast-element-v3from
copilot/pr4-sideeffects-cleanup
Apr 24, 2026
Merged

refactor: remove fast-element sideEffects metadata#7493
janechu merged 2 commits intoreleases/fast-element-v3from
copilot/pr4-sideeffects-cleanup

Conversation

@janechu
Copy link
Copy Markdown
Collaborator

@janechu janechu commented Apr 24, 2026

Pull Request

📖 Description

This draft removes the remaining packaging-time side-effect assumptions from @microsoft/fast-element and flips the package to "sideEffects": false.

  • make declarative.js import-pure by moving declarative runtime setup behind a lazy internal runtime hook
  • convert debug.js to an explicit value-based entrypoint while keeping index.debug.js and index.rollup.debug.js opt-in debug behavior intact
  • keep the shared FAST debug-message lookup and idle-callback setup working after the metadata flip
  • update the directly related docs/tests and package metadata for the final sideEffects cleanup

👩‍�� Reviewer Notes

The main review points are declarative/runtime.ts, the debug entrypoint changes, and the package metadata flip in package.json. The important question is whether the package is now honestly safe to ship with sideEffects: false; the changed tests/builds are aimed at that exact concern.

📑 Test Plan

  • npm run build -w @microsoft/fast-element
  • npm run test:chromium -w @microsoft/fast-element
  • node build/biome-changed.mjs
  • node build/biome-changed.mjs check
  • npm run doc:ci -w @microsoft/fast-element
  • npm run doc:exports:ci -w @microsoft/fast-element
  • npm run test:playwright -w @microsoft/fast-element

✅ Checklist

General

  • I have included a change request file using $ npm run change
  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

@janechu janechu force-pushed the copilot/pr3-declarative-template-bridge branch from a404d23 to 70790c9 Compare April 24, 2026 16:14
@janechu janechu force-pushed the copilot/pr4-sideeffects-cleanup branch from 70becf1 to 1fd9892 Compare April 24, 2026 16:14
@janechu janechu force-pushed the copilot/pr3-declarative-template-bridge branch from 70790c9 to 7136abc Compare April 24, 2026 16:44
@janechu janechu force-pushed the copilot/pr4-sideeffects-cleanup branch from 1fd9892 to 0589311 Compare April 24, 2026 16:44
@janechu janechu force-pushed the copilot/pr3-declarative-template-bridge branch from 7136abc to 27e9651 Compare April 24, 2026 16:50
@janechu janechu force-pushed the copilot/pr4-sideeffects-cleanup branch from 0589311 to ebe87ab Compare April 24, 2026 16:50
@janechu janechu force-pushed the copilot/pr3-declarative-template-bridge branch from 27e9651 to 48ab602 Compare April 24, 2026 17:20
@janechu janechu force-pushed the copilot/pr4-sideeffects-cleanup branch from ebe87ab to e9ea204 Compare April 24, 2026 17:20
@janechu janechu force-pushed the copilot/pr3-declarative-template-bridge branch from 48ab602 to bd5d9fd Compare April 24, 2026 17:40
@janechu janechu force-pushed the copilot/pr4-sideeffects-cleanup branch from e9ea204 to 07c4af0 Compare April 24, 2026 17:40
@janechu janechu force-pushed the copilot/pr3-declarative-template-bridge branch from bd5d9fd to 9f05f56 Compare April 24, 2026 19:30
@janechu janechu force-pushed the copilot/pr4-sideeffects-cleanup branch from 07c4af0 to 2187b1c Compare April 24, 2026 19:30
@janechu janechu force-pushed the copilot/pr3-declarative-template-bridge branch from 9f05f56 to 85c2295 Compare April 24, 2026 19:42
@janechu janechu force-pushed the copilot/pr4-sideeffects-cleanup branch from 2187b1c to 5279371 Compare April 24, 2026 19:42
@janechu janechu force-pushed the copilot/pr3-declarative-template-bridge branch from 85c2295 to 108f340 Compare April 24, 2026 19:57
@janechu janechu force-pushed the copilot/pr4-sideeffects-cleanup branch from 5279371 to 01b69b8 Compare April 24, 2026 19:57
@janechu janechu force-pushed the copilot/pr3-declarative-template-bridge branch from 108f340 to cf5f14e Compare April 24, 2026 20:19
@janechu janechu force-pushed the copilot/pr4-sideeffects-cleanup branch from 01b69b8 to 7cfeee6 Compare April 24, 2026 20:19
janechu added a commit that referenced this pull request Apr 24, 2026
# Pull Request

## 📖 Description

Adds a new **Declarative HTML** documentation section to the 3.x docs site with four pages covering the full declarative template authoring workflow:

- **Overview** — Purpose of declarative templates, when to use them, a hello world example, and comparison with imperative `html` tagged templates.
- **Writing f-templates** — Template syntax including content/attribute/boolean/event bindings, directives (`f-when`, `f-repeat`, `f-ref`, `f-slotted`, `f-children`), dot-notation paths, execution context access (`$e`, `$c`), and expression limitations.
- **Defining Elements** — `TemplateElement` registration, `templateOptions: "defer-and-hydrate"`, lifecycle callbacks (`config()`), element configuration (`options()`), `observerMap` and `attributeMap` usage.
- **Server-Side Rendering** — The renderer-agnostic SSR contract, hydration flow, Declarative Shadow DOM output, state propagation, and `@microsoft/fast-build` CLI usage.

Also adds cross-references from `packages/fast-element/README.md` and `DECLARATIVE_HTML.md` to the new docs.

Based on the declarative template features from PRs #7490, #7491, #7492, and #7493.

## 📑 Test Plan

- Website builds successfully with `npm run build -w sites/website`
- All four pages render correctly in the 11ty output
- `npm run checkchange` passes (no change files needed for docs-only changes to the website)

## ✅ Checklist

### General

- [x] I have included a change request file using `$ npm run change`
- [ ] I have added tests for my changes.
- [x] I have tested my changes.
- [x] I have updated the project documentation to reflect my changes.
- [x] I have read the [CONTRIBUTING](https://github.com/microsoft/fast/blob/main/CONTRIBUTING.md) documentation and followed the [standards](https://github.com/microsoft/fast/blob/main/CODE_OF_CONDUCT.md#our-standards) for this project.
@janechu janechu force-pushed the copilot/pr3-declarative-template-bridge branch from cf5f14e to 1284755 Compare April 24, 2026 21:36
@janechu janechu force-pushed the copilot/pr4-sideeffects-cleanup branch 2 times, most recently from 92b0074 to 5cf96a6 Compare April 24, 2026 21:42
Base automatically changed from copilot/pr3-declarative-template-bridge to releases/fast-element-v3 April 24, 2026 22:05
janechu and others added 2 commits April 24, 2026 15:08
Make the declarative runtime lazy, convert debug.js to an explicit value-based entrypoint, and flip @microsoft/fast-element to sideEffects false after the remaining setup-only imports are removed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@janechu janechu force-pushed the copilot/pr4-sideeffects-cleanup branch from 5cf96a6 to e400d23 Compare April 24, 2026 22:09
@janechu janechu marked this pull request as ready for review April 24, 2026 22:10
@janechu janechu merged commit 803c757 into releases/fast-element-v3 Apr 24, 2026
13 checks passed
@janechu janechu deleted the copilot/pr4-sideeffects-cleanup branch April 24, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant