Skip to content

Releases: slimjs/slim.js

Fix: Safari & Firefox may not compute repeaters

10 Nov 10:30
Compare
Choose a tag to compare

Slim 3.0.0 - Reloaded!

30 Oct 21:23
Compare
Choose a tag to compare

Please notice: Breaking Changes

Slim is now rebuilt keeping the same functionality (and plenty of more added), and reduced the code by about 50%!
It is 6404 Bytes only (gzipped).

Simplest syntax (ever)

Binding (PAP)

<some-element bind:user-data="myUser"></some-element>

will bind parent::myUser to child::userData (and the attribute user-data)

<some-element bind:user-data="getData(myUser)"></some-element>

will wrap any changes to parent::myUser with parent::getData function

Binding (Text)

<p bind>Hello {{myUser.name}}. You have {{messages.length}} unread messages</p>
<p bind>Here is one: {{getRandomMessage(messages)}}</p>

Repeaters

<ol><li s:repeat="items as item" bind>{{item.title}}</li></ol>

Conditional

<div slim-if="someBoolean">
  <p>Hello, Slim.js</p>
</div>

# Custom bindings (added in 3.0.0) :sparkles:
`[static]` Slim::bind(sourceElement, scopedElement, `string` expression, `function` executor)
Example usage:

```javascript
Slim.bind(this, other, 'user.name', (target, computedValue) => {
// user has changed
// computedValue = "John"
// do anything on target
})

Plugins ✨

AOP style element management

Slim.plugin(phase, target => {
// element is now in phase
// possible phases are: "create", "added", "beforeRender", "afterRender", "removed"
})

Reduced clutter

no more underscored "private" properties. Everything is wrapped inside native Symbols.

Documentation

The documentation of Slim 3 is a work in progress. Collaborators are welcome.

Deprecated in 3.0.0

  • on%Prop%Changedis no more. Developers can useSlim.bindorSlim.bindOwn` to handle changes in properties
  • Array monkey patching removed. Slim encourages you to use immutable arrays. It's faster.

✨Brand new Slim.js!✨

#20

23 Jul 15:30
Compare
Choose a tag to compare
#20
v2.9.11

2.9.11

V1 check update

21 Jul 19:57
Compare
Choose a tag to compare
2.9.10

2.9.10

v2.9.9

29 May 13:34
Compare
Choose a tag to compare
2.9.9

Performance improvements for nested repeaters

25 May 14:41
Compare
Choose a tag to compare

Performance improvements for repeater

23 May 20:03
Compare
Choose a tag to compare

Performance improvements for repeater

21 May 12:25
Compare
Choose a tag to compare

Introducing Injectors

17 May 19:37
Compare
Choose a tag to compare
<child-element prop="{model}"></child-element>

Slim.inject('model', element => {
  return someImportantObject(element);
});

Performance improvements for repeater

16 May 18:50
Compare
Choose a tag to compare