codeLive: How to Work with Dynamic Lightning Web Components

Поділитися
Вставка
  • Опубліковано 6 жов 2024
  • Dynamic Components introduced in the Winter ‘24 release let’s you create and instantiate components at runtime giving the ultimate flexibility to customize the user interface using LWC. In this live coding episode we will learn how to build LWC components using this feature.
    Connect with Salesforce Developers:
    Join the Community: salesforce.com...
    Website: developer.sale...
    LinkedIn: https:/linkedin.com/showcase/salesforcedevs/
    X: x.com/salesfor...
    Facebook: / salesforcedevs

КОМЕНТАРІ • 32

  • @rahulgawale
    @rahulgawale Рік тому +3

    I have used this in LWC OSS works great. Nice to have this on the Salesforce platform. Also its great that it supports non statically analysed imports

  • @RVAraghav
    @RVAraghav Рік тому +1

    Thanks for the walkthrough. I was looking for something like this, and the timing is great! By the way, great video and audio quality!

  • @DVNube
    @DVNube 8 місяців тому +1

    that's amazing , man.. and the documentation is awesome! anyway, tks for the video bro!!

  • @logesh_72
    @logesh_72 Рік тому +3

    Interesting !!!! Nice Demo👏

  • @SharikhRiyan
    @SharikhRiyan 9 місяців тому +1

    It was helpful thanks, It would be nice if you can share the code for all three LWC that has been used in this.

    • @msrivastav13
      @msrivastav13 8 місяців тому

      Please find all the code in this branch github.com/trailheadapps/dreamhouse-lwc/tree/mo/dynamiclwc for now.
      Note we plan to clean further and merge and make it part of the repo when unlocked packages are supported.

    • @msrivastav13
      @msrivastav13 8 місяців тому

      A simpler version is also cooking in lwc-recipes. Check here
      github.com/trailheadapps/lwc-recipes/pull/897/files

  • @pavantammali604
    @pavantammali604 Рік тому +2

    Bit curious to know how graphQl was used to build those reactive components along with filter criteria. Have you recorded those videos if yes, can you please provide the link for those videos. Would be helpful to get to better at Lwc 😇

    • @msrivastav13
      @msrivastav13 11 місяців тому

      Building it live. You can watch our first session here ua-cam.com/video/PTYEzizzyW0/v-deo.html

    • @msrivastav13
      @msrivastav13 11 місяців тому

      I have also scheduled part 2 here - ua-cam.com/video/ddoHXjVg0AU/v-deo.html

  • @SFHarvest
    @SFHarvest 10 місяців тому +1

    can we use this dynamic LWC in Model popups? and pass the model results to parent component.

    • @msrivastav13
      @msrivastav13 8 місяців тому

      In theory you should be able to do it. But please let us know if you face any more issues.

  • @sanjaymehta4510
    @sanjaymehta4510 5 місяців тому

    Hii there can u pls tell me how to pass parameter from parent to child in this approach 😊

  • @suritummalapalli
    @suritummalapalli 11 місяців тому

    Mohith, You mentioned a point in your presentation. Dynamic components work only in Managed packages. I didn’t get this point. You created and deployed to org (May be a sandbox) as a component in working session. Will this not work if we deploy into prod org as the same way as other LWC components? Should this component be packaged into different namespace and deploy into Prod? Please clarify. Thank you very much

    • @msrivastav13
      @msrivastav13 11 місяців тому

      You can deploy them via metadata api using tools like Code Builder or Salesforce extensions. When packaged they are supported in Managed package and do not yet support unlocked package. We are fixing unlocked package issue in upcoming release.

  • @cassioorsi
    @cassioorsi 7 місяців тому

    Does GraphQL obey sharing permissions?

  • @victorwolff6686
    @victorwolff6686 7 місяців тому

    Im having a problem with custom event, when I set a child - parent (using dynamic lwc) custom event I dont recieve the parameters that I set.

    • @msrivastav13
      @msrivastav13 7 місяців тому

      Can you share the code example that is not working via stackexchange or the trailblazer community? Feel free to tag me on x or LinkedIn.

  • @gurmandeep4417
    @gurmandeep4417 5 місяців тому

    also getting error :Invalid dynamic components usage, lwc:component and lwc:is can only be used when dynamic components have been enabled. could you please help me out with this

  • @gurmandeep4417
    @gurmandeep4417 5 місяців тому

    is there a way we can use multiple dynamic components in a single lwc when i have a array of lwc incoming from a apex class can we create dynamic constructors also?

  • @ramdev4537
    @ramdev4537 11 місяців тому

    I am using Developer Edition and I have enabled Lightning Web Security. In VS code when I deploy the component, I am getting this error 'LWC1503: Dynamic imports are not allowed. (15:9)'

    • @msrivastav13
      @msrivastav13 10 місяців тому

      Check your meta xml to make sure it does have the dynamic components enabled.

  • @Andrew-u5k3r
    @Andrew-u5k3r 8 місяців тому

    @msrivastav13 is there a way also dynamically positioning and rendering those dynamic components? let's say I want 10 instances of the dynamic component one time and 20 instances the other time rendered in a certain order, so I cannot explicitly add them through to the html... I want to be able to construct the grid with all my components dynamically in JS and pass it through. I tried to construct using document.createElement() and pass a dynamically imported component in but it does not construct it correctly... I can find it all added to the page markup with inspector but it looks like it does not compile... Thanks!

    • @msrivastav13
      @msrivastav13 7 місяців тому

      Note you cannot construct dynamically. Please share more code so I can assist here. Tag me on the Trailblazer community.

  • @palarunangshu
    @palarunangshu Рік тому

    Hi Mohith
    Can we dynamically retrieve Custom Label in LWC like Apex?

    • @msrivastav13
      @msrivastav13 8 місяців тому

      We did address via apex. You can use the below help.salesforce.com/s/articleView?id=release-notes.rn_apex_system_label_methods.htm&release=244&type=5

  • @avijitgorai
    @avijitgorai Рік тому

    With this is it possible render Custom Labels dynamically now?

    • @msrivastav13
      @msrivastav13 Рік тому +2

      We did address via apex.You can use the below help.salesforce.com/s/articleView?id=release-notes.rn_apex_system_label_methods.htm&release=244&type=5

  • @Niket93
    @Niket93 Рік тому

    Mohith sir can please share the code repository link for this demo

    • @msrivastav13
      @msrivastav13 11 місяців тому

      This is work in progress Niket. Most of our recipes use unlocked packages. We are adding support for unlocked packages in next release (Spring 24 #safeharbor) and then will push to the dreamhouse-lwc app.

  • @prasadarao272
    @prasadarao272 9 місяців тому

    is it possible to render multiple components?

    • @msrivastav13
      @msrivastav13 8 місяців тому

      In theory you should be able to have multiple of these. I have not tested it though. Please let us know if you face issues. Other issue I see making multiple of these is performance. Make sure to test for performance.