Salesforce recently Introduced lightning components for multi screen tech world. It is a client-server framework that accelerates development, as well as app performance, and is ideal for use with the Salesforce1 mobile app for now (spring 15).
I have been playing around it for last one month . I am writing my custom components in developer console directly because there is no plugin available for eclipse which is my primary Force.com IDE . Writing code directly in developer console makes some process very tedious like pushing the code to version control system , to take backup in my local drive.
So I searched for a solution, occasionally I have used mavensmate as Force.com IDE in sublime text editor which is my favorite text editor and there is plugin available for lightning components. In this post I will walk you through how to install mavensmate , lightning plugin in sublime in windows.
- Installing sublime text editor 3
- Installing package control
- Installing mavensmate and lightning plugin
- Placing Force.com CLI
Installing sublime text editor
Installing sublime text editor is as usual as installing a program in windows.
- Go to http://www.sublimetext.com/3 .
- Download the setup file for windows .
- Open the setup file and follow the instructions.
You are good to go for the sublime text editor.
Installing package control
Package control is the package manager for sublime text editor. It makes exceedingly simple to find, install and keep packages up-to-date.
- Got to this link https://packagecontrol.io/installation
- Copy the code for sublime text 3 as shown in the screens shot.
- Open the console using clt + ‘ or View > Show Console.
- Paste the above code and press enter. Package control should be installed in your sublime editor.
- Restart you sublime (just close and reopen).
Installing mavensmate and lightning plugin
Mavensmate is an open source Force.com IDE. Which can be integrates to various text editors like sublime and Atom .
For installing mavensmate follow these instructions
- Open package control using clt + shift + P and type install
- Select the Package Control : Install Package
- Now type mavesnmate and press enter
Mavensmate should be installed in your sublime .
Set workspace for the user in mavensmate
Click on Mavensmate -> Settings -> User Settings a file will open.
Set the path where you want to the mavensmate workspace as shown in the screenshot below.
For installing lightning plugin follow these instructions
- Open package control using clt + shift + P and type install .
- Select the Package Control : Install Package .
- Now type lightning and press enter.
Lightning plugin should be installed in your sublime.
Referece : http://mavensmate.com/Getting_Started/Users
Placing Force.com CLI
Now download the Force CLI from this link https://force-cli.heroku.com/
Place the executable file in sublime directory. Mine is C:\Program Files\Sublime Text 3
Restart the Sublime .
Now everything is set all you need is to
- Create a new project for your salesforce org
- Enable the lightning in your org and play with it
Inorder to fetch lightning components you can do it via two ways
- Change the package.xml
- Add the following code in package.xml
<types> <members>*</members> <name>AuraDefinitionBundle</name> </types>
- Right click on the project name Lightning -> Fetch -> Lightning as shown in the below screen shot