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

refactor(loader): v5.0.0 #233

Closed
wants to merge 6 commits into from
Closed

refactor(loader): v5.0.0 #233

wants to merge 6 commits into from

Conversation

joshwiens
Copy link
Member

@joshwiens joshwiens commented Dec 5, 2017

Compatibility issues
  • None ( YAY !!!!!! )
Commit message body
 - Enforce options schema
 - Updates code style to Prettier
 - Updates engines
 - Updates peerDependencies
 - Enforces commit message formatting
 - Migrates to CircleCI 2.0

BREAKING CHANGE: Drops support for NodeJS 4.x

BREAKING CHANGE: Drops support for Webpack 2.x

BREAKING CHANGE: Less Loader now enforces it's options & types
 incorrect configurations with throw a validation error.

@jhnns - A note on the changes to the testing infrastructure. Non windows validation is now handled via CircleCI 2.0 on custom build containers.

The validation runs analysis & validations on the lowers common denominator ( maint LTS node + webpack latest ). If those to jobs pass, if will run the remaining validations in a fan-out configuration.

End result is a 50% reduction in build feedback, complete control over our build / test environment & validation on webpack@next as well as node@next.

There is a release task in the build setup as well that can be enabled at the request of the lib owner ( in this case you ).

@joshwiens joshwiens changed the title [WIP] Less Loader v5 [WIP] Less Loader Webpack 4.x compatibility Dec 5, 2017
@joshwiens joshwiens changed the title [WIP] Less Loader Webpack 4.x compatibility refactor: Webpack 4.x compatibility Dec 21, 2017
 - Updates code style to Prettier
 - Updates engines
 - Updates peerDependencies
 - Enforces commit message formatting
 - Migrates to CircleCI 2.0
 - Removes deprecated React JSX support

BREAKING CHANGE: Drops support for NodeJS 4.x

BREAKING CHANGE: Drops support for Webpack 2.x
@webpack-contrib webpack-contrib deleted a comment from codecov bot Dec 21, 2017
BREAKING CHANGE: Less Loader now enforces it's options & types, incorrect configurations with throw.
Copy link
Member

@michael-ciniawsky michael-ciniawsky left a comment

Choose a reason for hiding this comment

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

Needs a test for ValidationError (schema-utils)

The test and README also needs standardization, but that are separate PR's I guess

@@ -0,0 +1,6 @@
# These are the default owners for everything in
# webpack-contrib
@webpack-contrib/org-maintainers
Copy link
Member

Choose a reason for hiding this comment

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

@jhnnns @webpack-contrib/org-maintainers

If he still actively wants to be pinged for review 😛


const render = pify(less.render.bind(less));

function lessLoader(source) {
const loaderContext = this;
const options = getOptions(loaderContext);
validateOptions(schema, options, 'lessLoader');
Copy link
Member

Choose a reason for hiding this comment

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

\nvalidateOptions(...)\n && lessLoader => Less Loader

@@ -42,7 +42,8 @@ function getFileExcerptIfPossible(lessErr) {
* @param {Array<string>} lessErr.extract - e.g. [' .my-style {', ' .undefined-mixin;', ' display: block;']
* @returns {LessError}
*/
function formatLessError(err) { /* eslint-disable no-param-reassign */
function formatLessError(err) {
Copy link
Member

Choose a reason for hiding this comment

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

class LessError extends Error {
   super();
   
   this.name = 'Syntax Error';
   this.message = `${err.message}\n\n`;
   
   // ...message formating

   Error.captureStackTrace(this, this.constructor)
}

export default LessError;

Copy link
Member

@michael-ciniawsky michael-ciniawsky Dec 21, 2017

Choose a reason for hiding this comment

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

This maybe a separate PR aswell

@michael-ciniawsky michael-ciniawsky changed the title refactor: Webpack 4.x compatibility refactor(loader): v5.0.0 Feb 26, 2018
@michael-ciniawsky michael-ciniawsky added this to the 5.0.0 milestone Feb 26, 2018
@jhnns
Copy link
Member

jhnns commented Apr 10, 2018

@d3viant0ne I guess this has been superseded by #253? Anyway, thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants