broccolijs / broccoli-funnel

MIT License
66 stars 37 forks source link

Allow subclasses to add additional input nodes. #146

Closed rwjblue closed 3 years ago

rwjblue commented 3 years ago

Subclassing broccoli-funnel has become somewhat common (e.g. Embroider and ember-css-modules both do it). This adds a basic test to confirm that it generally works.

Additionally, this adds the ability for the subclass to add additional nodes to be considered as part of the broccoli tree graph. This ensures that if you happen to subclass and need to read from another tree to know where to write, you can add that other tree to your inputs and be guaranteed that they will have been built before you are called. Without this change, it might seem to work sometimes but it is absolutely not guaranteed to work.