| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| 0.0.1-alpha.0 source code.tar.gz | 2023-06-04 | 322.2 kB | |
| 0.0.1-alpha.0 source code.zip | 2023-06-04 | 330.8 kB | |
| README.md | 2023-06-04 | 3.3 kB | |
| Totals: 3 Items | 656.3 kB | 0 | |
✨ Adds
- Iteration:
- Using a placeholder key (eg
list.#) directs strawberry to iterate over list items and insert elements for each. - Works with
push,pop,shift,unshift,splice, etc.
- Using a placeholder key (eg
- Nesting:
- Allows for arbitrary nesting using placeholder keys.
- Updates to a property at any level of nesting updates just the affected element (unless list sequence is altered).
🚮 Removes
- Usage of
sb-child- Child elements are directly mentioned in the markdown
- To populate template slots, the
slot="slot-name"attribute can be used
Note:
- This is more verbose but also more clear and direct as it respects the browsers use of slots in template elements
- Future versions will use slot name as a fallback for sb-mark key value
🎁 Examples
A simple example:
:::html
<ul>
<li sb-mark="list.#"></li>
</ul>
<script>
data.list = ['strawberry', 'spoonberry'];
</script>
A less simple example:
:::html
<!-- Define Todo Item Component -->
<template name="todo-item">
<div>
<h3><slot name="title"></slot></h3>
<p style="font-family: monospace"><slot name="isDone"></slot></p>
<div><slot name="reasons"></slot></div>
</div>
</template>
<!-- Markup for Todo List -->
<div>
<todo-item sb-mark="todo.#">
<span slot="title" sb-mark="todo.#.title"></span>
<span slot="isDone" sb-mark="todo.#.isDone"></span>
<ul slot="reasons">
<li sb-mark="todo.#.reasons.#"></li>
</ul>
</todo-item>
</div>
<!-- Populate the Data -->
<script>
data.todo = [
{
title: 'Do Homework',
isDone: 'no',
reasons: [ 'My dog ate it.' ],
},
];
</script>
Blooper
What's Changed
- remove duplicate header in wrong spot of README by @MarkSort in https://github.com/18alantom/strawberry/pull/1
- Typo in README.md example by @davidbgk in https://github.com/18alantom/strawberry/pull/2
- Inventory: check if quantity is finite by @cy6erskunk in https://github.com/18alantom/strawberry/pull/4
- Fix updateComputed filtering (#5) by @cy6erskunk in https://github.com/18alantom/strawberry/pull/6
- refactor: microoptimization by @Ilushling in https://github.com/18alantom/strawberry/pull/11
- add nesting and loops by @18alantom in https://github.com/18alantom/strawberry/pull/9
New Contributors
- @MarkSort made their first contribution in https://github.com/18alantom/strawberry/pull/1
- @davidbgk made their first contribution in https://github.com/18alantom/strawberry/pull/2
- @cy6erskunk made their first contribution in https://github.com/18alantom/strawberry/pull/4
- @Ilushling made their first contribution in https://github.com/18alantom/strawberry/pull/11
- @18alantom made their first contribution in https://github.com/18alantom/strawberry/pull/9
Full Changelog: https://github.com/18alantom/strawberry/commits/v0.0.1-alpha.0