Skip to content

1.2.0 β2

Pre-release
Pre-release
Compare
Choose a tag to compare
@ampersarnie ampersarnie released this 14 Dec 16:57
· 43 commits to release/1.2 since this release

⚠️ This is a Beta release. Do not use in production.

Whats New?

WordPress Dependency Extraction

Support for usage of @wordpress packages within code to allow for more native and standard usage of Gutenberg elements.

// Previously
const { registerBlockType } = wp.block;
const { __ } = wp.i18n;

// Now supported:
import { registerBlockType } from '@wordpress/blocks';
import { __ } from '@wordpress/i18n';

Aliases

To aide with directory traversion within components or files we can add a number of predefined aliases that allow for easier time with referencing directories based around a common structure that we use for our projects. This means we can avoid backstepping through directories to get back to a base directory. For example we may find we have a situation where we're backstepping to get to the components directory like this;

const { MyButtons } from '../../../components/buttons';

With aliases, this can easily be replaced with the following if required;

const { MyButtons } from '@Components/buttons';

The following are currently supported;

  • @Components{project-root}/src/components
  • Components{project-root}/src/components
  • @Static{project-root}/src/static
  • Static{project-root}/src/static
  • @Utils{project-root}/src/utils
  • Utils{project-root}/src/utils

Change Log

  • Adds alias resolving support to projects.
  • Adds support for @wordpress packages using the WordPress dependency extraction package.