Edge Js Edge Versions Save

Node.js template with a breath of fresh air

v6.0.0-3

10 months ago

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 [email protected].

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: https://github.com/edge-js/edge/compare/v6.0.0-2...v6.0.0-3

v6.0.0-2

10 months ago

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

https://github.com/poppinss/edge/compare/v6.0.0-1...v6.0.0-2

v6.0.0-1

10 months ago
  • chore: update dependencies 4759709
  • chore: bundle using tsup 134beb9

https://github.com/poppinss/edge/compare/v6.0.0-0...v6.0.0-1

v6.0.0-0

10 months ago

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

https://github.com/poppinss/edge/compare/v5.5.1...v6.0.0-0

v5.5.1

1 year ago
  • ci: update node versions 02c9d13
  • docs: update badges url 9a158c0
  • chore: update dependencies 30a284f
  • refactor: migrate to the new Japa (#128) b4023c0

What's Changed

New Contributors

Full Changelog: https://github.com/edge-js/edge/compare/v5.5.0...v5.5.1

v5.5.0

1 year ago

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

https://github.com/poppinss/edge/compare/v5.4.0...v5.5.0

v5.4.0

1 year ago

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: https://github.com/edge-js/edge/compare/v5.3.7...v5.4.0

v5.3.7

1 year ago

v5.3.6

2 years ago
  • fix: do not cache partials since they share local state with the parent template ad2ceab
  • chore: update dependencies 56784f6

Full Changelog: https://github.com/edge-js/edge/compare/v5.3.5...v5.3.6

v5.3.5

2 years ago