10. Salesforce Open Source | Ruslan Kurchenko


open source
Ruslan Kurchenko

Ruslan Kurchenko, Sfdc-Lax project author, joins us to talk about Salesforce open source and development environment setup.


Main Points

  1. Ruslan’s self-introduction
  2. The big picture of open source in the Salesforce community
  3. Popular Salesforce open source projects
  4. Lightning Component development
  5. Ruslan’s popular SFDC-Lax project
  6. Async and Await in JavaScript
  7. Using open-source code in Salesforce production orgs
  8. Several cool open source projects under our radar
  9. Difference development environment comparison

Links


Contact Me

If you enjoy this podcast, please reach me out to let me know your thoughts or simply say Hello. My (Xi’s) contact info:

Take care, until next time :)!

Transcript

AI-generated, unedited.

[00:00] Salesforce Way podcast episode ten, open source, ten already.

[00:13] In this episode, I had a great chat with Ruslan Kurchenko, a senior Salesforce developer from Kiev. We talk about what progress Salesforce community has made so far in the open source world and what open source projects that are currently under our radar. And specifically, we talk the SFDC LWC project that Ruslan authored, which had about what it is, what problem it attempts to solve. We also shared the experience on Salesforce development environment setup, such as about the editors and plugins. So, if you enjoyed this episode, don't forget to go and check the useful links that are discussed in this episode. You can easily get them from our website SalesforceWay dot com.

[01:17] All right. Hey everybody! Xi Xiao here from Salesforce Way podcast. Today we have our guest Ruslan Kurchenko. Ah, your your family name—it's—it's still very hard for me to pronounce. It's a Ruslan Kurchenko, right? Yeah, that's awesome. Yeah, yeah. So Ruslan is from Kiev, Ukraine, and I understand that you are a senior Salesforce developer, and you are also quite actively, um, like get involved in the open source world as well. Yeah, that's how how I understand you. Could you like from the the the mouth of the horse? Could you introduce yourself a bit? Yeah, hello everyone. Thank you for listening. I'm Ruslan Sx said, and yeah, I've been working in Salesforce for overall three years, three and half years, I think. I really love the to share my knowledge that I'm getting my daily job. And to get the knowledge from the community, so I think Salesforce community is awesome, and we should we should go forward in this way. Yeah, and I'm like doing I don't Apex and JavaScript stuff. So yeah, in general. Uh huh. And our topic today is like a big topic. It's about open source, right? Oh yeah.

[02:48] Yeah, so I think most of our audience are developers or or IT consultants in Salesforce. So we definitely know Salesforce technology, but many of us are still kind of slow into the open source world. So could you give us like a big picture how it is nowadays Salesforce towards the the open source area? Okay. Yeah, I'm not sure that I'm the person that can, you know. It's it's fine. We are just chatting here, right? Yeah, but yeah, but in general, I can I can you know speak from myself and just to share my my understanding what what's going on now in Salesforce community and open source in general. So I think that's open source in Salesforce. It's it's young, it's really young compared to some you know great stuff like Java community or C sharp community or JavaScript community in general. So, like, and yeah, I think it's really young, and you know, day by day, it's growing. For me personally, I think that more and more developers starting to to do their their job and to provide that by free to share their their knowledge, and it's really great for me. You know, I think that's that's the key. Uh, point

[04:18] when why you know uh Salesforce will be success in the future. Hmm. Yeah, like those big names, the gigantic companies like Facebook, Google, they all have their own famous open source repository in GitHub. Yeah, right. The React, the Salesforce. I think it's also following the same trend. So. The company, the Salesforce company, want the developers to, you know, to embrace open source, and they, I understand that Salesforce has also started to build like organization account and and already opened a lot of the projects and good repository inside. Yeah, you know, to open source the code there. Right. Yeah, the the one of the most famous one, or the most um kind of eye catching one, is this Visual Studio Code plugin, right? Salesforce tries to obsolete the old Force. com IDE and then start to embrace the Visual Studio Code. Yes, yes, yes. This is this is the big one. Yeah, and this is a big one and new one. I think with Salesforce, it's as not. It's also the early stage. I don't know, like plugging that as you said. It's

[05:49] great that Salesforce tries to, you know, to provide that and to get them, I don't know, thoughts and help from, you know, from outside to. Because in general, this basically this plugin, we'll use the people that basically develop for Salesforce. Yeah, so so I think it's it's really really nice. But it's not only the one project that I they moved to open source. I think that the most famous is is. Aura that the lightning stays on because, yeah, as I know, like I I I can mistake, but.

[06:38] In general, our it's from the starting point was the open source project that Salesforce started to use for their private development. So I don't know exactly, but I think that the people from open source also can contribute to Aura, and at some point that could be added to the main. Uh, Salesforce repository that they use to uh to Salesforce platform for Salesforce platform, you know, and yeah, and of course, Lightning Design System. It's it's fully open sourced, you know. Ah, okay. Yeah, it's it's also a super nice project, and I really like that. Yeah, because for me personally, I don't, I don't like to do, you know, some. Some styles related stuff, and

[07:37] so yeah, it's super awesome. I like that. How actually? How is the Lightning component? In general, moving forward, I heard that like each year there are new Lightning component, like a by default component available for us to to use, right? Yeah. But I at the beginning I studied the Lightning component, this event driven kind of framework Aura and the Lightning component as well. I wasn't so familiar with that kind of framework and. I didn't like go into details how exactly it works. I just followed those trailheads. Okay, I know there's like kind of event handlers. You you you do this, you do that. There's help files, this and that. But I don't know in general what what's your opinions for the Lightning component? Yeah. You know, when I started to work with Lightning components, I had some background using Angular JS, the first version, and okay, and also React JS. So I had. Some you know, different sides and different salts. And so when I started into with Lightning components, for me personally, that was like, come on, like what is it? Painful, right? Yeah, yeah. So and and you know what? I started to try, like,

[09:07] I started to try. You know, to apply my knowledge from Jet Angular, JS like and and React to use the approaches from these frameworks in Lightning components. You know, and in in some point it's nice, but and in other it's it's awful. You know, it's not not enough, but.

[09:35] You know, for me personally, you you know you you have to you have to in general decide the right way, and it's nice that Salesforce provide. The ability to decide in general and the ability to, you know, communicate with these with these events because it's also nice. It's also it's also powerful approach. You know, yeah. You just need to change your thoughts and your in your you know. Approach in general. Okay, like before, I know the Lightning debugging system is improving all the time. So I always want to, you know, wait until it gets really mature, and then start to learn. Then a time just passed by. I never started to really learn. Yeah, at the moment I'm more like into the Apex part, which is more mature, right? Yeah, yeah, and also in the backend, it's it's easier in in a sense. You just code the the business logic, understand like the governance limits, and there are good books of out there to to help us to to write the good Apex code. I think for me, just take some time to learn one at a time. In in general, I recommend I recommend first of all to learn JS. And when you learn JS,

[11:05] you you are easily you know understand Angular, React, or even Lightning Experience. It's all about JavaScript. So this the first thing that you have to learn. Because you know all all of all of these communications between components, these events, it's all based on the standard JS and HTML. That you know, not nothing more. All that. Since we are we are talking about the JavaScript and Lightning Component, I understand Ruslan, you have a very famous repository called Lax, right? Yeah. Sfdc Lax. So why why wouldn't you just talk about what the Lax is, what problem it solves? Yeah, I can maybe I can start from the history of that. Yeah, why not? Yeah. Um. Uh. So when I started to you know to be sliding and. So I found that there there is some problems with server calls. You know, you have to assign callback to server call, and in case there is some several server calls dependent, you know, one of the other, and so. You have the callback hell, something like that, and yeah, as I as I as I said, I had

[12:36] some Angular JS experience, so they they used promises. So I started to think, hey, can I just implement the approach with you know server side calls and promises? Because promises is basically now it is a standard way of doing async operations in JavaScript. So I like I thought, hey, yeah, that's nice idea, and started to work on that. But you know, from after some time, you know, I understood that I can code different kind of you know utility functions that help me, and there were some. Requirements from my friends, from the community, and yeah, it grewed in some something like we have now with a lot of yeah nice stuff that I think it's really powerful for a common development in Salesforce. So you you mean lacks the repositories to allow developers in Lightning component to use the promise instead of the the callback. Yes, yes. As you know, and the nice idea is that as you know, ex ex seven has a sync await operations. It's like. The replacement of promises

[14:06] to write more, you know, synchronous way code. So as slugs using, X slugs use promises. So you also can use async await and yeah. So you can you can call your server side Apex with async await in. In the browsers that allow you to do that, allow you to work with a sync way. So it's. I think that this is the future. This is the the way that we will work in the future. We will write the code in the future. As soon as all browsers will, you know, provide the functionality of async await operations. Yeah, just for the listeners who are not so familiar with the async await, it's like the new functionality in the JavaScript that. Uh, somehow wrap beautifully the asynchronous code into traditional synchronized way. Under the hood, is still asynchronous. That's how the web works. But from the code point of view, it looks exactly the same as the synchronous code, right? Yeah, that's how I understand it. Yeah, exactly, exactly. But how does it magically? Just switch. You mentioned from the promise to the async await. So, lax. When we use the lax framework or lax repository, we can already use the async await

[15:36] in our Lightning components code. Yeah, is that what you mean? Yeah, you're. Oh, really? Oh, yeah. I I shared that in my Twitter and. The community was like, come on, yeah, I was serious. That's good. Yeah, as well. I was. How did you do that? Um, as I said, promises like Promise object in JavaScript is the standard one. So as I know, Promise is first was added by. JQuery library, so jQuery first library that is I've implemented Promise. I may mistake. I'm sorry, guys, but I think so. And then you know when the community started to work a lot jQuery, you know. So the they add like. So it was integrated in the core JavaScript language. So nowadays, async await are based on a Promise object. So in case you use Promise, you can, you know, switch that to async await. That's why we can use that with the blocks. Okay, so so I'm a like a beginning level of JavaScript developer. I I know how to use callback, how to use promise, or even async await. But how do you allow promise to to be enabled in the codes with the help of lacks?

[17:07] Do you somehow wrap the callback nicely to the promise? Yeah. Yes. in In general, in general, yes. Lux. It's all about just standard Lightning components and Lightning component calls to the Apex side. And it wraps the standard one actions that you create and assign callback, and then handle your error or success. Result or even incomplete result in case of offline. So and yeah, just Lux just provide a nice, nice proper around that, that you can chain your. Your actions, or call bulk actions, and handle all of that with just a nicely written JavaScript using promises. Okay, and you mentioned that you have written an article about this, right? Yeah, yes, I have. In your blog, right? Okay, okay, okay. We will put the links to those articles that you just mentioned, just for people to understand it, how to use Slack's. Yeah, nice. Have you had such a experience to create such a library before, before Akes? No, that was okay. So this is like the first. Oh yeah, popular project. Yeah,

[18:37] I had, I had some. Like, I have also some open source. Uh, I don't know things in my GitHub account that I've created before for a Webpack. Maybe you know what is Webpack? It's it's like a JavaScript bundler for a. For big projects, like it's mostly used by web developers in JavaScript to build their modules to one big JS bundle. So I I used to work with that, and so I created one plugin for that, and also I have some different you know things related to my. Job that I've created before, but this is the one I've maybe not proud of, but I really like that because it's used by a lot of people and. I'm getting a lot of feedback about that. That it's nice, so I love the idea about this. If I want to, you know, just go to GitHub to study your repository, how much time do you think I need to really grab the essence? Okay. Yeah, I think you you can use it instantly. Just about ten minutes, and you can start it. Just click one button to deploy to your org. Okay. And then copy past the examples code from my readme file to your component,

[20:08] and just start use that. So in general, also my my. This basically repository has the API description side, so you can go there and to go through the all abilities that plugs provide. Because promises, it's not the it's just the one piece about plugs. Like it's also provide different interesting things related to. Firing events like application events or component events, yeah, and just go there and and see. Okay, I hope you like that.

[20:54] I I had this question for a long time already. So, like you are working Salesforce, you you are like developing solutions for customers. Is it typical for customer to install open source project repository? Or even some other famous one, like I understand from finance, was it FinanceForce dot com? They have very famous one, right? So even to to request the customer to install those libraries, it'll you know sometimes there are difficulties. So what's your kind of experience on these? You know what? One interesting, really interesting thing is about Lux that I have not used that on my projects. Okay. All right. Yeah, it's because I have not chance. Because you know what? All my projects had different. Different, you know, wrappers, old old one wrappers around the server side calls. So every time that I like, you know, I wanted to start to use it, like it's it was redundant in general. So, but from feedback about that, from you know my friends and the community. So I think it's easy, easy to start to use it because you know what it's it's not a big one.

[22:24] You can go through and to read all the code that written there. I hope it's clear, and I think it's clear. You know, you can understand that it's safe to use that. So the developers that want to work on. On that component, can even change, even change that in case it's not fit here, here his requirements. You know. Yeah, and I don't think that it's it's a problem to request a client to use some some component because it's free and it's free to you know to even distribute distribute in page. Applications like when you develop managed package, you can include that component to your package, and to sell on AppExchange without any any problems. You know, and you don't even you know send me any any request about that. Just grab that and use. Yeah, that's the convenience of using open source project. Yeah,

[23:36] and how long you have been working on this LEX project? Hmm. I don't know. Like, uh, you know, some different requirements. Uh, uh, you know, rising from time to time, and I'm adding them to Lux. But the main core that I've done around the server side calls. It was just maybe one week, you know. I I I think a lot about all of that. How to do that? What approach to use? How people we use that? What the API will be? You know. Maybe two months, but then I sat down and just one week, and it's ready, you know. So I totally understand. Thinking takes much more time than just writing the code. That's true. That's true. Yeah. Yeah, yeah, it's it's definitely a great experience to create the library. I always admire people who have done that, and I I wanted to do that, but never either had the courage or had the time to really to do this. But yeah, really good good one. Yeah, so so what open source project that you are currently looking at, or you think it's a good ones for for people to to take a look? Do you have any recommendations? Yes, nice question. Yeah, and recently

[25:06] I found really excited project for me personally. I don't know it calls React Lightning. So yes, it's by Shinichi Tomita. I hope that I, I hope that person. Yes, I hope that I call him right. Excuse me if I'm wrong. But yeah. So what it is? It's basically the renderer. This is like a proxy between React JS and Lightning. You know, it's basically it provides the ability to render Lightning components using React JS. Okay, just to just to be more clear, so you basically write React as you know these definitions of lighting components like lighting input, lighting date, lighting map. Maybe you know you can use all the all the components that Salesforce standard library have, and React will render that in using some you know. Things that's basically implemented in this renderer, and then you basically bundle that together, all of your applications or components that you built using React, and you load that using LTNG require in Lightning components on your page.

[26:37] And it's just in just this place. Yeah, it's for me personally. It's super super nice. I don't know. It's it's on development stage. I'm trying to you know. To go through the code and to add some, you know, little things to that. I've already added some features, not not features, just examples. But yeah, it's really nice to see on that. Okay, we we can also have that link in our show notes just for people to to check this project as well. Cool. Um, I understand there are also Angular Lightning related to the pastory, right? It has been a while already. Somehow you use the the Angular, uh, those NG stuff. Somehow also trans transpile, or I don't know how it magically happens. Then you use the NG code, and then it maps to the Lightning components. So. Oh, I I have to I have to see. I have to watch. Okay, you didn't know that. Okay, yeah, I know it. But maybe I will add the link to our show notes as well if I can really find it. Okay, that sounds also nice. Oh my gosh, yeah, that's nice. And any other projects? Yeah, you know what?

[28:07] Like I also super is interesting with Apex bugs that Financial Force have as you know. You know, I I super like I fan of unit testing with mocking approach that Java Mockito use for example. Yeah, it's it's super super nice also library. So I'll I'll recommend for you guys to to watch on that and to try to use that. Yeah, it's really nice. I understand that that's like a big repository, not only the the mocking part, right? There or something. I think that it's divided by the modules, so you can use upper mocks. For your unit tests and without the main core library, okay. Okay, because at the moment I'm really reading that book. Oh yeah, that's that's super book. Yes. Okay, you recommend that as well. Of course, I read that. Yes, awesome book. Agree. Yeah, the the thing is that those are really my pain points when I'm doing Apex coding. Like there were a lot of what was it called the blu bluile plate coat. So those like map, you always need to create the map, create the list to maintain the relationship and go through them in the for

[29:37] loop. So those are the noise of the the business logic, right? I really want to isolate those out so that the the main code just displays the business logic. If you really want to go into the details, then you go to those functionalities to check how the maps and the and the lists. Yeah, I think that's like it's called the unit of work or something. The concept is like that's that's right. That's right. We we yes we use we use these these similar approach in our projects. So we also define like. A service layer for our applications, a selector layers or DAO. It's it depends on the project, you know. And yes, we use this approach to divide layers, and then we can easily mock the implementation, for example, of the selector or or the service. Business service, you know, and to easily test your actual unit in the code, so it's really nice. I I know like this kind of separations of concerns and then put everything into different files and it's then easier for us to later to check. But that I'm more also more interested to see how it has been achieved. How do guys you know wrap them into those beautiful files

[31:07] or those APIs? Then we just call them to to just to use it. So I want to take a little bit deep look into those code and see how it was used because, for example, Apex doesn't support the generics. Oh yeah, because I'm a believer of the clean code concept. I try to always refactor my code to make it cleaner. But sometimes I really hit the hard wall. I don't know how to do that without the generics, and how to even abstract things out. So I think I need more experience and time to really also look into those those framework to see how how smart guys have done those job before. Yeah, I'm. I agree with you about the Apex uh thing in in in uh. About the generics in Apex, excuse me. So yeah, that's that's true. And I just I just remembered one of some library that I wanted to share with you guys. It's Force Force Di. Force Di.

[32:18] Yes, this is the library.

[32:23] I think it's from Andy Fawlded, and this is for dependency injection in Apex, and not only on Apex in Lightning components in flows. So just check out that guys, it's super awesome, and yeah, hopefully I will use that on my next project. It's really. Great thing, I'll I'll get the link from you and I'll post in our show notes. Okay, a lot of stuff to learn. Oh yeah, with with limited time.

[33:00] Um, I did a little bit study in GitHub to see what kind of Salesforce repositories are popular. There's some. One is called Awesome Salesforce, which is not one repo per se. It's like a list of study resources. So it tells you if you are learning Lightning component, what resources you should check. If you're learning Apex, if you're learning this and that, then so those are like a like a content table for for you to to check. I'll also put that link in in our share notes as well. I think it's it's a cool thing. Yeah, I agree. I agree. And how about the development environment? So, what IDE or tools do you use for for coding? Oh, that's a nice question. You know what? Ah, I think I'm one of the guy that tried everything. Oh, right. To work with, so ah, I started from Sublime and Moment's Made plugin. Okay. Ah, then I moved to Atom and Moment's Made. Alright. Then ah, there were that like. So I started to use Idea with Eliminated Cloud. So it was really early stage of this plugin, but I started to to work with that. But I think that

[34:30] one year ago.

[34:34] Xi Xiao SalesforceWay Salesforce Apex Agentforce Lightning

[34:41] Web Components SOQL Trailhead Dreamforce AppExchange Ruslan

[34:49] Kurchenko.

[35:02] Okay. So now I work with with that plugin. So you can check out. It also have as the.

[35:14] Website that you can look on and to go through the abilities of this plugin. It's really nice for me. It's super. It's super nice. It's what I need. All right, I'll get the that plugin link from you since you recommended that you are using. Yeah, maybe our our listeners can check it out if they are interested. So you haven't used the Visual Studio Code for Salesforce development. Uh, not exactly. Oh, really? Oh, yeah. I thought you're JavaScript developer. You must use the Visual Studio Code. Okay. You know what? Yeah, I just, I just that's because my, I don't know, historical things. Because I, I moved from Java, so I used Idea. Now I using WebStorm from JetBrains, and that's why, like, that's it. Like, but I've tried. I try it. VS Code. VS Code basically it's super, super awesome too. And I'm using. I'm used that for. I use it for some Node.js development in past. But in general, I use Webstone. Okay, I mean Webstone. I know is lightweighted, but this IntelliJ, this idea you mentioned, I heard the people are using it with the Illumina Cloud, but they say it's kind of running slow comparing to Visual Studio Code. Sometimes, of course, hanging. Of

[36:44] course, yeah. Okay, yeah. I agree with them. I agree with them because, yeah. First of all, sometimes people. Like don't switch off some Java things related in Idea, so it runs a lot of plugins and things you know under the hood. So you have to switch off all of that, you know, and it will be much faster. And yeah, that's why basically that's why I moved to WebStorm because it's basically fits my needs. You know, it's provide me all of that I want. You know, just to highlight JavaScript, CSS, HTML. And to provide code analysis, you know. So and it's lightweight. Yes. Okay. I think that Illumina Cloud also work with Web Store. Yeah, definitely. Yeah, I think so. I think so. But the the plugin you mentioned it's a paid service, right? Yes, I think. Yeah, you know what? Like they also have the free trial for thirty days. I think. Okay. And yeah, then you can you can buy. For this this plugin, what the coolest thing is about that, that from time to

[38:14] time I meet with the development team from this plugin and and we discuss the features that. They would provide in the future, so yeah. For me personally, it's nice because I know what I what I need, you know, and I can ask them, hey, please just can implement something like that. Okay, cool. Yeah, maybe I can also use this time to complain about the Visual Studio Code plugins and the official plugins, and then do a little bit comparison with with your plugin in WebStorm. Okay. Yeah, of course. Yeah, so the Visual Studio Code plugin at the moment, um, it just started like a couple days ago to support the regular work development. So it started from the DX support. So it supported DX better than the regular, uh, like the Maven's mate way, and now it supports the Maven's way way, but it doesn't still not allow to auto compile. When we hit save, so it doesn't send the file to the cloud and to get the compiling errors back. So that was like a big no-no for me at the moment. Yeah, I'm still using Visual Studio Code that's called the Force Code. It's a really simple plugin. It supports the auto compiler. That's

[39:44] the the thing I wanted. Yeah, and another disappointing point is it doesn't even support the order formatting. When we hit save, it does not format your your file, which I found quite inconvenient, especially when I collaborate with people. Uh, using Git, so the format always tells me, okay, there's a difference. And but when you really compare, it's just one blank code or one blank line. So it always draws your attention without any, you know, really need. So these like a two big points. How is it in in the packing you just mentioned? Yeah. So, first of all, about the analysis. So code analysis. So the plugin provides static code analysis on your local machine. So while while you are typing any any things, it's real time. You know, analyze your code and highlight the issues that you have. So even if you pass some wrong type to the methods, or I don't know, like to call the functions that are not exists, or to you know, to try to get the field that are not exist on a subject or I don't know object. Apex

[41:14] object, so it's really nice. It's also provide some great stuff related to refactoring your Apex code. So, for example, to extract the function from the Apex. Method so to you know to rename the function to rename the the property of object so basically if you want to rename one property on the class. You just call the rename, you know, action, and it renames all the occurrences of these property in your project, and the same with methods, class names, and whatever you know. So it's really nice for me. For example, if I want to extract some code snippet into a another private method, I can easily highlight them and then right click and say extract to a new method. Can I do that? Yes. Yes. Really? That's something I'm missing. Yeah, it's really hard in Visual Studio Code. I'm at moment to to refactor the Apex code. It just doesn't understand anything at all. You just kind of like use a notepad to to write your code. It does a little bit of highlighting, but pretty much that's all. Yeah, it's not a big difference from the point when we work with Sublime Text. Okay, for now it's same. But

[42:45] I know that Salesforce team work on the static analysis. Uh huh. But for now, yeah, this is the situation that. Yeah, well, let's hope they get things down faster. Yeah, to help the people, individuals study code. That's like the official support, right, from Salesforce.

[43:08] All right. I think we had a long discussion about open source, about the development. Do you have still some other things to to say to the listeners?

[43:21] Uh, I don't know. Like, just just want to thank you guys that you you're listening us, and thank you that you invited me. This is this is great. This was great discussion, and really excited to to be here on your podcast. Yeah, yeah. No problem, Ruslan. It's really great to have you here, and also to all the listeners. Don't forget to go to the website and then check those links that Ruslan shared in in this session. I think a lot of open source project deserves our time. And attention to to study them, and then to play around. If you do want to be a good Salesforce developer. Yeah, agree. Excellent. So, thank you, Ruslan. I think that's all for our session. So, have a good night. Thank you too. Yeah.

Leave a Reply