Skip to content

Commit

Permalink
updated: deps and removed deprecated comments expression logic
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaGuarini committed Feb 16, 2024
1 parent 4b7dc54 commit cb5dd12
Show file tree
Hide file tree
Showing 15 changed files with 803 additions and 506 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Expand Up @@ -2,3 +2,4 @@
/coverage
/node_modules
/.nyc_output
/benchmarks/old-version.cjs
18 changes: 9 additions & 9 deletions README.md
Expand Up @@ -13,7 +13,7 @@
import { template, expressionTypes } from '@riotjs/dom-bindings'

// Create the app template
const tmpl = template('<p><!----></p>', [
const tmpl = template('<p> </p>', [
{
selector: 'p',
expressions: [
Expand Down Expand Up @@ -60,7 +60,7 @@ A template will always need a string as first argument and a list of `Bindings`
Consider the following example:

```js
const tmpl = template('<p><!----></p>', [
const tmpl = template('<p> </p>', [
{
selector: 'p',
expressions: [
Expand Down Expand Up @@ -149,11 +149,11 @@ const pGreetingBinding = {
],
}

template('<article><p><!----></p></article>', [pGreetingBinding])
template('<article><p> </p></article>', [pGreetingBinding])
```

In this case we have created a binding to update only the content of a `p` tag.<br/>
_Notice that the `p` tag has an empty comment that will be replaced with the value of the binding expression whenever the template will be mounted_
_Notice that the `p` tag has an empty text node that will be replaced with the value of the binding expression whenever the template will be mounted_

</details>

Expand Down Expand Up @@ -231,7 +231,7 @@ Given for example the following template:
```html
<p>
<b>Your name is:</b><i>user_icon</i
><!---->
>
</p>
```

Expand Down Expand Up @@ -297,7 +297,7 @@ const eachBinding = {
itemName: 'val',
indexName: 'index'
evaluate: scope => scope.items,
template: template('<!---->', [{
template: template(' ', [{
expressions: [
{
type: expressionTypes.TEXT,
Expand Down Expand Up @@ -339,7 +339,7 @@ const ifBinding = {
type: bindingTypes.IF,
evaluate: scope => scope.isVisible,
selector: 'b'
template: template('<!---->', [{
template: template(' ', [{
expressions: [
{
type: expressionTypes.TEXT,
Expand Down Expand Up @@ -392,7 +392,7 @@ import moment from 'moment'
export default function HumanReadableTime({ attributes }) {
const dateTimeAttr = attributes.find(({ name }) => name === 'datetime')

return template('<!---->', [
return template(' ', [
{
expressions: [
{
Expand Down Expand Up @@ -480,7 +480,7 @@ const slots = [
],
},
],
html: '<p expr1><!----></p>',
html: '<p expr1> </p>',
},
]

Expand Down

0 comments on commit cb5dd12

Please sign in to comment.