Skip to content

Releases: shelfio/bem

v5.0.0 Slim ben-cn version. Drop mixes, state & other utils

08 Dec 09:53
Compare
Choose a tag to compare

What's Changed

  • chore(deps): update dependency @types/jest to v29.5.8 by @renovate in #37
  • chore(deps): update size-limit to v10.0.3 by @renovate in #38
  • chore(deps): update dependency @types/jest to v29.5.10 by @renovate in #40
  • chore(deps): update dependency @shelf/eslint-config to v3.11.2 by @renovate in #41
  • chore(deps): update size-limit to v11 (major) by @renovate in #39
  • chore(deps): update code style deps by @renovate in #42
  • chore(deps): update dependency @types/jest to v29.5.11 by @renovate in #45
  • Fork bem-cn & remove unused APIs by @slavik-chapelskyi in #46

Full Changelog: v4.0.8...v5.0.0

4.0.0 Migrate package to ESM. Simplify API

13 Jul 13:43
Compare
Choose a tag to compare

BREAKING CHANGE:
Remove b & blazeHelper. Use the return function of createBlock instead.
The definition has not changed, only how its get called

Usage

import {b, createBlock} from '@shelf/bem'
// before
const block = createBlock('heading') 
b(block)

// after 
import {createBlock} from '@shelf/bem'
const b = createBlock('heading') 
b()

All changes

Before After
b(block) b()
b(block, 'list') b('list')
b(block, 'list-item', 'active') b('list-item', {active: true})
b(block, '', 'active') b({active: true})
b(block, '', ['active', 'hovered']) b({active: true, hovered: true})
b(block, 'list-item', [isActive && 'active', isHovered && 'hovered']) b('list-item', {active: isActive, hovered: isHovered})

Codemod for updating https://github.com/shelfio/codemod#shelf-bem