Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull out @salesforce import transforms not relevant to OSS #44

Open
trevor-bliss opened this issue Oct 25, 2019 · 3 comments
Open

Pull out @salesforce import transforms not relevant to OSS #44

trevor-bliss opened this issue Oct 25, 2019 · 3 comments

Comments

@trevor-bliss
Copy link
Contributor

trevor-bliss commented Oct 25, 2019

In a test, the @salesforce scoped module imports will be automatically transpiled to provide a default value since the actual value would require a connection to an active app.

For example, import myMethod from '@salesforce/apex/FooController.fooMethod' will be automatically transpiled to define myMethod and set it's value to some reasonable default. In this case, myMethod will be a function that returns a resolved Promise.

Most (all?) of these @salesforce imports are not relevant to people not devloping on the Salesforce platform. We should pull these transforms out into a separate project and only apply them when tests are run on the platform.

W-6834501

@pmdartus
Copy link
Member

Agreed, all the @salesforce/ prefixed imports should be transformed by another transformer. In order to keep this project simple to maintain, what do you think about creating this transformer in this repository?

@trevor-bliss
Copy link
Contributor Author

I don't mind keeping the additional transformer in this repo, though I know some imports may be internal only.

@CommanderQ
Copy link

Would I be correct in assuming that resolving this issue would also be related to enhanced support for the @salesforce/internal/* imports?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants