3

this is a bit of a newbie managed package question. We've built a custom LWC that is composed of a number of child components, and everything is going to be added into a managed package. What we would like is to have the parent component visible in Lightning App Builder and the children not visible because they are private internal components and not intended for general public use. I understand that setting isExposed=true is necessary for for the components to be useable within a managed package. However, this exposes everything in App Builder. If I set isExposed=false on the children, which has the effect of hiding the components in App Builder, I get the error "The Lightning Web Component Bundle 'component-name' in this managed package must be marked 'isExposed=true'." when trying to create the package.

Is there really no way to add private components to a managed package without them being visible in App Builder? This is completely confusing to me. I mean, I guess I do understand the point of isExposed, but we have children, such as an augmented combobox and the like, that are really meant to only be used within our component and not intended to be dropped standalone on a page. I don't like the idea of having to tell clients "just ignore those extra components, they're not important to you". Are we really expected to develop all publicly available components, whether we want people to use them or not? How have you all gotten around this, or have you?

I apologize if this has been answered somewhere else but I'm not able to find much of anything save for this post which was never resolved, Is there a way to use a private custom lwc Component (isExposed=false) in a flexipage that will be deployed in a managed package?.

Thanks!

2
  • 1
    This is really weird because for us only the root components have to be IsExposed=true. By root i mean those that you reference in the flexipage xml. Those you can't hide altogether, but you can constrain them to just one sObject (so e.g. if you're doing a custom one, then users can only add those to the flexipages for the custom component).
    – zaitsman
    May 13, 2021 at 4:42
  • Thanks, @zaitsman. I ended up figuring it out but your comment at the very least told me that it was somehow possible.. May 14, 2021 at 2:33

1 Answer 1

0

I believe I have this figured out, now. Both my parent and my children's components shared the same meta:

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>50.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordPage</target>
    </targets>
    <targetConfigs>
        <targetConfig targets="lightning__RecordPage">
            <supportedFormFactors>
                <supportedFormFactor type="Small" />
                <supportedFormFactor type="Large" />
            </supportedFormFactors>
        </targetConfig>
    </targetConfigs>
</LightningComponentBundle>

On a whim I removed the target and targetConfigs sections from the children so I had this:

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>50.0</apiVersion>
    <isExposed>false</isExposed>
</LightningComponentBundle>

After doing that I was able to set isExposed=false and package it up without issue. The client org now only shows the parent component and I can drop it on a page layout and all the functionality is there. I was under the assumption that target needed to be defined, but apparently not. Maybe I missed this in the docs somewhere.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .