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

Explore a compile-time step to add hooks #31768

Closed
btford opened this issue Mar 31, 2014 · 4 comments
Closed

Explore a compile-time step to add hooks #31768

btford opened this issue Mar 31, 2014 · 4 comments
Labels
area: compiler Issues related to `ngc`, Angular's template compiler feature Issue that requests a new feature
Milestone

Comments

@btford
Copy link
Contributor

btford commented Mar 31, 2014

I'm mostly just brainstorming/documenting this idea. I'm not sure if it's worth taking a shot at implementing it.

Suggested by @mikeal over here.

Pros:

  • might be a smaller code size
  • might be faster since you can unwrap/inline hooks

Cons:

  • can't call any code that you didn't compile – you can't include jquery.js; you'd have to preprocess it first.
  • perhaps harder to implement than patching (probably can't use static analysis) – ['setTimeout'].forEach(function (fn) { ... }};
@mikeal
Copy link

mikeal commented Mar 31, 2014

FTR, the tradeoffs probably aren't worth it. I was just thinking about the advantages/disadvantages of the two approaches.

@btford
Copy link
Contributor Author

btford commented Mar 31, 2014

that's my feeling too, but I think it'd be a fun exercise

@JiaLiPassion JiaLiPassion transferred this issue from angular/zone.js Jul 21, 2019
@AndrewKushnir AndrewKushnir added the area: compiler Issues related to `ngc`, Angular's template compiler label Jul 22, 2019
@ngbot ngbot bot added this to the needsTriage milestone Jul 22, 2019
@alxhub alxhub added the feature Issue that requests a new feature label Jul 23, 2019
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Jul 23, 2019
@AndrewKushnir
Copy link
Contributor

This was implemented for the ngOnChanges lifecycle hook to provide better tree-shaking, see ng_onchanges_feature.ts.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: compiler Issues related to `ngc`, Angular's template compiler feature Issue that requests a new feature
Projects
None yet
Development

No branches or pull requests

4 participants