Building Your First Lightning Web Component for Salesforce Pluralsight Course is Live!!!

I am so excited to finally announce that my new Pluralsight course, “Building Your First Lightning Web Component for Salesforce” course is Live!

New Pluralisght course "Building Your First Lightning Web Component for Salesforce"

The development of this course was a labor of love for me and I have to admit something I worked so hard on. I would not compromise the quality for anything (including the three deadlines I missed). Luckily, I was working with some of the best editors in the world (huge shout out to Bentley Lignell, Stacy Sohn and Austin Allen).

As for the course, it covers the following:

  • LWC Benefits and what are Web Components
  • Setting up you development environment with Salesforce, Visual Studio Code and Salesforce DX
  • Component Design using Custom DOM events
  • Working with Salesforce Data using the Wire Adapter and Debugging with Chrome Developer Tools
  • Converting Aura components and lessons I learned
  • Testing your JavaScript with Jest

In the course, we will be building an application that will look like this:

Lead Locator LWC app

If you are looking for the final code created in this course, you can find it here.

For anyone that might not be a Pluralsight subscriber yet, here is a link to a free 10-day trial.

And finally, please feel free to send me your feedback on the course. Good or bad. I appreciate it all because it helps me to develop better content that meets your needs.

Modern JavaScript Development – What is it and why should I care?

Are you an experienced software developer? Well, unless you have been living under a rock, you have probably heard at least once that you should learn more about JavaScript to remain relevant as a developer. You may have even heard the phrase “Modern JavaScript Development” tossed about like knowing what that means is just common knowledge. But is it? I don’t think so.

JSI am very happy to announce that a new Trailhead module I have been working on called, Modern JavaScript Development was just released. It is part of a new trail called Learn to Work with JavaScript. This trail not only features my module, but one written by the fabulous developer Evangelist, Peter Chittum that was released in September called JavaScript Skills for Salesforce Developers.

My module was written specifically for Trailblazers that only have a basic understanding of the syntax and features of JavaScript ES5. And if you don’t know what I mean by ES5, then it is also for you. Basically, if you have ever copied some JavaScript and maybe not understood everything it does, then this module is for you. Along with the one that Peter wrote.

And here are just some of the things you will learn in this module:

  • Describe the current state of JavaScript development.
  • Describe the difference between function and block scoping.
  • Recognize shorthand ES6+ syntax used to initialize variables.
  • Identify the new destructuring syntax used to separate data.
  • Identify the backtick character used to create template literals.
  • Recognize the fat arrow syntax for functions.
  • Explain why defining optional parameters in ES6+ results in cleaner code.
  • Describe the different uses for the ‘…’ operator.
  • Explain what’s different about how you create and invoke classes in ES6+.
  • Recognize the basic syntax and different importing styles used to define modules.
  • Demonstrate how asynchronous calls can be chained together using promises.
  • Demonstrate how an async function can be used to call a promise.
  • Identify the different elements used in a Jasmine testing script.
  • Create a simple Jasmine test suite and run it stand-alone.

Sound exciting? I hope so. And I hope you find the module useful. There is an awful lot that can be said about Modern JavaScript Development and ES6 specifically, but I tried to boil it down to just the most important things I thought you should be aware of.

And finally, if you want to learn even more about JavaScript and Salesforce, you should also check out Dan Appleman’s FREE Pluralsight course called Getting Started with JavaScript in Salesforce.

Top 6 Tips for Working with Lightning Testing Service

Lightning Testing Service (LTS) is a set of tools designed to help you test the JavaScript in abtyour Lightning Components. Even though it is still in pilot, if you are developing Lightning Components, I highly suggest you take the time to check it out. Using this tool will be very important in ensuring that your components behave as expected.

As far as what LTS contains and how you use it, I suggest you refer to this Getting Started With Lightning Testing Service post by Christophe Coenraets from the Developer Relations Group. He does a great job of getting you started building your first test suite.

In this post, I will just highlight the super important things you need to know about working with LTS:

  1. You do not have to install SalesforceDX to work with LTS, but I really think you are missing the point if you try to. SalesforceDX not only makes it much easier for you to work with LTS, but the thinking behind using SalesforceDX is very similar to why you need JavaScript testing. Testing your Aura methods with unit tests and manually testing your components is not enough to ensure that your lightning components are behaving correctly. It also does nothing to ensure that they will continue to behave correctly as you introduce more code.
  2. Wrappers are ONLY provided for Jasmine and Mocha. If you want to use another testing framework, you will have to build your own wrapper, which will probably take you about a day to do. But, Jasmine is very easy to use and unless you are already using another JavaScript testing framework, I suggest you stick to Jasmine.
  3. You do not install or use LTS in production. Seriously! This is just for development environments and even better it is for scratch orgs that you create using SalesforceDX.
  4. LTS includes sample code to get you started. This includes not only the Jasmine and Mocha wrappers, but a Lightning App called JasmineTests.app that you can use to jump start your testing. Just follow the instructions in Christophe’s blog post and you should be up an running in no time.
  5. You do have to create and upload Static Resources that contain the JavaScript code for your Jasmine test suites. But, SalesforceDX provides commands for doing this easily so it is not quite such a cumbersome process to replace code as you are doing your development.
  6. This is the most important tip: Do not use LTS to test your server code. Keep your client and server-side testing separate. When calling Apex server methods that insert records with LTS, the data that is created is NOT rolled back. You have to be responsible for rolling back the data yourself. You can still mock the server call and an example of this is provided in Christophe’s blog post as Scenario #6. This is the recommended and best way for you to test the server code in your lightning Components. You can still create (and you actually still need to) regular unit tests to test that your Aura methods work as expected.

Ok, that’s it.

Hope it helps and good luck in your journey towards becoming an AWESOME Lightning Developer using Lightning Testing Service.