What's New in Bit? Quicker build task debugging, a guide to creating Bit components in your existing project, and more!

ed
eden-e1 year ago

Weekly release notes v0.1.52

New and improved

Immediately stop the build process when a build task fails

Use the --fail-fast option to exist the build process and log the error, when a build task fails. Use this option with bit build, bit snap, and bit tag.

For example:

$bit
Copiedcopy

This option is especially useful when debugging an issue with a build task.

#7444

Modify your apps' and previews' HTML with the HTML Injector

The Webpack Config Mutator now supports adding HTML tags to your apps' and previews' built HTML. This can be useful for adding meta tags, for adding a global CSS files, and more.

For example:

export const addCssLink = (configMutator: WebpackConfigMutator) => {
  // inject Google Font
  configMutator.addElementToHtmlTemplate({
    parent: 'head',
    position: 'append',
    raw: `<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />`,
  });
โ€‹
  // inject a custom CSS stylesheet
  configMutator.addElementToHtmlTemplate({
    parent: 'head',
    position: 'append',
    raw: `<link rel="stylesheet" href="https://example.com/my-styles.css" />`,
  });
};
CopiedCopy
#7274

Squash snaps when merging lanes

Use the --squash option, when merging one lane to another, to squash snaps the lanes from that lane This is similar to a Git merge commit, where all the commits in a branch are squashed into a single commit.

This option was previously only available when merging to the 'main' lane.

For example:

$bit
Copiedcopy
$bit
Copiedcopy

Squashing snaps is useful when you want to merge a lane into another lane, but you don't want to keep the history of the snaps in the merged lane. This makes the history of the merged lane cleaner and easier to read.

#7448

Bug fixes


Internal



Demos, tools and docs

๐Ÿ‘ฉโ€๐Ÿซ Guide: Build Bit components in your existing project

Learn how to initialize a Bit workspace in your existing project, and build your components with Bit. In this guide, a new React UI component and a new Node Express route component are added to an existing project.

๐Ÿ“š Docs: How to remove components from a lane

A new section was added to the 'Lanes workflow' page, explaining how to remove components from a lane.

Read the docs.

๐Ÿ“š Docs: Learn how to wrap your Vue component previews

The Vue docs now include an updated guide for wrapping your Vue component previews with custom wrappers.

Read the docs.