Commit graph

32 commits

Author SHA1 Message Date
Steven
4466ba436b
chore(examples): use default prettier for examples/templates (#60530)
## Description
This PR ensures that the default prettier config is used for examples
and templates.

This config is compatible with `prettier@3` as well (upgrading prettier
is bigger change that can be a future PR).

## Changes
- Updated `.prettierrc.json` in root with `"trailingComma": "es5"` (will
be needed upgrading to prettier@3)
- Added `examples/.prettierrc.json` with default config (this will
change every example)
- Added `packages/create-next-app/templates/.prettierrc.json` with
default config (this will change every template)

## Related

- Fixes #54402
- Closes #54409
2024-01-11 16:01:44 -07:00
rodrigo
6d9ce62f13
examples: update styled-components (#56457)
Co-authored-by: Lee Robinson <me@leerob.io>
2023-11-15 23:14:00 -06:00
Tim Neutkens
ab42da0626
Run next/link codemod for Next.js 13 on examples (#41913) 2022-10-30 21:00:45 +01:00
rodrigo
eb9a500d4c
[Examples] updated styled-components (#37856)
### Example

- added declaration file types for the used theme [Create a declarations file](https://styled-components.com/docs/api#create-a-declarations-file)
- added custom styled component that wraps an `<a>` tag like the next js docs as example [Next link DOCS](https://nextjs.org/docs/api-reference/next/link#if-the-child-is-a-custom-component-that-wraps-an-a-tag)
- changed the ui page like the `create-next-app` examples

### Dependencies

- updated deps to latest
- added types for SC  => @types/styled-components
- removed react-is, unused in this example

 [Example deploy](https://stylednextexample.vercel.app/)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-06-21 13:15:46 +00:00
Dongho
d6fb8337ba
feat: add correct type to with-styled-coponents (#37816)
There's a missing type in with-styled-coponents example's _document.tsx file



## 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)
2022-06-19 16:58:08 +00:00
Balázs Orbán
7ac7ae62b0
chore: simplify with-styled-components (#37237)
Fixes https://github.com/vercel/next.js/issues/37230

## 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 `yarn lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-05-27 15:27:35 +00:00
chemicalkosek
7ce5d3f240
Re-add _document to with-styled-components example (#35163)
`_document.js` was removed from the styled components swc example
I have tested with and without the custom `_document.js`
Unfortunately without `_document.js` there is FOUC (Flash of unstyled content) on initial request.



## 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 `yarn lint`


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-03-10 18:12:23 +00:00
Sacha
b579a35e83
[examples] Update styled-components to use SWC (#34770)
* rename example with-styled-components to with-styled-components-babel

* update with-styled-components references

* update docs on react hydratation erros for styled components

* clone with-styled-components-babel without babel config

* add styledComponents to compiler options in next.config

* replace babel dependency with Next.js SWC compiler

* upgrade example typescript version

example with-typescript-styled-components had a typescript dependency
lower than the recommended version. Upgraded from 4.2.4 to 4.5.5.

* Apply suggestions from code review

* update readme for with-styled-components-babel

remove Notes section since it describes a workaround which is no longer
required to work with `next/link`.

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-03-02 03:43:34 +01:00
Leticijak
7256d34c4f
Update _document.js (#29930)
adding {Head, Html, Main, NextScript} from 'next/document'
setting lang="en"

I find it very useful for loading external scripts, fonts or whatever you may need for a starter package



## 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


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-02-05 22:06:47 +00:00
Arthur Maverick
91b4a2b37e
Adding globalStyled with styled components (#16783)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-09-10 16:05:59 -04:00
Patrick Krawczykowski
ba2fbc2b65
Update _app.js to use a function component. (#16683)
This PR updates the `_app.js` file to remove the `next/app` import. It's not needed with the latest versions of Next
2020-08-30 03:23:42 +00:00
Joe Haddad
dbad9db68c
Update Examples for Fast Refresh (#13068) 2020-05-18 17:44:18 -04:00
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
jmgr2996
dd264f582f
chore: Remove redundant imports in several examples (#13030) 2020-05-18 13:02:23 -04:00
Joe Haddad
18a9c7e371
Improve linting rules to catch more errors (#9374)
* Update `packages/`

* Update examples

* Update tests

* Update bench

* Update top level files

* Fix build

* trigger
2019-11-10 19:24:53 -08:00
Tim Neutkens
a90a55545b
Deprecate Container usage (#8327)
* Remove Container from examples

* Update readme to reflect Container removal
2019-08-11 22:02:33 +02:00
Tim Reynolds
c28f467488 Remove with-styled-components Auto Prerendering warning (#7871) 2019-07-10 14:35:50 +02:00
Tomek
8cdd539f98 add theme to styled-components example (#7206) 2019-05-01 14:26:58 +02:00
Corbin Crutchley
e03266008c form handler example: Update deps and fix build from dep update (#6732)
* form handler example: Update deps and fix build from dep update

* Ran lint error fixers

* Fixes errors that occur when commit occurs

* Commit linter fixes
2019-03-27 16:12:45 -04:00
Spencer Elliott
4dd6094639 styled-components example: use a fragment for styles initial prop (#6252)
`initialProps.styles` is a React node, but not guaranteed to be an
array, so we can use a fragment to concatenate additional styles.

See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/32932#issuecomment-462372319
2019-02-11 20:48:03 +01:00
Lucas Feliciano
ca521b36e6 Manually call sheet.seal() to avoid memory leaks on with-styled-components example (#6107)
I was noticing some bad memory leak on my company's application and I ended up finding this github issue ( https://github.com/styled-components/styled-components/issues/1624 ) .

This comment ( https://github.com/styled-components/styled-components/issues/1624#issuecomment-425382979 ) caught my attention, which lead to this other issue on the repository of styled components website ( https://github.com/styled-components/styled-components-website/issues/329 )

After applying the changes on my project I noticed a huge improvement on memory consumption.

So would be nice to update the example or start a discussion on how to solve this properly
2019-01-24 10:16:47 +01:00
Tim Neutkens
9c4eefcdbf
Add prettier for examples directory (#5909)
* Add prettier for examples directory

* Fix files

* Fix linting

* Add prettier script in case it has to be ran again
2018-12-17 17:34:32 +01:00
Tim Neutkens
ed2c379fc7
Simplify styled-components example (#5631)
- use `enhanceApp` so that styled-components used in _app.js are server rendered
- call parent getInitialProps, fixes #5629
- return `styles`, making the render() method obsolete.

cc @mxstbr @probablyup
2018-11-08 12:43:16 +01:00
Henrik Wenz
18488f47b0 Fix linter (#5350)
* Fix linter

* Add test env

* Fix lint errors
2018-10-20 17:00:01 +02:00
Supakorn Thongtra
fef6026ad9 <title> should not be used in _document.js's (#5379)
* <title> should not be used in _document.js's

* fix style as it was
2018-10-05 23:53:52 +02:00
Shaleen Jain
093b091a5c Update styled components example (#2945)
* Update styled components example

Updates the styled-components example to pass HOC to renderPage() and fix SSR.

* fix lint errors
2017-09-14 14:17:18 +02:00
Grokling
1b893518bb Add SSR to examples/with-styled-components + bump styled_components v2 (#1908) 2017-05-07 14:25:33 +02:00
Sergio Daniel Xalambrí
bb3ceaadea Fix styled-components server-render example (#1382) 2017-03-10 09:07:28 +01:00
Tim Neutkens
e1babdfe9d Render styled-jsx in _document example (#1287) 2017-02-28 05:15:49 +05:30
nkzawa
64aa4454ac examples: fix SSR of styled-components 2017-01-01 20:24:48 +09:00
nkzawa
b8291abeac improve the styled-component example 2016-12-22 17:16:33 +09:00
Dan Zajdband
c5d69f0585 Add/move examples (#470)
* Added redux and styled components (wip) examples.

* Updated examples readmes and package.json

* Fixed styled-components example
2016-12-21 21:10:54 -08:00