-
Notifications
You must be signed in to change notification settings - Fork 49
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
Deprecated props & excessive CSS rules #22
Comments
Hi @r007, thanks for your input, gonna dig into it tomorrow, Read ya tomorrow, Tim. |
|
Hi @r007, have you had the chance to look into and elaborate on And I'm thinking bout removing Thanks again for raising this! Should we leave this open as an issue on it's own, or rather integrate the discussion in #20, through such new developments? |
Hi @r007, in the current version |
Oh, and we are now at |
Hi @r007, |
Hi @r007, again ; ). |
Hi @timhagn Sorry for late reply. Congratulations on your anniversary. Yes, my bad,
It will remove deprecated warning. Agree that it's probably a good idea to remove placeholder props. What about CSS rules, |
Hi @r007, no problem, thanks for replying and the nice anniversary wishes (was a great one : )! Might I ask, where you got the idea about Warning: Failed prop type: Invalid prop `style.backgroundSize` of type `string` supplied to `BackgroundImage`, expected `object`. when adding a simple style prop like such in style={{
backgroundSize: 'contain',
}} With the CSS rules I'm just trying to figure out, how much Gatsby itself precompiles / autoprefixes on it's own - it stripped the superfluous -ms-* prefixes on every build, gotta try it with newer CSS4 ones. Still thanks for the input : )! |
Hi @timhagn, I guess it throws ESLint, here, check this out: forbid-prop-types. Here for example, when I am trying to declare PropTypes.object in my own project: But this particular warning gives me PHPStorm in your project when I hover over the propType declaration: I don't remember the exact declaration, I typed by memory. Here's how style prop is declared in one of my projects: Would be nice to have some kind of ESLint preset in your project. Airbnb for example. What about prefixing - no, prop is not needed I think. |
Hi @r007, ah, OK, now I see - haven't thought about further linting rules (was quite content with the default
Feel free to open a PR : ). Opened a hellhole with issue #20, as it seems % |. |
Finally I went with |
Hi @timhagn Okay, thanks. I think it's good enough, good job. Yes, I'm telling you, prefixes are not needed simply because most of the browsers support them without any problems. Minimal requirement for Gatsby is ES5 as much as I know. These are all quite modern browsers. I close it, will open another issue/PR for ESLint :) |
Hi @timhagn
There are a couple props in your index.js
gatsby-background-image/src/index.js
Line 346 in e495fa6
PropTypes.object is deprecated, please use PropTypes.style instead.
Also, there are many excessive CSS rules for every background. Here for example
gatsby-background-image/src/StyleUtils.js
Line 68 in e495fa6
background-size
is an old property which is widely supported by all modern browsers, no prefixes are needed.transition-delay
- only -webkit prefix is needed.transition
- only -webkit prefix is needed. So need to refactor CSS rule from this:to this:
Hope this helps.
The text was updated successfully, but these errors were encountered: