-
Notifications
You must be signed in to change notification settings - Fork 771
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
bug: defineCustomElements return type is wrong #4589
Comments
@andrew9994 thanks for reporting, I was just able to confirm that this is an issue by putting together a quick reproduction here (https://github.com/alicewriteswrongs/stencil-custom-elements-repro) In the future when reporting issues if you have time to put together something along those lines it greatly helps us in diagnosing problems! The fix is straightforward here so I'm going to get going on it. Thanks again for filing this! |
This fixes an issue with the type for `defineCustomElements` that we set in output-lazy-loader.ts. In #4419 we changed the return type of the function to be `void` (at runtime) but we didn't make a corresponding adjustment to the type declaration for the function that we generate here: https://github.com/ionic-team/stencil/blob/7d5dc6cf5e0d2020c513cc87b6b2e5b93eece9bc/src/compiler/output-targets/output-lazy-loader.ts#L88 This change adjusts that type declaration to have a `void` return value, instead of `Promise<void>`. See #4589 for more context
This fixes an issue with the type for `defineCustomElements` that we set in output-lazy-loader.ts. In #4419 we changed the return type of the function to be `void` (at runtime) but we didn't make a corresponding adjustment to the type declaration for the function that we generate here: https://github.com/ionic-team/stencil/blob/7d5dc6cf5e0d2020c513cc87b6b2e5b93eece9bc/src/compiler/output-targets/output-lazy-loader.ts#L88 This change adjusts that type declaration to have a `void` return value, instead of `Promise<void>`. See #4589 for more context
This fixes an issue with the type for `defineCustomElements` that we set in output-lazy-loader.ts. In #4419 we changed the return type of the function to be `void` (at runtime) but we didn't make a corresponding adjustment to the type declaration for the function that we generate here: https://github.com/ionic-team/stencil/blob/7d5dc6cf5e0d2020c513cc87b6b2e5b93eece9bc/src/compiler/output-targets/output-lazy-loader.ts#L88 This change adjusts that type declaration to have a `void` return value, instead of `Promise<void>`. See #4589 for more context
This fixes an issue with the type for `defineCustomElements` that we set in output-lazy-loader.ts. In #4419 we changed the return type of the function to be `void` (at runtime) but we didn't make a corresponding adjustment to the type declaration for the function that we generate here: https://github.com/ionic-team/stencil/blob/7d5dc6cf5e0d2020c513cc87b6b2e5b93eece9bc/src/compiler/output-targets/output-lazy-loader.ts#L88 This change adjusts that type declaration to have a `void` return value, instead of `Promise<void>`. See #4589 for more context
Thanks @alicewriteswrongs for jumping on this so quickly 😊 and sorry for not creating a repro repo, will do it next time. |
The fix for this issue has been released as a part of today's Stencil v4.0.2 release. As a result, I'm going to close this issue. Thanks! |
Prerequisites
Stencil Version
4.0.1
Current Behavior
Currently the return type of
defineCustomElements
is defined as aPromise<void>
on this line in the output-lazy-loader,but the promise got removed in this commit.
Expected Behavior
The return value of
defineCustomElements
should be typed correctly. However, I am not sure whether this change should be marked as a breaking change.System Info
No response
Steps to Reproduce
Import
defineCustomElements
from the loader of a package and try to do something after the promise gets resolved.Code Reproduction URL
n/a
Additional Information
No response
The text was updated successfully, but these errors were encountered: