Skip to content

Commit

Permalink
add check for not isBrowser to hasNoScript for #131, bump deps & upda…
Browse files Browse the repository at this point in the history
…te CHANGELOG
  • Loading branch information
timhagn committed Nov 19, 2020
1 parent 248c4dd commit 9cd6b96
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 47 deletions.
32 changes: 16 additions & 16 deletions gbitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@
"name": "gbitest",
"private": true,
"description": "A simple starter to show what gatsby-background-image can do.",
"version": "1.1.2",
"version": "1.2.0",
"author": "Tim Hagn <[email protected]>",
"dependencies": {
"gatsby": "^2.25.3",
"gatsby-background-image": "^1.1.2",
"gatsby-image": "^2.4.21",
"gatsby-plugin-manifest": "^2.5.2",
"gatsby-plugin-offline": "^3.3.3",
"gatsby-plugin-react-helmet": "3.3.14",
"gatsby-plugin-sharp": "^2.7.1",
"gatsby-plugin-styled-components": "^3.3.14",
"gatsby-source-filesystem": "^2.4.2",
"gatsby-transformer-sharp": "^2.5.21",
"gatsby": "^2.26.1",
"gatsby-background-image": "^1.2.0",
"gatsby-image": "^2.5.0",
"gatsby-plugin-manifest": "^2.6.1",
"gatsby-plugin-offline": "^3.4.0",
"gatsby-plugin-react-helmet": "3.4.0",
"gatsby-plugin-sharp": "^2.8.0",
"gatsby-plugin-styled-components": "^3.4.0",
"gatsby-source-filesystem": "^2.5.0",
"gatsby-transformer-sharp": "^2.6.0",
"prop-types": "^15.7.2",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-helmet": "^6.1.0",
"styled-components": "^5.2.1",
"styled-media-query": "^2.1.2"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.11.5",
"@testing-library/react": "^11.1.2",
"@testing-library/jest-dom": "^5.11.6",
"@testing-library/react": "^11.2.0",
"babel-jest": "^26.6.3",
"babel-preset-gatsby": "^0.5.16",
"babel-preset-gatsby": "^0.6.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.6.3",
"prettier": "^2.1.2"
Expand Down
1 change: 0 additions & 1 deletion gbitest/src/pages/__tests__/__snapshots__/index.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ background-size: cover;
}
</style>
<noscript />
<div
class="sc-bdfBwQ hwocte"
>
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"devDependencies": {
"@babel/cli": "^7.12.1",
"@babel/core": "^7.12.3",
"@testing-library/jest-dom": "^5.11.5",
"@testing-library/react": "^11.1.2",
"@testing-library/jest-dom": "^5.11.6",
"@testing-library/react": "^11.2.0",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.6.3",
"babel-preset-gatsby-package": "^0.5.3",
"babel-preset-gatsby-package": "^0.6.0",
"core-js": "^3.7.0",
"cross-env": "^7.0.2",
"eslint": "^7.13.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-background-image-es5/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ All notable changes to this project will be documented in the [`CHANGELOG`](http
of [`gatsby-background-image`](https://github.com/timhagn/gatsby-background-image/tree/main/packages/gatsby-background-image),
as this is just a source-to-source compilation of it to ES5.

<a name="1.2.0"></a>
<a name="1.3.0"></a>
6 changes: 5 additions & 1 deletion packages/gatsby-background-image/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

<a name="1.2.0"></a>
<a name="1.3.0"></a>

## [1.3.0](https://github.com/timhagn/gatsby-background-image) (2020-11-19)

**fix:** Added isBrowser() to check for hasNoScript preventing #131.

## [1.2.0](https://github.com/timhagn/gatsby-background-image) (2020-11-12)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ background-size: contain;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down Expand Up @@ -90,7 +89,6 @@ background-size: contain;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down Expand Up @@ -139,7 +137,6 @@ background-size: contain;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down Expand Up @@ -188,7 +185,6 @@ background-size: contain;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down Expand Up @@ -234,7 +230,6 @@ background-size: cover;
}
</style>
<noscript />
</div>
</div>
`;
Expand Down Expand Up @@ -279,7 +274,6 @@ background-size: cover;
}
</style>
<noscript />
</div>
</div>
`;
Expand Down Expand Up @@ -327,7 +321,6 @@ background-size: contain;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ background-size: contain;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down Expand Up @@ -90,7 +89,6 @@ background-size: contain;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down Expand Up @@ -139,7 +137,6 @@ background-size: contain;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down Expand Up @@ -188,7 +185,6 @@ background-size: contain;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down Expand Up @@ -237,7 +233,6 @@ background-size: contain;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down Expand Up @@ -283,7 +278,6 @@ background-size: cover;
}
</style>
<noscript />
<h1>
testempty
</h1>
Expand Down Expand Up @@ -402,7 +396,6 @@ background-size: cover;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down Expand Up @@ -451,7 +444,6 @@ background-size: contain;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down Expand Up @@ -500,7 +492,6 @@ background-size: contain;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down Expand Up @@ -549,7 +540,6 @@ background-size: cover;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down Expand Up @@ -598,7 +588,6 @@ background-size: contain;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down Expand Up @@ -649,7 +638,6 @@ background-size: cover;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down Expand Up @@ -698,7 +686,6 @@ background-size: contain;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down Expand Up @@ -747,7 +734,6 @@ background-size: contain;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down Expand Up @@ -796,7 +782,6 @@ background-size: cover;
}
</style>
<noscript />
<h1>
test
</h1>
Expand Down Expand Up @@ -842,7 +827,6 @@ background-size: cover;
}
</style>
<noscript />
<h1>
testempty
</h1>
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby-background-image/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ class BackgroundImage extends React.Component {
IOSupported = false;
}

// Check if a noscript element should be included.
const hasNoScript = !(convertedProps.critical && !fadeIn);
// Check if a noscript element should be included, check on isBrowser() for #131.
const hasNoScript = !(convertedProps.critical && !fadeIn) && !isBrowser();

// Set initial image state for transitioning.
const imageState = 0;
Expand Down

0 comments on commit 9cd6b96

Please sign in to comment.