-
Notifications
You must be signed in to change notification settings - Fork 70
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
Config trailpacks in app #236
base: master
Are you sure you want to change the base?
Config trailpacks in app #236
Conversation
This is nifty. |
@trailsjs/maintainers could we get some conversation going about this? This is pretty useful. |
@scott-wyatt sound pretty good idea for me, @tjwebb what do you think of this ? |
@trailsjs/maintainers nudge nudge. |
Do we need a separate config namespace for this? For example, trailpack-knex is configured by adding stuff to |
@tjwebb and how did you do for trailpacks who doesn't have a specific config file ? or have multiple... |
@catrielmuller @scott-wyatt @jaumard I thought about this some more, and unless I'm misunderstanding this PR still, I don't think this is needed. This functionality is already possible, and is quite easy. You don't need a special config file or namespace for this to work. If a trailpack makes use of a config value also fwiw, I'm including lodash in trails v2.0 so we don't need to write so much merge logic ourselves. |
@tjwebb I think what you are saying is true and if there is an alternative that is easy and doesn't require new code in trails, then that should be the side to err on. |
@tjwebb what we want to achieve here is to be able to modify the lifecycle event of trailpacks. I don't think it's currently possible or please let us know how :) because lifecycle are not in |
aha! Ok I understand now. So we're talking about problems like this: Installed are packs A, B, and C. A's lifecycle is configured to wait for B. But C might be some other pack where it may want to alter the behavior of A by reconfiguring stuff, and so you'll want to modify A's lifecycle to wait for C as well. So while A doesn't depend on C, its behavior may change if C happens to be installed. We may want to include this sort of feature in the trailpack API rather than relying on the developer to directly modify configuration. This is the first example API that comes to mind (feel free to critique if I still don't have something right):
In this example, the method would By running this action through a method, we'll be able to provide much better debugging info to the user when something isn't working, by being able to log exactly what lifecycle modifications are occurring among the trailpacks. |
I like this solution ! I just wondering if user will need/want to use this in there project outside trailpack... But maybe I can update trailpack-bootstrap to have 4 methods |
When does afterStart run? You can listen to the |
@tjwebb afterStart is not a good name it's onReady (https://github.com/trailsjs/trailpack-bootstrap/blob/master/index.js#L27) :) |
Description
Need for implement this feature trailsjs/trailpack#39
Issues
-resolve trailsjs/trailpack#39