Replies: 1 comment
-
It would indeed be simpler for creating more addons 💯 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Issue
Regarding applying add-ons to the generated project, the current behavior of the template when applying optional add-ons is to display a prompt asking if the add-on is needed or not. If yes, the add-one is applied immediately.
The current flow can cause the issue when some add-ons need to apply differently based on whether the other specific add-on is applied or not. For example, the Wallaby add-on must include
ExVCR.Mock
toFeatureCase
only when the ExVCR add-on is applied. (Check out this issue for more information)For more clarification, here is another example. There are two add-ons. The first add-on must apply differently if the second add-on is applied (e.g. rename add configuration, rename some files). This can be solved by ordering a second add-on before the first add-on, but I think it is not a solid solution and prone to bugs if future developers do not seem aware that ordering is matters.
Besides the issue mentioned above, there may have more problems when the template grows and introduces more add-ons, and some of them can have different behavior depending on the applied add-ons.
Solution
Show all prompts for optional add-ons first and store the user response somewhere (Maybe, in the
Project
struct). After the user responds to all the prompts, start applying add-ons. With this flow, each add-on is aware of which other add-ons will be applied and can behave differently based on the context.Who Benefits?
Developers
What's Next?
7 votes ·
Beta Was this translation helpful? Give feedback.
All reactions