8000 Replace "resolve_url_loader" by "resolveUrlLoader" by Lyrkan · Pull Request #159 · symfony/webpack-encore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Replace "resolve_url_loader" by "resolveUrlLoader" #159

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

Merged
merged 2 commits into from
Sep 14, 2017

Conversation

Lyrkan
Copy link
Collaborator
@Lyrkan Lyrkan commented Sep 13, 2017

This PR deprecates the resolve_url_loader option used by the enableSassLoader and replaces it by resolveUrlLoader.

This is done to be consistent with other methods that use camel-case instead of snake-case (see #152).

resolve_url_loader will still work for now but will display the following deprecation message:

2017-09-13_23-38-56

Copy link
Member
@weaverryan weaverryan left a comment

Choose a reason for hiding this comment

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

This is just awesome. I really wanted to start the habit/system of deprecating things when possible, even though we are before 1.0. And you were obviously thinking the exact same thing. Nice work! One tiny comment, which I think you'll like. Then we're ready!

throw new Error(`Invalid option "${optionKey}" passed to enableSassLoader(). Valid keys are ${Object.keys(this.sassOptions).join(', ')}`);
let normalizedOptionKey = optionKey;
if (optionKey === 'resolve_url_loader') {
logger.warning('enableSassLoader: "resolve_url_loader" is deprecated. Please use "resolveUrlLoader" instead.');
Copy link
Member

Choose a reason for hiding this comment

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

How about a new logger.deprecation method? It will probably look the same, but can be a nice, standard way to start doing this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍

8000 @Lyrkan Lyrkan force-pushed the deprecate-resolve_url_loader branch from 77d6f42 to ff442a6 Compare September 14, 2017 19:45
resolve_url_loader: true
resolveUrlLoader: true
};
this.preactOptions = {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not related to this PR but it wasn't at the right place since #152 was merged after #144

@weaverryan
Copy link
Member

Awesome. Thank you @Lyrkan!

@weaverryan weaverryan merged commit ff442a6 into symfony:master Sep 14, 2017
weaverryan added a commit that referenced this pull request Sep 14, 2017
This PR was squashed before being merged into the master branch (closes #159).

Discussion
----------

Replace "resolve_url_loader" by "resolveUrlLoader"

This PR deprecates the `resolve_url_loader` option used by the `enableSassLoader` and replaces it by `resolveUrlLoader`.

This is done to be consistent with other methods that use camel-case instead of snake-case (see [#152](#152 (comment))).

`resolve_url_loader` will still work for now but will display the following deprecation message:

![2017-09-13_23-38-56](https://user-images.githubusercontent.com/850046/30402523-4c736d86-98de-11e7-97c1-81a216912fb7.png)

Commits
-------

ff442a6 Add a logger.deprecation(message) method
9dac153 Replace sass option 'resolve_url_loader' by 'resolveUrlLoader'
@Lyrkan Lyrkan deleted the deprecate-resolve_url_loader branch September 22, 2017 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0