Skip to main content

How to deploy Lightning Web Components (LWC) with Gearset

How to deploy Lightning Web Components from org to org, and through Pipelines

Richard Terry avatar
Written by Richard Terry
Updated this week

Lightning Web Components (LWC) are an important part of many teams' customization of their Salesforce instances. You can use Gearset to deploy WC, whether from org to org or through our automated Pipelines.

How to deploy a Lightning Web Component from org to org

To see the LWC make sure that you have included them in your metadata filter when running the comparison.

This is an example of how the LWC will appear in your comparison results.

You can select the LWC and deploy it to your target environment.

How to deploy a Lightning Web Component with Pipelines

If you're using Gearset Pipelines, create a feature branch and run a comparison between your development sandbox and the feature branch as described here.

Open a pull request to the next environment in your Pipeline, and after pre-merge and validation checks have completed, promote the feature brach.

This will trigger a deployment to your target org.

Merge conflicts in Lightning Web Components

Working on a Lightning Web Component at the same time as your teammate is a common scenario. The best way to avoid this is to keep your sandbox up to date with developer sandbox updates.

If both your sandboxes are up to date and you are adding changes to the same LWC simultaneously you may need to resolve a merge conflict.

In this example, we have 2 sandboxes. Each of them is a location where developers are working separately.

Both developers create feature branches and commit changes to the same LWC. If they have updated the same file within the LWC (for example if they have both updated the html file) this will trigger a merge conflict, to let them know that they have updated the same part of the same component.

Clicking "Resolve conflicts" will open the conflict resolution modal. Here you can choose either change, or both, and mark the conflict as resolved.

After committing the resolution the pull request validation will run.

When the pull request is opened against the next environment you can use conflict replay to resolve the conflict in the same way.

We want to hear from you!

If there are use cases that you want to confirm that Gearset supports, or any suggestions that you'd like to submit to our product team please let us know using our feedback forum or in-app chat!

Did this answer your question?