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

Cleanup EmberApp class #6795

Merged
merged 5 commits into from
Feb 21, 2017
Merged

Cleanup EmberApp class #6795

merged 5 commits into from
Feb 21, 2017

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Feb 21, 2017

No description provided.

options.sourceMapConfig = this.options.sourcemaps;

return concat(tree, options);
this.project.ui.writeDeprecateLine('EmberApp.concatFiles() is deprecated. Please use the `broccoli-concat` module directly.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This unconditionally deprecates calling this.concatFiles (and I presume refactors the internals to avoid calling it and instead call _concatFiles). We originally still funneled work through this.concatFiles because of a ember-cli-fastboot monkey patch. I'm happy to remove this, but we need to also update that monkey patch to continue to function after this lands.

FWIW, the fastboot team has a path forward to remove the need for this monkey patch, and @kratiahuja has been working hard on landing. Take a peek at the meeting summary where we came to consensus...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and I presume refactors the internals to avoid calling it and instead call _concatFiles

we're actually already calling _concatFiles() everywhere internally. the only call to concatFiles() is in a unit test that tests that the deprecation message is being printed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL, OK, WHOOPS!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rwjblue I guess once this lands we need to update the monkey patch until we ship the new fastboot build scheme right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kratiahuja - Yes, but as @Turbo87 pointed out it is already broken (because this PR didn't remove any calls to this.concatFiles, meaning that we had already broken the fastboot monkey patch).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually don't see how this change would result in different behavior for anyone monkeypatching these methods. It still works the same as before and it still shows the same deprecation message as before.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohio sorry my bad, I didn't see you are still calling concatFiles on the next line. Yeah then it will work.

@@ -679,23 +674,21 @@ class EmberApp {
@return {Tree}
*/
_filterAppTree() {
if (this._cachedFilterAppTree) {
return this._cachedFilterAppTree;
if (!this._cachedFilterAppTree) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hehe, I preferred the simpler guard + return clause. No real reason to force rightward shift for such a simple thing.

Not blocking though, this is also fine...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with either, but what I definitely don't like is stuff like return this.cachedSomething = something; aka. assignments in return statements. I actually thought I enabled the ESLint rule that prevented stuff like that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Turbo87 - Seems good to disable return with assignment (I agree many folks are confused by these types of statements).

@@ -742,16 +733,16 @@ class EmberApp {
*/
_configReplacePatterns() {
return [{
match: /\{\{rootURL\}\}/g,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The escaping is not needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently not, no. my IDE actually told me that it's not needed and it seems to work fine without the escaping.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet! Not sure why I would have put them there originally. 😿

@rwjblue
Copy link
Member

rwjblue commented Feb 21, 2017

@homu r+

@homu
Copy link
Contributor

homu commented Feb 21, 2017

📌 Commit 41501d8 has been approved by rwjblue

homu added a commit that referenced this pull request Feb 21, 2017
@homu
Copy link
Contributor

homu commented Feb 21, 2017

⌛ Testing commit 41501d8 with merge bf3f2cd...

@homu
Copy link
Contributor

homu commented Feb 21, 2017

☀️ Test successful - status

@homu homu merged commit 41501d8 into ember-cli:master Feb 21, 2017
@Turbo87 Turbo87 deleted the cleanup-ember-app branch February 21, 2017 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants