I'm checking this on a Spring'19 v45 Sandbox in Execute Anonymous:
[ select Id from AuraDefinitionBundle ] // ==> works fine! [ select Id from AuraDefinition ] // ==> flawless!
I would have strongly expected, that the new LWC will be mapped as the same way as Aura, Apex, Visualforce and StaticResources are mapped into the database. Just as a consistent behavior of the platform. But as a great unfortunate, those lines do FAIL:
[ select Id from LightningComponentBundle ] // ==> Invalid type: Schema.LightningComponentBundle [ select Id from LightningComponentResource ] // ==> Invalid type: Schema.LightningComponentResource
Is this just because the stuff is too NEW and not 100% completed or has Salesforce now decided against mirroring these Metadata into the database for good? Are we forced to use Metadata-api and Tooling-api just for reading these resources?? This would be not nice.
For sure, I would like to get LightningComponentBundle and LightningComponentResource mapped into the database.
Will this come later? Or am I doing something wrong?