5

Is there any way we can edit the lwc source js code in browser like we can do it for aura ?

I just want to find out a way we can edit lwc js in browser level and see live changes instead of deploying it.

1 Answer 1

7

If it's a simple LWC setup, I suggest using the Playground on the main developer site.

You could also explore LWC local development which avoids having to deploy to server.

There's a way to connect your LWC local environment to real data as well according to this blog, although I'm not sure where the full details are on how to do this:

The final area we have enabled in Local Development is integration with real org data. Because most of your components involve using some form of Salesforce data it is important to be able to consume that data even when running locally. With Local Development, requests for data using Lightning Data Service or Apex will get proxied to your Salesforce Org and returned in your local components. You can do anything locally that you can do in your org such as create and update records, call apex controllers, and use decorators such as @wire.

In order to see the product card show real data, you can hard code the component’s recordId property to use a specific record. Then the component will render just as it would in the org. In coming releases, there will be tools in the Local Development Server to set component attributes so that it won’t be necessary to hard code development values when running and debugging locally.

6
  • Trouble facing with local development server is when I render things based on @api recordId and able to debug it as a whole :(
    – vkm
    Commented Jun 11, 2020 at 14:30
  • Sounds like you need real data to work with. There's a way to connect LWC local development to a sample data set from an org, I just can't find the resource right now. May have seen it in one of the LWC Local development videos Commented Jun 11, 2020 at 14:33
  • 1
    Awesome, I will search for same, in case you find out the resource please share here :)
    – vkm
    Commented Jun 11, 2020 at 14:35
  • See the update above, added more resources Commented Jun 11, 2020 at 14:39
  • 1
    I tend to create a wrapper LWC that passes in the hard coded recordId and then don't deploy it. Means I'm less likely to leave the hard coded Id in there by accident. Commented Jun 12, 2020 at 6:07

You must log in to answer this question.

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