Chapter 2 : Install Developer Tools for LWC

Hello Friends, Before going to this Chapter, go to the Chapter 1: Introduction to Lightning Web Component 

Let’s Get Started:

Creating a Lightning Web Component in developer console is not possible. You need to write it locally and then push it to your Org. Doing this will need to setup your developer environment which we will learn to setup in this chapter.

In this Chapter we will learn:

Step 1 : Download and Install Salesforce DX CLI

Step 2 : Download and Install VSCode

Step 3 : Install Salesforce Extension Pack

Step 4 : Connecting with your Salesforce Org

Step 1:- Install Salesforce CLI

Install Salesforce CLI 

Use the Salesforce CLI to control the full application life cycle of your Salesforce apps. With it you can easily create environments for development and testing, synchronize source code between your orgs and VCS, and execute tests.

Use it to:

  • Aggregate all the tools you need to develop with and perform commands against your Salesforce org
  • Synchronize source to and from scratch orgs
  • Create and manage orgs
  • Import and export data
  • Create and execute tests
  • Create and install packages

Operating System Link to Installer
macOS https://sfdc.co/sfdx_cli_osx
Windows 32-bit https://sfdc.co/sfdx_cli_win
Windows 64-bit https://sfdc.co/sfdx_cli_win64
Debian/Ubuntu 64 https://sfdc.co/sfdx_cli_linux
Download the archive from one of the URLs in the manifest, extract the archive, then run the ./install script.
Debian/Ubuntu x86 https://sfdc.co/sfdx_cli_linux_x86
Download the archive from one of the URLs in the manifest, extract the archive, then run the ./install script.

To sure the CLI is properly installed,In a command window, enter sfdx

Step 2:- Install JDK

Java Platform, Standard Edition Development Kit
Some features in Salesforce Extensions for VS Code depend upon the Java Platform, Standard Edition Development Kit (JDK). You need to have either version 8 or version 11 of the JDK installed.

You can install the latest version of the Java 8 JDK from Java SE Development Kit 8 Downloads or the latest version of the Java 11 JDK from Java SE Development Kit 11 Downloads.

Step 3:- Install an IDE

An IDE, or integrated development environment, typically consists of a code editor, build automation tools, a debugger, and intelligent code completion. Visual Studio Code provides these.

Download Visual Studio Code 

Visual Studio Code is the go-to code editor for Salesforce developers. It’s free, open-source, and available for Windows, Linux, and macOS. This editor has easy-to-install extensions for syntax highlighting, code completion, and more.

Launch Visual Studio code

The welcome page from Visual Studio Code.

Step 4:- Install Extensions to support Development

Install Extensions to support the development.

On the left toolbar, click the Extensions icon Visual Studio Code's Extension icon.

Install Salesforce Extension Pack

This extension pack includes tools for developing on the Salesforce platform in the lightweight, extensible VS Code editor.

It includes following functionality:

  • Language Services for Apex
  • Language Services for Visualforce
  • Language Services for Lightning Components (Aura and Lightning Web Components)
  • Integrations in the activity bar for Apex tests and Replay Debugger.

Install Extension Lightning Web Component 

This extension provides code-editing features for the Lightning Web Components programming model, which is part of the Lightning Component framework. It uses the default HTML language server from VS Code to provide syntax highlighting, code completion, and an outline view of your files.

Set Up Linting

Linting finds errors in your code while you’re editing, before you compile. Linting is more than spell-checking, it steers you away from anti-patterns and towards good patterns. Salesforce has created linting rules to minimize Lightning Web Components programming mistakes.

Restart the VS code

Update Salesforce CLI and its Plugins :-

Run the below command in your command window:-

  • sfdx update

It will update the CLI to latest version as well as the its plugin.

PowerPoint – Install Developer Tools for LWC

Together we can learn faster 

Join LWC study group on Telegram 

Subscribe to Youtube channel and blog to get latest updates

Reference

 

 

Did you enjoy this article?
Signup today and receive free updates straight in your inbox.
I agree to have my personal information transfered to MailChimp ( more information )
50% LikesVS
50% Dislikes