Skip to content

Commit 4003819

Browse files
authored
Upgrade to latest Next.js (attempt 2) (#2805)
* Remove old site, create new Next app * Site header * Fix manypkg issues, copy in bootstrap-reboot.min.css * Website progress * Website progress * Website progress * yarn.lock * Website progress * Fix manypkg errors * Website progress * Website progress: markdown CSS * Website progress * Website progress * Remove spectrum badge from README * Add Carbon ads * Add DocSearch * Add favicon and set page <title> * Website tweaks * Update Netlify config and use next-export * Remove unnecessary dependencies from root package.json * Add custom 404 page * Live editor works (no Babel yet) * [wip] Babel compilation * About to remove web worker stuff * Website: Live code editor stuff * Remove Mac-specific step from CONTRIBUTING * Update CONTRIBUTING for new website development * Done with live code editors * Bring awesome-emotion into repo as an MDX doc * Add redirects to netlify.toml * Website styling, remove @jsx pragma from live code examples * Remove incorrect slack link from community.mdx * Review & tweak website styles * Make tables responsive on mobile * Set up @next/bundle-analyzer * Get @emotion/babel-plugin to work in the browser (HACKS) * Change Carbon ad when path changes * Fix live editor issues * Do LiveEditor compilation in web worker * Fork react-live * Working on live editors * Fix LiveProvider useEffect * Live editor tweaks * Fix web worker @emotion/babel-plugin import * Add website TS TODO * Add more detail to comment * Fix some but not all manypkg issues * Fix Safari-specific styling issues * Website: Use webpack alias for @emotion/babel-plugin * Add comment explaining module aliasing hack * site: Upgrade docsearch * site: Upgrade some packages * site: Upgrade some packages * site: Upgrade next-mdx-remote * Fix layout shift when carbon ads is loading * Make CI use Node 14 This is required for next-mdx-remote v4 * Remove .nvmrc to fix Netlify build * Add Ukraine banner to new website * Fix minor issues in styled.mdx * Minor mobile fixes * Convert GFM tables to HTML so we don't need the remark-gfm plugin * Upgrade all website packages * Update docsearch appId and apiKey (see #2718) * Fixed CacheProvider demo in the docs (see #2678) * CodeSandbox CI node 16 * Simplify .gitignore * Website cleanup after reviewing diff * Fix multiple @types/react * Add test:typescript script to emotion-site * Make all code blocks have the same font-size * Autolink headings * Minor website fixes * remark-responsive-tables
1 parent c9a1195 commit 4003819

File tree

142 files changed

+4103
-12820
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+4103
-12820
lines changed

.codesandbox/ci.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"packages": ["packages/*"],
33
"sandboxes": ["pk1qjqpw67"],
4-
"node": "12"
4+
"node": "16"
55
}

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
indent_style = space
8+
9+
[*.{js,ts,tsx,json,yml}]
10+
indent_size = 2

.eslintignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ coverage/
44
node_modules/
55
stylis.min.js
66
/demo/dist
7-
/packages/site/build
8-
flow-typed/
7+
flow-typed/
8+
9+
# This is to prevent ESLint parsing errors in the website which is written in
10+
# TypeScript. TODO: Reenable once the codebase is converted to TypeScript.
11+
/site/

.github/actions/ci-setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 'CI setup'
22
runs:
33
using: 'composite'
44
steps:
5-
- name: Set Node.js 16.x
5+
- name: Setup Node.js 16.x
66
uses: actions/setup-node@v3
77
with:
88
node-version: 16.x

.gitignore

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ dist/
44
node_modules/
55
*.log
66
.idea
7-
site/build
87
package-lock.json
98
.DS_Store
109
.cache
11-
public/
12-
!playgrounds/cra/public
1310
.env
1411
.vscode
15-
.parcel-cache/
12+
.parcel-cache/
13+
*.orig
14+
*.tsbuildinfo
15+
16+
# Website
17+
site/out
18+
.next

.nvmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

CONTRIBUTING.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55

66
## Installation
77

8-
- (If using an M1 Mac) Install `vips` via Homebrew: `brew install vips`.
9-
- This step can be removed from this document if we upgrade to the latest
10-
version of Gatsby, which is compatible with sharp 0.28.0+ which does include
11-
binaries for M1 Macs.
128
- (If using Windows) Enable Developer Mode in the Windows settings app. On Windows 11, this can be done by searching the start menu for "Developer settings" and then enabling the Developer Mode toggle switch.
139
- Run `yarn` in the repository's root directory to install everything you need for development.
1410
- Run `yarn build` in the root directory to build the modules.
@@ -27,9 +23,9 @@
2723

2824
## Documentation Website Development
2925

30-
- Run above installation steps and then
31-
- Run `yarn start:site` to run a development server of gatsby.
32-
- Run `yarn build:site` to create a build of the assets for the documentation website.
26+
- Run above installation steps and then `cd` to the `site` directory.
27+
- Run `yarn dev` to run the Next.js development server.
28+
- Run `yarn build` to create a build of the assets for the documentation website.
3329

3430
## Changesets
3531

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
![@emotion/styled size](https://img.shields.io/bundlephobia/min/@emotion/styled.svg?label=@emotion/styled%20size)
1717
![@emotion/styled gzip size](https://img.shields.io/bundlephobia/minzip/@emotion/styled.svg?label=@emotion/styled%20gzip%20size)
1818
[![slack](https://img.shields.io/badge/join-slack-green)](https://join.slack.com/t/emotion-slack/shared_invite/zt-rmtwsy74-2uvyFdz5uxa8OiMguJJeuQ)
19-
[![spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/emotion)
2019

2120
Emotion is a performant and flexible CSS-in-JS library. Building on many other CSS-in-JS libraries, it allows you to style apps quickly with string or object styles. It has predictable composition to avoid specificity issues with CSS. With source maps and labels, Emotion has a great developer experience and great performance with heavy caching in production.
2221

docs/babel.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22
title: 'Babel Plugin'
33
---
44

5-
`@emotion/babel-plugin` is highly recommended. All of the options that can be provided to `@emotion/babel-plugin` are documented in [`@emotion/babel-plugin`'s README](https://github.com/emotion-js/emotion/tree/main/packages/babel-plugin).
5+
`@emotion/babel-plugin` is highly recommended. All of the options that can be provided to `@emotion/babel-plugin` are documented in [`@emotion/babel-plugin`'s README](/docs/@emotion/babel-plugin).
66

7-
### Install
7+
## Install
88

99
In `emotion` version 8 and above, installation is optional. In older versions, installation is required. See the [installation instructions](/docs/install.mdx).
1010

11-
### Features which are enabled with the babel plugin
11+
## Features which are enabled with the babel plugin
1212

13-
### Minification
13+
#### Minification
1414

1515
Any leading/trailing space between properties in your `css` and `styled` blocks is removed. This can reduce the size of your final bundle.
1616

17-
### Dead Code Elimination
17+
#### Dead Code Elimination
1818

1919
Uglifyjs will use the injected `/*#__PURE__*/` flag comments to mark your `css` and `styled` blocks as candidates for dead code elimination.
2020

21-
### Source Maps
21+
#### Source Maps
2222

2323
When enabled, navigate directly to the style declaration in your javascript file.
2424

25-
### Components as selectors
25+
#### Components as selectors
2626

2727
The ability to refer to another component to apply override styles depending on nesting context. Learn more in the [styled docs](/docs/styled.mdx#targeting-another-emotion-component).

docs/cache-provider.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ It can be useful to customize emotion's options - i.e. to add custom Stylis plug
66

77
```jsx
88
// @live
9-
/** @jsx jsx */
10-
import { CacheProvider, jsx, css } from '@emotion/react'
9+
import { CacheProvider, css } from '@emotion/react'
1110
import createCache from '@emotion/cache'
1211
import { prefixer } from 'stylis'
1312

@@ -17,9 +16,10 @@ const myCache = createCache({
1716
key: 'my-prefix-key',
1817
stylisPlugins: [
1918
customPlugin,
20-
// has to be included manually when customizing `stylisPlugins` if you want to have vendor prefixes added automatically
19+
// has to be included manually when customizing `stylisPlugins` if you want
20+
// to have vendor prefixes added automatically
2121
prefixer
22-
],
22+
]
2323
})
2424

2525
render(

0 commit comments

Comments
 (0)