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

Getting rid of build warnings #110

Merged
merged 1 commit into from
Feb 28, 2017
Merged

Getting rid of build warnings #110

merged 1 commit into from
Feb 28, 2017

Conversation

mveritym
Copy link
Contributor

@mveritym mveritym commented Dec 1, 2016

Fixes #90

  • Removing autoprefixer (now part of postcss)
  • Updating postcss and postcss-loader to latest versions
  • Telling uglify to ignore warnings from node_modules

Feedback welcome, this is my first open source PR ever 🎉

@khanbot
Copy link

khanbot commented Dec 1, 2016

CLA signature looks good 👍

@jdan
Copy link
Owner

jdan commented Dec 1, 2016

Hey @mveritym,

Thanks so much for this - very excited to see you've made tota11y the target of your first open source PR!!

I'll give this a look today - but at a glance everything looks really great, this is going to be really valuable.

Copy link
Owner

@jdan jdan left a comment

Choose a reason for hiding this comment

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

Hey @mveritym, I gave this an initial pass and dropped a few comments inline. No rush.

Happy to walk through any of these wherever I can be helpful - thanks again!

package.json Outdated
@@ -32,7 +31,7 @@
"scripts": {
"build": "npm run prod && npm run dev",
"prod": "webpack --config webpack.config.babel.js -p",
"dev": "webpack --config webpack.config.babel.js -d --devtool hidden --output-file=tota11y.js",
"dev": "webpack --config webpack.config.babel.js -d --devtool hidden --output=tota11y.js",
Copy link
Owner

Choose a reason for hiding this comment

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

Looks like tota11y.js is no longer being generated because of this line. Is that possible?

@@ -9,7 +9,6 @@
"author": "Jordan Scales <scalesjordan@gmail.com>",
"devDependencies": {
"accessibility-developer-tools": "2.9.0-rc.0",
"autoprefixer-loader": "^2.0.0",
Copy link
Owner

Choose a reason for hiding this comment

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

Do we need to configure autoprefixing within postcss now? It seems some properties like align-items are not being prefixed. Can you confirm?

image

For reference, here's how .tota11y-plugin-switch is defined currently on master:

image

@@ -58,6 +58,7 @@ module.exports = {
new webpack.ProvidePlugin({
[options.jsxPragma]: path.join(__dirname, "utils", "element"),
}),
new webpack.optimize.UglifyJsPlugin({compress: {warnings: false}})
Copy link
Owner

Choose a reason for hiding this comment

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

Great!

Copy link
Owner

Choose a reason for hiding this comment

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

Oh hmmm, I'm noticing that this is minifying tota11y.js too, but we want to keep that uncompressed.

I noticed this by running:

rm -rf build/
npm run build

and then viewing the contents of build/tota11y.js. Is there an easy way we can make this plugin only apply for the production case? (See prod in package.json's "scripts" field).

@jdan
Copy link
Owner

jdan commented Dec 7, 2016

Apologies for the delayed review. I went on vacation and forgot to drop an update here that I was a bit behind schedule.

@mveritym
Copy link
Contributor Author

mveritym commented Dec 9, 2016

@jdan no worries about the delay, hope you enjoyed your holiday! Fixed the pretty major stuff I missed, thanks for the review 🙂

Copy link
Owner

@jdan jdan left a comment

Choose a reason for hiding this comment

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

Thanks again for the much-needed upgrades here. I've identified two more potential issues inline - mind taking another look? Happy to answer any questions!

],
postcss: [veryimportant],
postcss: [veryimportant, autoprefixer],
Copy link
Owner

Choose a reason for hiding this comment

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

Looks like we'll need our browser config from above here. That is, {browsers:['> 1%']} removed from above on line 62 and passed into the autoprefixer plugin like so:

[veryimportant, autoprefixer({ browsers: ["> 1%"] })]

I think that will do the trick!

@@ -58,6 +58,7 @@ module.exports = {
new webpack.ProvidePlugin({
[options.jsxPragma]: path.join(__dirname, "utils", "element"),
}),
new webpack.optimize.UglifyJsPlugin({compress: {warnings: false}})
Copy link
Owner

Choose a reason for hiding this comment

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

Oh hmmm, I'm noticing that this is minifying tota11y.js too, but we want to keep that uncompressed.

I noticed this by running:

rm -rf build/
npm run build

and then viewing the contents of build/tota11y.js. Is there an easy way we can make this plugin only apply for the production case? (See prod in package.json's "scripts" field).

@jdan
Copy link
Owner

jdan commented Feb 28, 2017

Hey @mveritym,

Just checking in - I'm going to be making a couple tweaks on here to fix the little nits I pointed out. Feel free to check out the commits that appear at the bottom of this page and comment as you see fit!

I just fixed the issue with the uglifyJS plugin usage (thanks to you for teaching me how we could include that in the babel config!) so that it conditionally added uglifyjs if we're in production mode.

@jdan jdan merged commit 493293d into jdan:master Feb 28, 2017
@jdan
Copy link
Owner

jdan commented Feb 28, 2017

Hey @mveritym,

I went ahead and squashed all your changes and landed them on master

Just wanted to give a special thanks for tackling this - dependency upgrades are difficult yet super important tasks that really help to make projects like tota11y stand the test of time. I really appreciate all the hard work you put into the PR, and I am honored that you chose tota11y as the home of your first open source pull request!

Feel free to reach out anytime if you're looking for another problem to tackle, or if you have any questions/comments on how we can make this project better for contributors.

Take care, and thanks again!
@jdan

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.

Fix build warnings
3 participants