Skip to content

Commit db13db9

Browse files
Fix various issues with slots (#933)
* WIP: initial set up and test * WIP: check point * don't print render for whitespace-only text nodes * oops * update whitespace in tests * update whitespace in tests * chore: changeset * add missed updated test * fix edge case * chore: more descriptive comments * chore: reformulate comments for clarity * revert to initial code with more descriptive vars * refactor * parens around custom element slots for consistency * update tests * handle template strings * ignore slots w dynamic names without parent expr * update test * fix test * check point * update tests * WIP: handle default slots and text nodes better * refactor: break things down into functions * test: add tests and rename current ones * chore: changeset * save a poor man's RAM * remove unnecessary use of pointers * `processNestedSlotEntries` -> `generateEndSlotIndexes` * make the linter happy * fix https://github.com/withastro/astro/issues/8687 * use a special `renderSlotTemplate` func for slots * test: update test * test: add more complex nested slot expr test * better positioning of comma between slot groups * revert `renderSlotTemplate` function * chore: more detailed changeset * chore: update test --------- Co-authored-by: Nate Moore <[email protected]> Co-authored-by: Nate Moore <[email protected]>
1 parent 56ace04 commit db13db9

File tree

3 files changed

+479
-222
lines changed

3 files changed

+479
-222
lines changed

.changeset/green-camels-hide.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astrojs/compiler': minor
3+
---
4+
5+
- Adds support for dynamic slots inside loops
6+
- Fixes an issue where successive named slotted elements would cause a runtime error
7+
- Fixes an issue in which if there was an implicit default slotted element next to named one, the former would get swallowed by the later.

0 commit comments

Comments
 (0)