-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Deprecation] Introduce new build file #4286
Conversation
This will allow EmberApp to call the Brocfile repeatedly and share the project across rebuilds.
I think we can actually do this via deprecation. We should be able to inspect the imported module. |
The goal of this is to parameterize Project. I believe @rwjblue has some other ideas. |
|
We could call it |
Using |
/* global require, module */ | ||
var EmberApp = require('ember-cli/lib/broccoli/ember-app'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is using ember-app
and should be ember-addon
.
@rwjblue Moving it to I would suggest that we have a new build file in the root of the project called |
@chadhietala maybe the global route skips this problem for now? It does make me cringe though. Ultimately this improvement will need to happen. We just need to nail what it means |
@stefanpenner I think it's doable we just need a different name or path that we can guarantee will be there and does not have the likelihood to cause collisions. |
This is the best option proposed so far. I personally dislike having tons of files in a project root, but if we need an unambiguous thing then this is it... |
@chadhietala it is actually ambiguous in config? @rwjblue I am unsure which is better, root of dir or in config/. Balancing clutter and visibility is a tricky thing. Ultimately it likely will just be up to us to make a choice. |
Agreed. I'd be perfectly happy removing the |
We use |
@rwjblue and @stefanpenner restarting travis, locally my tests are green. We just need to deal the one of hardest problems in programming... naming things. Also I'm wondering if it's necessary to add a test to test the deprecation, logic is pretty straight forward. |
@rwjblue and @stefanpenner, do you guys have any more thoughts on this? |
``` | ||
var EmberApp = require('ember-cli/lib/broccoli/ember-app'); | ||
|
||
module.exports = function(project) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about project
-> { project: project }
which ends up being:
module.exports = function(defaults) {
var app = new EmberApp(merge(defaults, {
....
}));
module.exports = app.toTree();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could also make EmberApp do the merge....
ad38c45
to
35d7625
Compare
tests are unhappy |
Instead of passing N arguments to the EmberApp constructur, we should pass a hash so we do not paint our selves into a corner. Internally this is merged from right to left with the developer's options. In other words the developer can completly override the defaults.
35d7625
to
71f9bd2
Compare
Everything looks good if we're ok with the drop in code coverage. |
@rwjblue r? |
var buildFilePath = findUp(file); | ||
|
||
if (buildFilePath === null) { | ||
throw new Error(file + ' not found'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throwing here means that we do not allow fallback to Brocfile.js
with deprecation, can we have a test that has just a Brocfile.js
and confirms that this still works?
4733800
to
667bf5d
Compare
667bf5d
to
f529600
Compare
[Deprecation] Introduce new build file
Yay |
To be able to pass around the project instance we need to parameterize the build file. Since
Brocfile
means something to broccoli we need to create a new build file.