Skip to content

Releases: edge-js/edge

Export a preconfigured instance of edge

14 Aug 11:50
Compare
Choose a tag to compare
Pre-release
  • fix: last breaking commit 5554a10
  • feat: export a preconfigured edge instance and allow configuring it 503f0cd

Full Changelog: v6.0.0-5...v6.0.0-6

Improving object to HTML attributes serialization logic

14 Aug 07:26
Compare
Choose a tag to compare
  • refactor: improve serializing of object to html attributes 5d6b39d

Full Changelog: v6.0.0-4...v6.0.0-5

Fix broken exports

14 Aug 06:17
Compare
Choose a tag to compare
Fix broken exports Pre-release
Pre-release

Full Changelog: v6.0.0-3...v6.0.0-4

Bring edge-superchanrged functionality within Edge

14 Aug 04:30
Compare
Choose a tag to compare

After this release, there will be no need of the edge-supercharged plugin. However, this version works only with Node@20, because we use the readDirSync.recursive option that was added in Node@20.0.3.

Commits

  • fix: normalize component list filename to unix slashes cf04480
  • feat: bring back some of the global methods 6d1a8c7
  • feat: add supercharged plugin 936b3f0
  • feat(loader): list components 3b25406

Full Changelog: v6.0.0-2...v6.0.0-3

Foundation for Edge 6

14 Aug 04:15
Compare
Choose a tag to compare
Foundation for Edge 6 Pre-release
Pre-release

This release contains some breaking changes, but alongside a migration plugin that makes Edge 6 works like Edge 5.

New features

  • Edge is twice as fast in rendering a template.
  • Add let tag. Let tag can be used for adding inline variables. It is a replacement for the existing @set tag.
  • Add an assign tag to re-assign value to a pre-existing variable.
  • Add an eval tag to evaluate JavaScript expressions without writing their result to the output.

Breaking changes

  • Package is ESM only
  • Removed support for layouts and sections. They were badly implemented, and components serve as a better mental model for implementing layouts.
  • Removed set tag. Instead, use the let tag. Learn more
  • Changes to components props API. Learn more
  • Removed many global methods. Learn more

Compatibility plugin

You can get the newer version of Edge 6 to work like Edge 5 by registering the following plugin. AdonisJS will include this plugin by default.

import { migrate } from 'edge.js/plugins/migrate'
edge.use(migrate)

Component Props

The components props have been changed completely, and methods like serialize and serializeExcept no longer exist. Instead, you can use the toAttrs method.

Note: The compatibility plugin allows using the old API

- $props.serialize()
- $props.serializeExcept(['text'])
- $props.serializeOnly(['class'])

+ $props.toAttrs()
+ $props.except(['text']).toAttrs()
+ $props.only(['class']).toAttrs()

Remove the set tag in favor let tag.

The set tag was complex, as it did too many things together. You can use it to define an inline variable, update its value, and update the property of an existing object.

We have removed it in favor of the let tag. The let tags work exactly as JavaScript let declaration. You can also use the let tag to destructure values, which was impossible with the set tag. For example:

- @set('username', user.username)

+ @let(username = user.username)
+ @let({ username } = user)

Re-assigning value to an existing variable

- @set(user, 'username', user.username.toUpperCase())

+ @assign(user.username = user.username.toUpperCase())

For more complex operations, you can use the eval tag.

@eval(user.users.push(newUser()))
@eval(user.users = user.users ? user.users.concat(newUser()) : [newUser()])

Removal of global methods

  • Remove the raise method. It was never documented and neither used.
  • Remove the e method in favor of html.escape.
  • Remove the stringify method in favor of js.stringify.
  • Remove the safe method in favor of html.safe.

Commits

  • refactor: use object spread over Object.assign a793513
  • feat: add support for URLs for view directory path 2384d8e
  • test: use stringEqual over assert.equal 5142648
  • test: add another test for let tag 8cca7d7
  • feat: add assign tag a76e7ac
  • refactor: implement let tag 5383d69
  • refactor: cleanup components cruft and add eval tag 0d94e30
  • feat: export migrate plugin and globals becc849
  • refactor: do not stringify x-data bd7387f
  • refactor: move legacy primitives under migrate plugin 1c78d1e
  • feat: add support for serializing html attributes fdb5e3c
  • refactor: edge api and globals registration logic 311be7d
  • refactor: re-arrange source code files 0df85e6
  • style: update license docblock 55dbbc1
  • refactor: cleanup and allow @Inject tag to use functions 21a53ef
  • refactor: cleanup and performance improvements c3adc4f
  • chore: update dependencies 5ca1e06

v6.0.0-1...v6.0.0-2

Bundling with tsup

28 Jul 12:25
Compare
Choose a tag to compare
Bundling with tsup Pre-release
Pre-release

v6.0.0-0...v6.0.0-1

Pre-release of Edge 6

25 Jul 16:54
Compare
Choose a tag to compare
Pre-release of Edge 6 Pre-release
Pre-release

Breaking

  • Package is now ESM only
  • Types are now exported from their own entrypoint
  • Globals toSentence and ordinalize are now called sentence and ordinal

Changes

  • chore: add engines.node 1b1a61d
  • fix: file casing issues e05d26f
  • fix: casing issues. move to snake_case e7676bf
  • refactor: move some tests to @japa/file-system 161ba81
  • refactor: add missing globals and rename some of them f453112
  • chore: update stringify-attributes eb04a3e
  • refactor: fix some typings errors 5f2e674
  • refactor: update edge dependencies and fix breaking changes 2d798cf
  • chore: fix files casing 5ac30ab
  • ci: use org workflows 4c8ba63
  • chore: delete old .github files e01b77d
  • refactor: migrate to ESM c83b5ac

v5.5.1...v6.0.0-0

Update dependencies

20 Mar 08:14
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v5.5.0...v5.5.1

Expose API to hook into renderer instance

05 Sep 08:25
Compare
Choose a tag to compare

The Edge.onRender method will allow to hook into the renderer instance and maybe share local variables before any template gets rendered.

edge.onRender((renderer) => {
  renderer.share({  key: value })
})

Commits

  • feat: add support to hook into edge renderer instance 2de6d6a
  • chore: update dependencies bd00b98

v5.4.0...v5.5.0

Share state with Edge output processor

05 Sep 05:04
Compare
Choose a tag to compare

Commits

  • feat: share state with processor output callback 635ca02
  • chore: update dependencies 7294929
  • chore: update dependencies 513a853
  • docs(README): update sponsors list and remove individual assets 3caf8ad
  • docs(README): add sponsors to the repo 109f741
  • chore: update dependencies 5d976bf

Full Changelog: v5.3.7...v5.4.0