5 #Lightning tips for Visualforce devs

Alba Rivas
Feb 12, 2017 · 3 min read

Are you a Visualforce developer? Do you want to transition to #Lightning? Don’t be scared about it! Lightning Components is a new technology that can seem very different to Visualforce, as the way of programming is pretty different. Despite the learning curve is a bit sharped, once you have acquired skills on Lightning Components development, you will develop components at the speed of light, in comparison with Visualforce development! So, don’t miss the next 5 tips:

1.Understand the basics of Lightning Components: while in Visualforce we had a page centric model, in which we had to communicate with the server each time that we wanted to change the content or the appearance of the page, with Lightning Components we have an app centric model, in which we only request to the server a minimal quantity of information, which gives us much less latency and in consequence a much better user experience. Bear in mind everything in Lightning is asynchronous!

Image for post
Image for post
Image for post
Image for post

2.Learn in how many places we can use Lightning Components: the good thing of Lightning Components is that we can use them almost anywhere! We can provide some components to our admins, or even publish them on the AppExchange for components, and they will be able to use them in a wide variety of places.

They will be able of building home, record or standalone Lightning Pages with drag & drop in App builder. Also they will be able of creating Lightning Apps, Lightning Component Tabs or use the components in Communities. You, as a developer, will be able of using your components in Visualforce pages, the Utility Bar, Lightning actions or anywhere with Lightning Out.

3.Learn Javascript in depth: In contrast with Visualforce development, with Lightning Components you will need to write a lot of Javascript. Normally programmers start writing Javascript as if it was any other object oriented programming language, however we usually don’t go in depth in some concepts that are really important to know, as prototypes, variable scopes, or closures. Be sure of investing some time learning all of this to be a super powerful Lightning Component developer!

4. Learn where to code and debug your components: Salesforce has provided to us several nice tools for creating and debugging components. You can develop Components in the developer console or using the Force.com IDE for eclipse. You can nicely debug components using the Salesforce Lightning Inspector plugin for Chrome developer tools, which has an infinity of options for debugging client Javascript code, visualising the component tree and profiling.

5. Learn about Lightning Locker Service: when you are building components you have to bear in mind your component will not be alone on the page. For that, Salesforce has released a security system called Locker Service that will prevent your component from accessing other components data. Also Locker Service make us enforce some security rules, in order we code in a safe way. In my case, I started writing some components, and when Locker Service was rolled out, I had to fix them, because they were not working anymore! So, remember, you will have to comply with Locker Service when you develop components, as for Salesforce trust is #1.

Now that you have read this post and you are willing to learn Lightning Components, you can do this great Trailhead module that will help you to start!

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store