Make Instant Package Updates and Test Impact on Dependent Projects

How to Efficiently Edit Shared Modules and See the Effects on Dependent ProjectsBit is a widely used tool for managing shared components and modules across multiple projects. Bit components are essentially standard packages that can be independently ma…


This content originally appeared on Bits and Pieces - Medium and was authored by Eden Ella

How to Efficiently Edit Shared Modules and See the Effects on Dependent Projects

Bit is a widely used tool for managing shared components and modules across multiple projects. Bit components are essentially standard packages that can be independently maintained without the hassle of dedicated repositories or complex setups.

This allows for quick edits and updates to shared components without sifting through vast codebases or hopping between repositories. To ensure updates are compatible across dependent components and consumer projects, a CI system must validate and propagate these changes.

Let’s see how Bit makes this process quick and efficient.

Updating components and testing their impact on direct and indirect dependent components

Bit components are stored in access-controlled scopes on the Bit Platform, with each component having its own page displaying documentation, an API reference, a visual dependency graph, and other key information.

An ‘Edit component’ button in the top-right corner lets you quickly modify components directly within the browser.

A component page for a ‘button’ component

Once changes are made, you can either version and release the component or mark it as a pre-release for further review.

A Bit component edited instantly in the browser using Cloud Workspaces

Multiple component updates can be grouped into a ‘lane,’ allowing you to review, build, test, and release them as a single, cohesive update.

A ‘Bit Lane’ with changes across multiple shared components

“Lanes” are often used even for a single component change as they pack with them many features that make it easier to review the component and test its effect on its dependents.

A Bit component versioned and built with Ripple CI

You can also simulate the impact of changes in a lane by building and testing dependent components, even those owned by other teams or users.

Running a simulation to asses the impact of changes made to one shared component on its dependents

Testing changes in Bit and non-Bit projects

Pre-release versions of shared components can be tested by installing their pre-release builds. Unlike ‘release versions,’ which follow SemVer tagging (e.g., 1.2.3), pre-released components are assigned a unique hash for versioning

A pre-released versin of a Bit component can be installed as a package using Bit or other NPM clients

For example, to install a pre-release version of the previously updated “button” component, in a Bit project:

bit install @bitdesign/sparks.actions.button@0.0.0-b5de15077e636192a6ceed332e8f356bd70d395e

In non-Bit projects you can use other package manager, such as npm:

npm install @bitdesign/sparks.actions.button@0.0.0-b5de15077e636192a6ceed332e8f356bd70d395e

Bit offers a range of CI integrations that automatically update projects with pre-release component versions within a single lane.

Bit Tasks for Git

For example, you can assess the impact of changes made to multiple shared components on your project by running a CI task that creates a new branch with the updated versions and executes tests.

# A Github action that tests the impact of changes to multiple shared components

name: Verify Lane In Consumer
on:
workflow_dispatch:
inputs:
lane-id:
description: 'The ID of the lane to install from in the format: org.scope/lane'
required: true
default: ''
permissions:
contents: write
jobs:
build:
// ...
steps:
// ...
- name: Verify Lane In Consumer
uses: bit-tasks/verify-lane-in-consumer@v1
with:
lane-id: ${{ github.event.inputs.lane-id }}
package-manager: 'npm'
test-command: 'npm test'
Testing the impact of changes made to shared components on a consumer non-Bit project

Conclusion

Bit offers a seamless and efficient way to manage and update shared components across multiple projects, simplifying the process of testing their impact on dependent components.

With features like Lanes, Ripple CI, Cloud Workspaces, and the ability to integrate with popular CI/CD pipelines, teams can confidently make updates and ensure compatibility across their codebase.

The ability to quickly edit components, run tests, and assess the effect of changes in Bit and non-Bit projects means that developers can maintain agility without sacrificing stability. By leveraging Bit’s robust infrastructure, you can streamline your package update workflow, ultimately improving collaboration and reducing the complexity of managing shared modules across your organization.

Learn More


Make Instant Package Updates and Test Impact on Dependent Projects was originally published in Bits and Pieces on Medium, where people are continuing the conversation by highlighting and responding to this story.


This content originally appeared on Bits and Pieces - Medium and was authored by Eden Ella


Print Share Comment Cite Upload Translate Updates
APA

Eden Ella | Sciencx (2024-09-17T21:59:08+00:00) Make Instant Package Updates and Test Impact on Dependent Projects. Retrieved from https://www.scien.cx/2024/09/17/make-instant-package-updates-and-test-impact-on-dependent-projects/

MLA
" » Make Instant Package Updates and Test Impact on Dependent Projects." Eden Ella | Sciencx - Tuesday September 17, 2024, https://www.scien.cx/2024/09/17/make-instant-package-updates-and-test-impact-on-dependent-projects/
HARVARD
Eden Ella | Sciencx Tuesday September 17, 2024 » Make Instant Package Updates and Test Impact on Dependent Projects., viewed ,<https://www.scien.cx/2024/09/17/make-instant-package-updates-and-test-impact-on-dependent-projects/>
VANCOUVER
Eden Ella | Sciencx - » Make Instant Package Updates and Test Impact on Dependent Projects. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/09/17/make-instant-package-updates-and-test-impact-on-dependent-projects/
CHICAGO
" » Make Instant Package Updates and Test Impact on Dependent Projects." Eden Ella | Sciencx - Accessed . https://www.scien.cx/2024/09/17/make-instant-package-updates-and-test-impact-on-dependent-projects/
IEEE
" » Make Instant Package Updates and Test Impact on Dependent Projects." Eden Ella | Sciencx [Online]. Available: https://www.scien.cx/2024/09/17/make-instant-package-updates-and-test-impact-on-dependent-projects/. [Accessed: ]
rf:citation
» Make Instant Package Updates and Test Impact on Dependent Projects | Eden Ella | Sciencx | https://www.scien.cx/2024/09/17/make-instant-package-updates-and-test-impact-on-dependent-projects/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.