Skip to content

chore(fast-html): use @microsoft/fast-build to build deep-merge fixture#7390

Draft
janechu wants to merge 1 commit intomainfrom
users/janechu/update-fixture-to-use-fast-build-deep-merge
Draft

chore(fast-html): use @microsoft/fast-build to build deep-merge fixture#7390
janechu wants to merge 1 commit intomainfrom
users/janechu/update-fixture-to-use-fast-build-deep-merge

Conversation

@janechu
Copy link
Copy Markdown
Collaborator

@janechu janechu commented Apr 4, 2026

Uses @microsoft/fast-build to generate the index.html for the deep-merge test fixture in @microsoft/fast-html.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
janechu added a commit that referenced this pull request Apr 8, 2026
…ssions (#7394)

# Pull Request

## 📖 Description

Fixes two gaps in the `microsoft-fast-build` Rust renderer related to data access in template expressions:

1. **Array `.length` support** — `{{items.length}}` now resolves correctly. Previously, `get_nested_property` tried to parse `"length"` as a numeric array index, which always failed and returned a `MissingState` error. A special case now returns the array's length as a number.

2. **JSON literal attribute values** — Custom element attributes can now accept JSON array and object literals directly (e.g. `items='["a","b","c"]'` or `config='{"title":"Hello"}'`). Previously, these were passed through as raw strings, causing child templates that iterated or accessed nested values to fail.

### 🎫 Issues

* Helps unblock [#7390](#7390) — deep-merge fixture uses `{{users.length}}` and `{{user.orders.length}}`
* Helps unblock [#7388](#7388) — observer-map fixture uses `{{user.posts.length}}`

## 📑 Test Plan

New Rust integration tests added:

- `tests/bindings.rs` — `test_array_length`, `test_array_length_empty`, `test_array_length_nested`
- `tests/f_when.rs` — `test_when_array_length_gt_zero`, `test_when_array_length_zero`
- `tests/custom_elements.rs` — `test_custom_element_json_array_attr`, `test_custom_element_empty_array_attr`, `test_custom_element_json_object_attr`

All existing and new tests pass (`cargo test`).

## ✅ Checklist

### General

- [x] I have included a change request file using `$ npm run change`
- [x] 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.
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