Skip to content

Commit

Permalink
chore: fix examples (#40395)
Browse files Browse the repository at this point in the history
Closes #40366

Rebass is not dependent on `styled-components` anymore. See:
https://rebassjs.org/migrating/#v4-breaking-changes

Closes #40367

Document has been converted (#39871) from class, so `this.props` threw
an error.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
  • Loading branch information
balazsorban44 committed Sep 9, 2022
1 parent a3a20dc commit 13e423c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 39 deletions.
9 changes: 0 additions & 9 deletions examples/with-rebass/.babelrc

This file was deleted.

11 changes: 2 additions & 9 deletions examples/with-rebass/package.json
Expand Up @@ -7,14 +7,7 @@
},
"dependencies": {
"next": "latest",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"rebass": "^4.0.7",
"styled-components": "^5.3.0"
},
"devDependencies": {
"babel-plugin-styled-components": "^2.0.7",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-plugin-transform-object-set-prototype-of-to-assign": "^6.22.0"
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
}
18 changes: 0 additions & 18 deletions examples/with-rebass/pages/_document.js

This file was deleted.

6 changes: 3 additions & 3 deletions examples/with-strict-csp/pages/_document.js
Expand Up @@ -6,13 +6,13 @@ const cspHashOf = (text) => {
hash.update(text)
return `'sha256-${hash.digest('base64')}'`
}
export default function Document() {
export default function Document(ctx) {
let csp = `default-src 'self'; script-src 'self' ${cspHashOf(
NextScript.getInlineScriptSource(this.props)
NextScript.getInlineScriptSource(ctx)
)}`
if (process.env.NODE_ENV !== 'production') {
csp = `style-src 'self' 'unsafe-inline'; font-src 'self' data:; default-src 'self'; script-src 'unsafe-eval' 'self' ${cspHashOf(
NextScript.getInlineScriptSource(this.props)
NextScript.getInlineScriptSource(ctx)
)}`
}

Expand Down

0 comments on commit 13e423c

Please sign in to comment.