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

[WIP][BUGFIX] Not overwrite the custom css configuration #5305

Closed
wants to merge 1 commit into from

Conversation

dukex
Copy link
Contributor

@dukex dukex commented Jan 5, 2016

Today the defaults merge is overwrite the css outputPath configured always adding the app config.
This pull request fix #4948 and is related with adopted-ember-addons/ember-cli-sass#81

See the problem, given the follow config

var app = new EmberApp({
  outputPaths: {
    app: {
      css: {
        'theme-orange': '/assets/theme-orange.css',
        'theme-purple': '/assets/theme-purple.css'
      }
    }
  }
});

With this config today it's expected a app.css but the user explicitly overwrote the css config. In the other hand the guides teach the user put the app file when he is overwrite the css outputPath

var app = new EmberApp({
  outputPaths: {
    app: {
      css: {
        'app': '/assets/application-name.css',
        'themes/alpha': '/assets/themes/alpha.css'
      }
    }
  }
});

A alternative and easy fix is tell to users always have a app.css because the ember will always send to addon the outputPaths with app

ps: Maybe I need fix some acceptance tests

@stefanpenner
Copy link
Contributor

this seems reasonable.

cc @chadhietala i believe your change to fix the options merging may be related, can you 👀

@@ -202,6 +199,13 @@ EmberApp.prototype._initOptions = function(options, isProduction) {
}
});

// Do not override custom css config if it was configured
this.options.outputPaths.app = Object.assign({
Copy link
Member

Choose a reason for hiding this comment

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

If we are supporting Node 0.12.0 this will not work due to Object.assign not being a thing.

Copy link
Contributor

Choose a reason for hiding this comment

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

we also support node 0.10.x

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @chadhietala, fixed

@homu
Copy link
Contributor

homu commented Jan 20, 2016

☔ The latest upstream changes (presumably #5367) made this pull request unmergeable. Please resolve the merge conflicts.

@stefanpenner
Copy link
Contributor

this needs a rebase:

@chadhietala can you take another look, assign now comes from lodash
@rwjblue r?

@chadhietala
Copy link
Member

Seems good.

@dukex
Copy link
Contributor Author

dukex commented Jan 21, 2016

I need to check the tests failing.

@homu
Copy link
Contributor

homu commented Jan 22, 2016

☔ The latest upstream changes (presumably #5379) made this pull request unmergeable. Please resolve the merge conflicts.

@@ -256,7 +256,7 @@ EmberApp.prototype._initVendorFiles = function() {
handlebarsVendorFiles = null;
}

this.vendorFiles = omitBy(merge({
this.vendorFiles = omit(merge({
Copy link
Member

Choose a reason for hiding this comment

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

I do not believe that we have omit being required any more, I believe it should be omitBy and this sholdn't need to be changed...

@stefanpenner
Copy link
Contributor

@dukex can you update based on the above feedback + rebase ?

@dukex
Copy link
Contributor Author

dukex commented Jan 26, 2016

@stefanpenner sure, I'll do it today

@@ -286,7 +286,9 @@ EmberApp.prototype._initVendorFiles = function() {
}
}
]
}, this.options.vendorFiles), isNull);
}, this.options.vendorFiles), function(value) {
Copy link
Member

Choose a reason for hiding this comment

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

I am not seeing how this is any different that what we already have since _.isNull is actually the same code:

    function isNull(value) {
      return value === null;
    }

I'm also confused how the merging of vendorFiles is related to outputPaths.

@stefanpenner
Copy link
Contributor

@dukex ping

@Turbo87
Copy link
Member

Turbo87 commented May 25, 2016

closing due to inactivity

@Turbo87 Turbo87 closed this May 25, 2016
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.

outputPaths always send the app css
6 participants