73. Reusable Web Component | Matt Kaufman


Reusable Web Component

Matt Kaufman, who joins to talk about reusable web component, is 19x Certified, 3x Trailhead Ranger, Dreamforce Speaker, Book author, GDG Community Organizer, Chief Innovation Officer in MK Partners.


Sponsors

FormAssembly

This episode is sponsored by FormAssembly.

22 Ways to Use FormAssembly for Remote Work Success – Learn how to streamline remote work processes with FormAssembly’s all-in-one form builder and data collection platform


Main Points

  • Matt’s Salesforce journey
  • Why are reusability and extensibility important when working with front-end code?
  • Component-driven mindset
  • The inputs of custom web components – @api and targetConfig
  • Between component communication
  • The new lightning message service
  • Building our own reusable component repositories
  • Sell components in AppExchange
  • LWC, Aura, VisualForce components

Links


Video Teaser

The YouTube Video URL


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] I'd like to welcome our sponsor Form Assembly. You can find out how Form Assembly helps streamline remote work processes in the free ebook that we've linked in today's show notes. Formasimple's all-in-one web form platform lets you create forms for just about any use case, from contact forms to donation forms, all while take advantage of useful features such as notifications, e-signatures, and more. Not only that, but you can also connect data to systems you already use. Formasimple integrates with Salesforce, Podio, PayPal, and many other common solutions. Whatever your data collection needs are, you can be sure that Form Assembly keeps your data secure with encryption at rest and in transit on all plans, plus compliance with GDPR, CCPA, and more regulations. At the end of the day, Form Assembly helps you save time, money, and effort while getting the maximum benefit out of the data you collect. And I remind you, when you support our sponsors, you support the show. Hey

[01:27] everybody, this is Xi Xiao. This is yet a new episode of Salesforce Way podcast. Today I'm sitting with a wonderful guest. With me, his name's Matt Kaufman. Hello, Matt. Hi, Xi. How's it going? Pretty good. So, Matt, would you introduce yourself? Sure. My name is Matt Kaufman. I am the Chief Innovation Officer at MK Partners. We're a Salesforce partner in Southern California. I am a four-time Ranger. I've earned twenty-three certifications and seven super badges, and I've authored two books about Salesforce and three Plural Sight videos. Years ago, I was an authorized trainer of Salesforce's Dev Five Hundred One course. I've also helped create some of the exams and the programming assignments for Salesforce certifications. And more recently, I've I've helped make some of the super badges too. Yeah, you can probably tell from from that long list that that I'm a Salesforce old timer. I actually first learned about Salesforce back in two thousand one. I was working in IT at a software company, a small software company in the East Bay in the Bay Area, and I was tasked tasked with finding a new CRM tool to replace our homegrown one. And so I started started doing the research, and I stumbled upon Salesforce. I hadn't heard of it before, and I got a free demo org. And I logged in, and I was really amazed at how I was able to make changes to it and start setting it up and configure it without any coding or programming at all.

[02:57] It was very easy to use. So you know, at some point, I collected all my research and I made the recommendation to management. This is the tool we should use. We can be up and running quickly. It's not going to take outside consultants or anything like that. And that's what I wanted us to use. Management decided that I was wrong. Oh, really? Yeah, they decided to go another way. I went with a much more cloud. It was too new at the time. Yeah, cloud was new. I mean, it's 2001, so so cloud was new. They also were really concerned about CTI functionality, and at the time, CTI functionality was somewhat weak. You had to use like a third party product, and so they decided to go another way with something much more costly and would take a lot longer, and it ended up being a nightmare of a project. So, I decided it was probably time for me to look for you know a new employer who might listen to me more, and I I ended up getting a job at Salesforce. So that, yeah. So, I didn't really know you worked in Salesforce. I worked at Salesforce from two thousand two through two thousand five. Okay, so it was a long time ago. There were very few employees when I started. I think you know there were there were fewer than three hundred employees when I started. We were all based in San Francisco. No one outside of San Francisco. We were at the the landmark building, which is at the end of Market Street in San Francisco. And beautiful view of of the bay. It was a great culture. It still is, obviously.

[04:28] And I am still friends with a lot of people that we worked with back then. Okay. Wow, excellent experience. So it's been nineteen years for you on the journey. Yeah, yeah, it's been a very long journey. I've had a lot of different roles, you know, over over the years, and you know, I like to say I still work for Salesforce. I just have a different boss. That's that's a wonderful journey. Yeah, thanks for sharing us. So I hope I can have more years to come in the ecosystem. Yeah, well, after all this time, I still learn something new almost every day. Yeah, so so it's an exciting it's an exciting ecosystem to work in. Yeah, I even saw in Twitter you are still posting. You have done some new badges over there. Yeah, whenever like whenever I have spare time, whenever I have spare time, I get on Trailhead and I do some badges. And like I said, I still learn new things. You know, the the platform is so big at this point. I don't think any any one person can master all of it. So nowadays, I tend to focus more on like R and D, which means that I am playing a lot with Apex and integrations and Lightning Web Components. But that that means I don't get to spend as much time creating reports or playing with Process Builder. And so, you know, Trailhead is how I learn about some of those features that come out. Great. So today I wanted you to join me to share

[05:58] some Lightning Web Component related skills. So, because in the past we had one episode, it's a solid principle. That's more on the object-oriented backend code, Apex-related. But it seems for the front end, the Lightning Web Components, especially, that we also need to think to how to reusable, right, the code, how to make sure we have followed the the dry principle, this and that. So, what's your experience creating the web component and the reusable these things? Yeah, there definitely are differences between like backend logic and server side code and components. Although now that we're soon going to be able to to be able to to call cloud functions. I think that there might be some convergence there too, but yeah, specifically for for Lightning Web Components and web components that are focusing more on the UI experience, it's all about reusability and extensibility, you know. Typically, when I when I start working on something, I'm I'm doing a lot of figuring out, a lot of trial and error, and. Someone who is a planner and a preparer will try to reuse that. You don't want to start from scratch every time you have a new project. You really want to try to perfect something so that you can use it over and over again, like a util class. If we're trying to do it, like a

[07:28] server side analogy, and so that's what components is really about. You know, I I like refactoring code. It's it's fun to. Look at some messy code and say, "Okay, well, let me clean this up." You know, I'm gonna. Oh, I see. Your self code or somebody else code? Uh, both, both actually. So, so, um. It's it's a it's a fun challenge to try to make things more efficient and optimize things. You know, you know you can you can do it to the point where it's kind of silly, you know. But I really like seeing you know starting with a hundred lines of code, let's say, and being able to look at it and say, okay, well, what can I do to make this you know less code? What can I do to make it and you know efficient and less code aren't necessarily the same thing. But you know when I see oh well we're doing two for loops. And we don't really need to do two for loops. I can do both sets of logic in one for loop, and so I you know I condense the code and fewer script statements and you know things like that. So. It's it's nice to be able to say, oh, I started with one hundred lines and I got it down to seventy. You know, and and it's easier to read now. It's cleaner. You know, you can understand what's going on in the code. I like that experience of taking messy code and cleaning it. For sure, when it's somebody else's, sometimes I'd rather just start from scratch. Yes, but but when it when it's when it's decent code to begin with, it's nice to be able to improve upon it. And even upon my own code, I'll look at code that I wrote, you know, years ago or maybe even only a couple months ago. I say, oh, you know, since since then

[08:58] I've learned something, and so I'm going to improve it. And so I feel like that concept is what components are really all about. It's about taking something you built and improving it to the point that it's like a masterpiece. You're like, okay, this now can be reused over and over. I can inject some variables to make it behave slightly differently, so that I don't have to have almost the exact same code two places. It's like a boilerplate code that you can reuse by yourself, at least. Yeah, yeah, and it really makes starting a new project go a lot faster. Especially, especially since you know, right now the framework we're using is Lightning Web Components, and it's well documented. You know, that Salesforce is great at providing documentation, but there still are some things that you have to figure out. There might be an example, yeah. So, so they might give an example. For instance, there's an example when you talk about like the Lightning Data Table component. You know, they have an example. Here's how to create a table in LWC, and that's great. But often I say, well, you know, the first column of the table, we're doing, let's say, a table of users. So that first column, we want it to be a little avatar, little icon of the person. Well, there's another Lightning component that lets us do that. There's a Lightning component that lets us do an avatar, but there's

[10:28] no example of using the avatar in the table. And so, so you need to figure it out by yourself. Combine the two features into one. Yeah, and it's it's a lot harder than it should be to do. So you know, so it's one of those things where often what we'll do is like, ah, I don't have time to figure this out. I'll just do it the hard way. I'll use HTML and and the SLDs styling to just create my own table. And although that's an acceptable way of doing it, the problem is the next time that you go to do it a couple months later, some things may have changed. Now you know there may be new enhancements to the Lightning Data Table, and now you don't have those enhancements in your code. So now you have to basically start over, or you can you know try to augment your old code. But but either way, you start to have these like forks and branches in your code base, your personal code base, and that's a problem. It means you're you're doing a lot of extra work each time. And so, ideally, you you sit down, you spend the the amount of time needed to build out the component the right way, which is extending the LWC component. And then, as new requirements come and as new features come out, you can just keep adding to that one code base instead of having different branches all over the place. I understand what you said. Just sometimes I need to convince myself to spend extra time to dig into that. And there's no guarantee I will find the solution. Maybe I will come back and use the alternatives again.

[11:59] Yeah, I think that's a million dollar question to myself as well. Yeah, that's a good that's a good point. We I definitely so like I said I spend a lot of time in R and D now because I'm in a role where I don't have to work on on project work every day, and so a lot of the things I do is is trying to figure out is something possible. And then, once I solve the problem, hopefully, then I can share it with our team. You know, an analogy that that might work for for some listeners, especially now with the pandemic, is baking. You know, so we're all spending a lot of time in our kitchens now, and I like to bake bread. But I I don't necessarily have the the recipe memorized, so I always have to look for the recipe and figure out is this the recipe I used last time? And then in the recipe it says, you know, use four cups of flour. So we're you know and so four cups. So I have to scoop. I only have a one cup scoop though. So I have to scoop four cups each time, and then I have to do the sugar and I have to do the yeast and the salt and everything. So I don't bake bread every day, and I'm definitely not making multiple loaves of bread a day. But if I was baking bread every day, if this was really what I do, you know, and I want to optimize the baking, it would make sense for me to go and either buy or make a four cup scoop. And I would write on it flour, and I'd have another scoop for the exact right amount of sugar, and the exact right a scoop for the exact the right amount of salt and yeast, and so on and so forth. And I'd keep that all together in one little

[13:29] box, and this is my make bread box. And then I wouldn't ever have to look at the recipe. I would know. I you know I could even number the scoops so I know the order to use them. If if you have to do the ingredients in a certain order, you know, and I would be able to do that bread so much faster than right now where I'm basically starting from scratch each time. Oh, so you encapsulate all these logics inside that yes web component. In our case, it is so you yes exactly into it again. Okay, yeah. So that concept of of using the avatar in a table it's a it's a difficult thing to figure out. I every time I have to do it, I have to go and Google and look through the the developer boards and try to figure out how to do. And a lot of trial and error. But now that I have a single component that has it built in. And I know the name of that component. There's nothing else I have to do. I just use that component each time. I got it. Does it mean when we do the design of front end? Again, Lightning Web Component. Let's say we need to have a component-driven mindset all the time. Yeah, yeah, that's a great point. In the past, when we would scope out a screen for for a prospect or a client, we would start thinking about, okay, well, you have four buttons and you have ten input fields, and when you click something, there's a modal or a light box, and we would really be thinking about. Every possible interaction and and the permutation of the order you could do it in, you know, the the level of effort was a lot harder

[15:00] for let's say like creating a a big Visualforce page. Than it is with a component. With a component, I say, well, you have buttons. Check just the concept of buttons. We're good there. We already have buttons. You have you have the you have input fields. No problem. We we know how to do input fields. You have modals or light boxes. Fine. That's that's three things. Like, yes, obviously, if you have a lot of them, we're gonna you know increase the scope a little, but we're not gonna write three separate types of buttons. We're not gonna write three separate types of input fields and three separate types of modals. It's it's one type. We're just gonna be passing in the different variables. Hmm. So it's one level up, abstracted level. In your mind, you need to group them together. What are the similar component? What are similar functionalities? Maybe one component can serve all these similar functionalities. Right. So instead of scoping out, let's say the first screen has you know first name and last name, and the second screen has phone and email. In the past, we'd scope that as two screens. We'd say, "Oh, you got you have two screens. We have to you know write code and CSS and." Some type of logic to get those two screens to work. Although we still have to make them work. Now I see it's just a screen, and it's going to have a list of inputs. That's a variable. And so, it doesn't really matter how many of those you have. You know, it's kind of like data migration. When

[16:30] we migrate data, you know, most clients, I tell them, look, it doesn't really matter if you if you are asking us to load one hundred accounts or ten thousand accounts. It's it's one click of the button to do the load, you know, and so it's a similar concept. Now, if you if you say you have one hundred tables, that's different, but but you know, so each row, each record is essentially the same. Type of component. It doesn't really matter how many of them you have, so we don't we don't really worry about the the quantity of the components. It's just you you have one of those types of components. Yeah, the categories of types. Yeah. Okay. So if we need to create web component or reusable web component, I assume we need to think about the inputs. What kind of data this this reusable web component can accept? So, in Lightning Web Component, how do we do that? What are those inputs? So, the built-in ones will have some some properties that or attributes that we can set. So on data table, you can say, you know, hide the checkbox column all the way in the left. You know, don't show the little sort icon. You know, t here is some attributes that you can set these these little variables that adjust the look and feel, and sometimes the performance. And so we do the same thing on the components that we build. We we expose these little properties, and we usually use the @api annotation before the variable,

[18:00] which basically exposes it to the outside of that Lightning Web Component. And you know, you can use a Lightning Web Component within another Lightning Web Component. You can also, though, make a Lightning Web Component accessible to the Lightning Page Builder, which on the left hand side has a little dialog box, little chooser of components that are in in your org, and it'll list standard components as well as your custom components, including those that are installed from the App Exchange. And so, any of the the properties that we expose, you can then populate. You know, point and click. Just type in when you drag it to the page. You can say, you know, make the button blue, make the button red, and that way that way you can have some control over of the variables without having to write code. But often, often we'll also just wrap a Lightning Web Component in another Lightning Web Component. And so, if the if the color, if we're doing a simple example, we're talking about the color. If the color is going to depend on the user, so Matt, I'm Matt. I like orange. She, you like blue, and we we want to do a query and query your user to figure out what your favorite color is. That query would happen in the outer component. It would get the the the result we're looking for, and then pass it into the inner component using that at API property. And so that's that's another way that we can kind of extend functionality without having

[19:31] to have two separate versions of one component. We can say, okay, this component makes buttons perfectly. But it doesn't have any logic built in to figure out your favorite color. So we're going to create another component around it that figures out the favorite color and then uses the button component. You just mentioned if we have the parent component with the child component, maybe the child component is really tailored to do one simple thing really well, and then you just let it handle what it's supposed to do. Yeah. So, I mean, you you can easily get out of hand. And for instance, if we're talking about inputs, let's say, so you know, an in input can be text, it can be date, but it could also be something more unique like a radio button or checkboxes or you know, some type of slider. It's tempting to say, "Well, I just want a component that does all types of inputs, and I'll pass into it the type." That's very tempting, but what will probably happen if you did that is your your code inside that component will keep growing to support all these different types, and then the the result is it's kind of messy, and you have these like one off use cases that really aren't applicable. So what I would recommend instead is have a really good component for text, a really good component for date, and so on and so forth, slider, all the different you know

[21:01] different use cases. And then, if you want your universal component where you can just say input type equals slider, make another one that will invoke the other specific ones rather than overflowing that one with all these different possibilities. It reminded me this lightning input, the by default built-in ones. I think that has a type. It accepts almost all the types. Am I right? Yeah. So, so the ones that are available inside Salesforce, you can do. Yes. But like I said, sliders and and other types of interactions that occur outside of Salesforce, you may want to also be able to support. And so then you you would want to extend it. I see. Yeah. So you just mentioned that the at API is the one type of input we can pass into the, let's say, a child component, and another one is into this target config. When you create a Lightning Web Component, there this associated XML file, then you can add actual properties of this web component into this target config. Right. So the the target config on the XML is all about exposing it to the Salesforce UI for like a Salesforce admin. And so that's where when you're creating a Lightning page using the the UI, you'll be able to then drag that component

[22:32] onto your page and set the properties that you want to expose. They still have to exist in in your JavaScript, so they still are going to be a property that you know could have been set a different way. But this makes it so it's an admin friendly component. And I'm I'm a big fan of these types of properties because you know I tend to write a lot of code, but not everyone who's going to you know use a component is going to be you know. Comfortable writing code, and so this makes it an admin functionality that you don't even need to know what the code does. All you need to know is here is my input. It looks just like any other Salesforce input, and I can type in the color blue, or maybe there's a dropdown, you know, or checkbox that type of stuff. And so it makes it so easy to then go and use that component. You can have a little help bubble and a pretty label. It it looks like it's part of Salesforce. It actually, you know, you can't tell the difference between a custom component and a standard component. So it's it's the nice polish on the component that that makes it more of a product than some code that I was playing around with. I got it. I understand. We can also use the pop-up model, and even use the JavaScript, the default was it event listener, that kind of things to make the web components communicate one with another. Yeah, I think I think this is one of the hardest parts

[24:02] about components is okay is getting them to communicate with each other the right way. You know, the UI you you can you can perfect on your own. You know, it stands standalone, and even logic within a single component is pretty easy. But the communication is is definitely harder. And so, often when you are writing a component, and then you realize, oh, I need it to communicate with another one, you are going to have to refactor that so that it will pass an event and the right data in that event. But we do have a couple different mechanisms that are available to us. The simplest would be, like I mentioned earlier, we can use a component within another component. So if my outer component does the logic to figure out your favorite color, I'm going to pass in to the inner component that color. And that's the simplest way to do it, and we can interact back and forth if needed. But you can also use use pub sub, like you mentioned. And so this is a another component. It's pre built. It's available for free to all of us. It's on GitHub. And the idea here is it's a series of functions that basically registers a listener for a specific type of event. And then when that event is passed, it says, "Oh, I'm ready for this. I was waiting for it, and I know what to do with it." You know, so I'm looking for the the the text that you were passing me. And then at that point your logic takes over, you know. And so if we were to extend

[25:32] the color example, let's say I we don't we can't do a query for your favorite color because you haven't entered it already. We could have one component that has a dropdown with colors. And when you select your favorite color, then the other component is waiting for that event to be sent, saying she has selected his favorite color. It's blue, and now the button will render in blue.

[25:57] And they can talk, and they can talk both ways. And then when the button is clicked, we could send an event saying, you know, the button has been clicked, and this is the name of the button that was clicked. And then our logic on the other side is sitting there waiting for button click. And when the name is passed, oh well, if this is the name of the button, I'm going to do, you know, this this part of my code. Okay. So we use that a lot. What you what you what you don't want to do is. Use a component framework to build a huge page as if it was just normal non-component framework, and that that can be why not that can be tempting, but that that defeats the purpose. You're you're you're using a tool not at its best. So, for instance, I I work around the house a lot, and so I have different tools. I have a hammer, I have a wrench, I have you know pliers, and so on and so forth. Sometimes, when you know I I'm in a rush and I just don't feel like going to the garage, I might hit stuff with my wrench because it's heavy and it's made out of metal. Yeah, but that's not the right tool to use. I'm going to probably dent something. I'm not going to do a good job of hammering a nail with a wrench. But if that's the that tool I had on me, again, I might do it because I'm in a rush. It's not a good idea. You're not going to do a good job, and you'll probably run into some weird issues because you use the wrench. You may have well, you're probably not going to damage your Salesforce, but you know the result won't be the same

[27:27] as if you use an appropriate tool. So yeah, so so you really want to try to use components for for what they're for, which is these discrete units of code that are specific, and have some ability to be extended or customized slightly. I got it. In the past, I also had the chat with Chris Peterson about Apex. He said a lot of customers using Apex to parse, process CSV files. He said Apex is not tailored for that. You can do it, but it's a lot of slower and less performing. But that's only the chance you get, only the tool you have on the platform. But as the evergreen platform comes in, then maybe we can use your Ruby, you can use Java, off platform to do those things that are more suitable for for those languages. I listened to that that that podcast. I really, yeah, and and and specifically CSV parsing is something I'm very familiar with. We we we've been doing it for years, and and yes, on Apex it was very difficult. There was some functionality that was published a long time ago that was like a batch process to parse CSV. I believe it was actually a GitHub repo owned by Financial Force that let you parse CSVs, but it still was so difficult to do with Apex. But now we can actually do it, so so we can parse

[28:57] CSVs with with LWC and with Aura components. We we can parse it because there's JavaScript libraries that already do that, and so we're able to do that. But it because you know Aura and and LWC are client. Frameworks, it does require the user to be there and either you know click the button or at least have the screen up and open so that it can get parsed. But yes, with ever with Evergreen, we should be able to to have it run behind the scenes without the user necessarily having to invoke it, and so that's super exciting. Yeah, indeed, and I know Salesforce has this new beta feature called the new Lightning Message Service. Is it so? Yeah, do you know what that is about? Yeah, so that's exciting too. So I mentioned so Pub Sub is really it's a component. It's not it's not really in the platform. It's something that we're creating, and so every time you want to use Pub Sub, if you don't already have that Lightning component, you're going to have to go and create the component. And so, and there's limitations in terms of what components can speak to each other. So again, LWC is is is a client side framework. So that means that the the user has to be there, and they have to be on that screen, and everything that's interacting with each other has to be on that screen as well. So Salesforce recognized this area that they could you know improve on and how it would help a lot, and so that's what this new

[30:28] service is going to be. It's going to be baked into the platform and allow us to have communication even if the user isn't necessarily open on the component at that moment. So you mean it comes to replace the pop up, or is it just okay? I mean, I'm sure there will still be use cases for everything, but this is this is more like a event management functionality built into the platform. And so you'll be able to do some really neat things. You know what we do a lot now is we have utility trays in in the Lightning Experience. You can have that little utility tray at the bottom, and that allows us to kind of always have a component on. And so you know we we kind of cheat and do stuff like that where that component could be like a polar and you know do a do a query every minute to see if something has changed in the database. But the messaging service will allow us to to stop doing those inefficient things and start kind of stop doing those little workarounds and have something that that's built into the platform. So it's so it's exciting. That's cool, because what I understand is that you always need to create this new metadata in advance to make sure it conveys the message, right? It's not like a Lightning Web Component; you just write everything in the browser. You have to touch the setup to create that new metadata. Yeah, yeah. So, so you know, now that'll be part of the platform. That

[31:58] also means that there'll be a you know, and a declarative functionality around it too. So similar to I don't know if if you're familiar with the streaming API or the yeah so with the streaming API there is some declarative aspect to it you have to go into setup and you have to click a button and say okay well this this is what I you know my query is going to be and and things like that so there'll be a little little aspect to that too for this but but that's a good thing because that means that an admin can make a change without having to contact a developer okay you know and. From a deployment perspective, although we should still always follow our process, it's always nice when we can make changes to Salesforce without having to deploy, especially especially in an emergency. I'm not saying it's the right thing to do, but in an emergency, and there and you know there have been a lot of things that happen over the years where it's like oh you know this is public facing we got to fix this or. You know something has happened in the in the world. Yeah, you know it's nice to be able to make changes using declarative tools. Sometimes, I get it. So, I understand we do need to create these reusable web components. Does it mean we should start creating our own library of these components, or even as a company, we should start to build our own repos? Yeah. So. As a company, yes, I we do that. We have internally we have our our own private repo

[33:28] with the components that we use, and every time we reuse one of those components, we often will improve upon it. Like I mentioned, I like refactoring code, and so if a new requirement has come up since the last time we worked on this component. So, for instance, let's just use the button example again. You know, we we can change the color, but we have a client who really wants rounded buttons. They want it more of more of a fab than a button look. You know, we we could create a whole new component and have two separate concepts there, or we could add one additional property to our existing button component that allows for the edges to be rounded a little. And so, we'll some one of our developers will will you know do a pull request, will make a change to the code, do a pull request, and now our library has been updated so that everyone else can take advantage of it too. So I definitely recommend creating your own library. I don't know if I would say that every developer should have their own. You know, I think one of the advantages of you know sites like GitHub is that you know, and open source software in general is that it allows us to collaborate. Beyond our you know personal borders, whether that's an employer or country or whatever, but we're able to then collaborate you know with a larger group of people. And diversity in general leads to better results. You know you you don't want everyone to think the same way. You you won't see the possibilities.

[34:58] You won't see solutions that that you could have arrived at. So, it probably shouldn't be a personal repo. If you are going to create a personal one, because no one has built the component that you've ever you know needed, I would say try to publish it publicly and share it, and that way other people could benefit and contribute. But that's something that each person has to decide.

[35:23] Do you see in AppExchange there is a market for us to sell this kind of reusable web component? So components on the AppExchange have their own separate area. There's apps and there are components, and there's way more more apps than there are components. You know, because there's apps for for any kind of purpose you want. Plus, the concept of an app has been around a lot longer than components. However, if you built an amazing component, yes, I think it could be sold. You may want to list it as an app because people tend to go to the apps part of the App Exchange more often than the component. But going back to what we were discussing earlier about parsing spreadsheets, we we have a component that allows you to drag a spreadsheet onto the component, and it parses it and displays it in Salesforce. And then you can click a button to upload it or do an insert or upsert of the data. It's a component. I mean, there's code behind it, but it really is just a component. There's not too much else to it, and so that I think that is something that's that's complex enough that you could sell it as a component. So there there is an opportunity there, but conceptually, the idea of a component are usually these these small units, and so they're often not something that you would sell on its own. But if you created a library of

[36:54] components that look great, so for instance, Google has their Material Design look and feel, and we've created a lot of of components that look like Google's Material Design. So a Fab, a button, an input. You know, if you had a suite of components, you could sell that. I I don't think you'd make a whole business and live off of it.

[37:19] Because I was wondering if we create the component, because it's the front end, it's mostly JavaScript and CSS. Is the IP protected? You know, people download it, they get to see everything, right? Yeah, I actually had this conversation earlier this week with with one of our developers. Okay, we're working on a new component that we built that we're calling an app. Again, for that same reason, you know, people buy apps. People don't really buy components. You you use components, especially since you know developers. You know, if there's a free version, you'll you'll use the free version until you have to pay. And so, if there's a free component, they're going to use it. But so, so we have we have an app, and it's it's mainly JavaScript. You know, there's some Apex to to do some querying of settings and getting data out of the database. But it's mainly JavaScript. And so, yeah, we have a concern that that a well qualified developer could look at our JavaScript and say, "Well, I see what they did. I'm going to do it myself." You know, and I don't need to pay for your app. So that's one of the reasons why we're giving the app away for free. Okay. You know, because that that way it's not worth you know trying to reverse engineer our code. But but the other thing is, I mean, there's always going to be the type of people who will say, "Well, I can do that for myself, so I don't need to pay for it." And and the same is true for Salesforce as a whole. You

[38:49] know, I can build my own CRM tool to keep track of my customers and my sales, so I'm not going to pay Salesforce. But then I have to do all the work and the maintenance, and the server is not going to be the same quality, and I don't have any support team, and so on and so forth. So I think by virtue of marketing to Salesforce customers to begin with, you're marketing to people who see value in things that are pre-built, even if they could do it themselves. I I get it. One more thing before let you go is that we focused on the Lightning Web Component. How about the Aura and the the old Visual Force pages? Right, they also have kind of this component concept. Are they similar? So conceptually, yes, they are similar. So going back to that idea of creating a small unit of code that works really well and can you know have a couple of variables to adjust them, they are similar in that sense, and that's why the word component is is in them all. Visual Force components had some issues with the the way that the order of operations in which the page is executed or loaded that made it really difficult to work with. You know, so that so Visualforce components was not widely adopted for that reason. They worked they worked great if you just wanted to display some text or some color, but having interactive functionality and trying to use it that way often caused problems because

[40:19] they didn't behave exactly the way a Visualforce page would, and so then you you you couldn't always get it to do what you wanted. It was frustrating. So that those weren't widely adopted. Aura was was revolutionary when it came out. You know, we went from only server side rendering and code to client side, but it was very proprietary. It still is very proprietary, and so it was difficult for JavaScript developers who are familiar with components, but maybe not as familiar with the platform to adopt. Okay, but there are still some things that you can do in Aura that you can't do in LWC, and and sometimes you actually have to use all three. So if you want to use a Lightning Web Component inside a Visual Force page, you're going to wrap it inside an Aura component. Because that's that's how we have to do it currently. Hopefully, that'll be fixed. And so, it's important in general if you are a developer on on the Salesforce platform that you are familiar with all of the tools that are available, because there may be a day that comes where you have to use all of them to accomplish your goal. Thanks, Matt. That's all. So, before let you go, do you still have something you want to share with us? Yeah, I would. A shameless plug, if it's okay. No problem. Yeah. So I mentioned how we have a new app that we published to the AppExchange. It's called Mambo Merge, and

[41:49] it's a mail it's a mail merge tool that allows you to generate beautiful word documents from Salesforce. It's all native. Into in the platform using using LWC, super easy. It couldn't be any easier, faster, or more secure. So check it out. Yeah, I will put the link to our show notes. Let our listeners to check. Great. So, how people can find you? You have Twitter. You have LinkedIn. Yes. So I'm on Twitter. I'm on LinkedIn. My handle is pretty much always the one Matt Kaufman, and it's the number one, not the word one. And you know, I try to respond as quickly as possible. So, and I'm happy to help out. People ask questions all the time. You know, I'm passionate about the platform. So, if you want to talk, I'm always available. Excellent. Yeah, I will put that contact information in our channels as well. Thanks, Matt. It's really great chatting with you here. Thanks. It's great chatting with you too.

Leave a Reply