- marked as minor
LWC Tooling API Support
Hi,
after the last Major IDEA Update i “finally” upgraded to IC2. I was then working on a LWC and were wondering about the long save time just to notice to my surprise that they are saved via Metadata API.
I only found your Note on the initial LWC Support Release Notes that it seems to be case that no Tooling API Equivalents existed. Could that potentially have changed? For the same Reason i had written a custom plugin for VS Code which were using LightningComponentBundle / LightningComponentResource and it seemed to work fine to me.
Is there something I may miss? Otherwise i would love to see Tooling API support for LWC inside of IC2 as i sometimes are sitting like 5 minutes for a change in front of the screen (and also in general much longer than i am used to from vs)
Official response
Comments (14)
-
reporter -
reporter - edited description
-
repo owner Hi, Daniel. I'll have to take a look. LWC bundles still aren't supported as Tooling API metadata container contents, but it does look like they could be managed now in the same manner as Aura bundle files. That would dramatically speed things up when working with the individual files. I'll put this on my near-term list.
-
repo owner This has been implemented for the next build.
-
repo owner - changed status to resolved
Delivered in 2.1.2.1.
-
repo owner An issue has been found with Tooling REST API-based deployment of LWC bundle files. It's the same issue reported here:
https://github.com/msrivastav13/DX-Code-Companion/issues/15
I have spoken with Salesforce and they are aware of the issue and tracking it internally, but there's currently no ETA for a fix. As a result, tomorrow morning's build--2.1.2.2--will add an explicit configuration option for Tooling API-based deployment of LWC bundle files, distinct from the same option for Aura. The LWC option will be disabled by default due to these issues, though if you're not affected by these issues in some/many components, you can enable Tooling API-based deployment for LWC.
I'm going to research other LWC deployment optimizations over the next few weeks. Hopefully I'll find and implement one that's free of these types of issues shortly.
-
repo owner 2.1.2.2 has been posted with the aforementioned change.
-
Any clues why aura/lwc deployements don’t work on my setup? Seems to be going thru sfdx.
-
repo owner Jurgis, when you say "don't work", what's happening? Are you getting an error? Is it silently not doing anything?
I'd likely need to see a debug log to know for sure. Can you please enable debug logging for metadata deployment, reproduce the behavior, and then email the resulting
idea.log
file to support@illuminatedcloud.com for review? -
@Scott Wells No error, but deploy seems to be happening via sfdx. Perhaps I misunderstand the feature?
Does this works with sfdx based repos? I wanna use tooling API because how fast it used to save in dev console. But perhaps I’m missing something (hence screenshot)?I’ve tried to gather debug logs but nothing seems to get collected - idea.log file didn’t get created.
-
repo owner Jurgis, there must be an
idea.log
. That's generated all the time when the IDE is running. Did you try using Help>Show Log in Explorer/Finder/Files to locate the log file(s)? -
repo owner Issue
#1993was marked as a duplicate of this issue. -
repo owner I've just committed a change that determines whether an LWC JavaScript file is requested for deployment and, if so, whether it contains the type of import that yields a
FIELD_INTEGRITY_EXCEPTION
, specifically an import of a custom field or any field fromUser
. In that situation, deployment occurs via the Metadata API. This should result in faster LWC dev time more often.I've also changed the default for LWC Tooling API deployment back to enabled, and I've removed the warning that was displayed when enabling that option.
It's possible that there are other types of fields that fail in this manner. If so, what I plan to do is add them to the patterns used to recognize these imports with the goal of having this be a 100% reliable mechanism for determining the most efficient deployment path for individual LWC bundle files.
This change will be included in the next official build.
-
repo owner The change described above has been released as of 2.1.9.3. More details are available in the release notes.
- Log in to comment
An issue has been found with Tooling REST API-based deployment of LWC bundle files. It's the same issue reported here:
https://github.com/msrivastav13/DX-Code-Companion/issues/15
I have spoken with Salesforce and they are aware of the issue and tracking it internally, but there's currently no ETA for a fix. As a result, tomorrow morning's build--2.1.2.2--will add an explicit configuration option for Tooling API-based deployment of LWC bundle files, distinct from the same option for Aura. The LWC option will be disabled by default due to these issues, though if you're not affected by these issues in some/many components, you can enable Tooling API-based deployment for LWC.
I'm going to research other LWC deployment optimizations over the next few weeks. Hopefully I'll find and implement one that's free of these types of issues shortly.