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

feat: always enable all render functions #6165

Closed
3 tasks done
werterhalimi opened this issue Feb 18, 2025 · 1 comment · Fixed by #6167
Closed
3 tasks done

feat: always enable all render functions #6165

werterhalimi opened this issue Feb 18, 2025 · 1 comment · Fixed by #6167

Comments

@werterhalimi
Copy link

Prerequisites

Describe the Feature Request

As discussed with @johnjenkins on the Stencil Discord (https://discord.com/channels/520266681499779082/933029266562613309/1339564884375109744), it is useful to be able to override a component's lifecycle function even if it is not manually declared on some component in the project.
In this article, the author creates a custom decorator that calls a method when clicking outside of a component. This is useful, but it won't work if the componentDidLoad function is not declared somewhere in the project.
In this Gist, the author attempts to force the BUILD.connectedCallback attribute to be true to bypass this issue, but it doesn't work.

Describe the Use Case

There are a lot of usecases. Here one: https://medium.com/stencil-tricks/stenciljs-creating-custom-decorators-d4d8e78c5717
I think that the fact that we cannot override those function is an unexpected behavior

Describe Preferred Solution

@johnjenkins seems to believe that this micro-optimisation is not useful so the simplest solution would be to remove it.
It could also be a flag that disables this optimisation so there is no change for those who don't need it.

Describe Alternatives

No response

Related Code

On this gist the author tries to bypass the problem by overriding the BUILD reference but it doesn't work https://github.com/jarrvis/stencil-click-outside/blob/master/src/index.ts

Additional Information

No response

@christian-bromann
Copy link
Member

A patch for this has been released in v4.27.0.

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

Successfully merging a pull request may close this issue.

2 participants