Skip to content

Add support for dd and dump helpers

Compare
Choose a tag to compare
@github-actions github-actions released this 21 Sep 05:10
· 3 commits to 6.x since this release

The dd helper can be used like console.log but it provides a better visual experience and also comes with a HTML printer. The helper throws an exception and self handles itself to render the dumped value inside the browser (during an HTTP request) or in the console (default output).

You can use the dd helper as follows.

import { dd } from '@adonisjs/core/services/dd'
dd(someValue)

The same helper is available in Edge template as @dd tag. Also, within Edge templates you may use the @dump to inspect a value without throwing an exception.

{{-- Dump and halt rendering --}}
@dd(someValue)

{{-- Dump and continue rendering --}}
@dump(someValue)

Bug Fixes

  • handle case where stdout.columns can be undefined (437cb2d)
  • handle case where whitespace is a negative value (638c457)
  • handle NaN value case (619a3a8)
  • use poppinss/colors as styleText is not widely supported (2a491ec)

Features

  • add dumper and upgrade edge.js with new stacks functionality (f6e05ba)
  • improve dd output and add edge plugin (9b18e6a)

Full Changelog: v6.13.1...v6.14.0