layout |
---|
default |
#Lightning Component Basics#
Create a Developer Edition. Enable Lightning Components. Setup a Namespace. Locate the Docs.
Lightning Components have been available in Developer Edition orgs as a beta feature since the Winter 15 release. There is more than one way to work with them, but the easiest way to start is to create a new Developer Edition, launch the Developer Console, and use the File > New menu option. The relevant docs are actually in two places. You can use the Lightning Developer Guide to start and you can access the AuraDocs app as you're working. AuraDocs dynamically updates in your org as you build applications, components and events.
- Note that the Lightning Quick Start covers some of this material.
- The Spring '15 Release Notes also have a great section on Lightning Components.
###Step 1: Create a developer edition.###
Yes, you should signup for a new developer edition. You're learning something new, and this walk through won't result in anything particularly useful (other than knowledge), so I recommend not muddying the waters in an org you value.
###Step 2: Enable Lightning Components###
It's easy as pie. Navigate to Setup > Develop > Lightning Components (or just search for Lightning Components in setup), click on "Enable Lightning Components" and click on Save.
Once enabled, you'll also see a checkbox for enabling debug mode. I didn't use it while answering these questions, but you can read more about Lightning Component debug mode and decide for yourself.
###Step 3: Setup a namespace.###
What's a namespace? Well, if you've never created a managed package, you might not be familiar with this feature. However, if you've ever seen an object created by an AppExchange app, you might have seen a namespace but not known what you were looking at.
Namespaces are how Salesforce ensures globally unique names. Going back to the object example, the namespaced object's API name would be something like MyNamespace__ObjectName__c where MyNamespace is, as you might have already guessed, the namespace. Note that yes, that is a double underscore between the namespace and the object API name. In general, namespaces only matters when you package something up for other Salesforce users to use, which is why it's in the setup tree near packages.
Namespaces can only be created in a Developer Edition, and once you create a Namespace, you cannot change it. Stick with something that's easy to remember, and that is obvious enough to remind you why you created it in the first place when you read it. Also you'll be typing it from time to time, so shorter is better.
Note: When Spring 15 is released, this step will be optional but still recommended. Read more.
You can learn more about namespaces in several locations.
Start by navigating to Setup > Create > Packages (or by searching for "packages")
In the Developer Settings section, click "edit".
Read the details about packages and click "continue".
Enter the namespace prefix you would like to use and click "Check Availability". When the namespace you want shows as available, click on "Review My Selections."
If everything looks correct, click "Save".
That's it -- you now have a namespace.
###Step 4: Get to Know the Docs ###
There are two main sources of documentation: the Lightning Developer Guide and AuraDocs.
You can find the Lightning Developer Guide online here or download the PDF. I downloaded the PDF.
The AuraDocs are a little different than the Salesforce docs you might be used to. Instead of being available in the same way as your Apex and Visualforce docs, they're actually their own app inside your org.
This is incredibly cool because they aren't just hosted in your org, they're running in your org. That's right: they're an app and they'll update to include the components you build. See the "Reid002" namespace in the screenshot? Those are the apps, components and events I created while writing this article.
Access your live AuraDocs at https://{YourInstance}.lightning.force.com/auradocs.
##Next: Hello Salesforce1##