Skip to content

Commit 8ba276e

Browse files
Merge branch 'canary' into update/chokidar
2 parents 4c6c74e + 48acc47 commit 8ba276e

File tree

131 files changed

+2420
-227
lines changed

Some content is hidden

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

131 files changed

+2420
-227
lines changed

.github/workflows/build_test_deploy.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v2
1616
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
1717
- run: yarn install --frozen-lockfile --check-files
18-
- run: node run-tests.js --timings --write-timings -g 1/4
18+
- run: node run-tests.js --timings --write-timings -g 1/1
1919
- uses: actions/cache@v2
2020
id: cache-build
2121
with:
@@ -47,8 +47,25 @@ jobs:
4747
key: ${{ github.sha }}
4848
- run: ./check-pre-compiled.sh
4949

50-
testAll:
51-
name: Test All
50+
testUnit:
51+
name: Test Unit
52+
runs-on: ubuntu-latest
53+
needs: build
54+
env:
55+
NEXT_TELEMETRY_DISABLED: 1
56+
NEXT_TEST_JOB: 1
57+
HEADLESS: true
58+
steps:
59+
- uses: actions/cache@v2
60+
id: restore-build
61+
with:
62+
path: ./*
63+
key: ${{ github.sha }}
64+
65+
- run: node run-tests.js --timings --type unit -g 1/1
66+
67+
testIntegration:
68+
name: Test Integration
5269
runs-on: ubuntu-latest
5370
needs: build
5471
env:
@@ -116,7 +133,7 @@ jobs:
116133
testsPass:
117134
name: thank you, next
118135
runs-on: ubuntu-latest
119-
needs: [lint, checkPrecompiled, testAll, testYarnPnP]
136+
needs: [lint, checkPrecompiled, testIntegration, testUnit, testYarnPnP]
120137
steps:
121138
- run: exit 0
122139

azure-pipelines.yml

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ stages:
1414
- script: dir
1515
- script: dir $(System.DefaultWorkingDirectory)
1616
- script: echo $(Build.SourceVersion)
17-
- powershell: Set-MpPreference -ExclusionPath $(System.DefaultWorkingDirectory)
18-
- powershell: Set-MpPreference -ExclusionPath $(Pipeline.Workspace)/.yarn
19-
- powershell: Set-MpPreference -DisableIntrusionPreventionSystem $true -DisableIOAVProtection $true -DisableRealtimeMonitoring $true -DisableScriptScanning $true -EnableControlledFolderAccess Disabled -EnableNetworkProtection AuditMode -Force -MAPSReporting Disabled -SubmitSamplesConsent NeverSend
2017
- powershell: Get-MpComputerStatus
2118
- task: NodeTool@0
2219
inputs:
@@ -33,19 +30,17 @@ stages:
3330
yarn install --frozen-lockfile --check-files
3431
displayName: 'Install dependencies'
3532
- script: |
36-
node run-tests.js --timings --write-timings --azure -g 1/4
33+
node run-tests.js --timings --write-timings --azure -g 1/1
3734
displayName: 'Fetch test timing data'
35+
3836
- stage: Test
3937
dependsOn: Build
4038
jobs:
41-
- job: test_ie11
39+
- job: test_ie11_production
4240
pool:
4341
vmImage: 'windows-2019'
4442
steps:
4543
- checkout: none
46-
- powershell: Set-MpPreference -ExclusionPath $(System.DefaultWorkingDirectory)
47-
- powershell: Set-MpPreference -ExclusionPath $(Pipeline.Workspace)/.yarn
48-
- powershell: Set-MpPreference -DisableIntrusionPreventionSystem $true -DisableIOAVProtection $true -DisableRealtimeMonitoring $true -DisableScriptScanning $true -EnableControlledFolderAccess Disabled -EnableNetworkProtection AuditMode -Force -MAPSReporting Disabled -SubmitSamplesConsent NeverSend
4944
- task: NodeTool@0
5045
inputs:
5146
versionSpec: $(node_version)
@@ -60,7 +55,31 @@ stages:
6055
- script: |
6156
yarn testie --forceExit test/integration/production/
6257
displayName: 'Run tests'
63-
- job: test_chrome
58+
59+
- job: test_unit
60+
pool:
61+
vmImage: 'windows-2019'
62+
steps:
63+
- checkout: none
64+
- script: |
65+
wmic datafile where name="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" get Version /value
66+
displayName: 'List Chrome version'
67+
- task: NodeTool@0
68+
inputs:
69+
versionSpec: $(node_version)
70+
displayName: 'Install Node.js'
71+
- task: Cache@2
72+
inputs:
73+
# use deterministic cache key that is specific
74+
# to this test run
75+
key: $(Build.SourceVersion)
76+
path: $(System.DefaultWorkingDirectory)
77+
displayName: Cache Build
78+
- script: |
79+
node run-tests.js -g 1/1 --timings --azure --type unit
80+
displayName: 'Run tests'
81+
82+
- job: test_chrome_integration
6483
pool:
6584
vmImage: 'windows-2019'
6685
strategy:
@@ -75,9 +94,6 @@ stages:
7594
group: 4/4
7695
steps:
7796
- checkout: none
78-
- powershell: Set-MpPreference -ExclusionPath $(System.DefaultWorkingDirectory)
79-
- powershell: Set-MpPreference -ExclusionPath $(Pipeline.Workspace)/.yarn
80-
- powershell: Set-MpPreference -DisableIntrusionPreventionSystem $true -DisableIOAVProtection $true -DisableRealtimeMonitoring $true -DisableScriptScanning $true -EnableControlledFolderAccess Disabled -EnableNetworkProtection AuditMode -Force -MAPSReporting Disabled -SubmitSamplesConsent NeverSend
8197
- script: |
8298
wmic datafile where name="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" get Version /value
8399
displayName: 'List Chrome version'

errors/next-head-count-missing.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ You have a custom `pages/_document.js` that doesn't have the components required
66

77
#### Possible Ways to Fix It
88

9-
Upgrade Next.js to 9.5.4 or later, which does not require `next-head-count`.
10-
11-
If you can't upgrade right now, ensure that your `_document.js` is importing and rendering all of the [required components](https://nextjs.org/docs/advanced-features/custom-document).
9+
Ensure that your `_document.js` is importing and rendering all of the [required components](https://nextjs.org/docs/advanced-features/custom-document).
1210

1311
In this case you are most likely not rendering the `<Head>` component imported from `next/document`.

examples/cms-contentful/pages/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default function Index({ preview, allPosts }) {
3636
}
3737

3838
export async function getStaticProps({ preview = false }) {
39-
const allPosts = await getAllPostsForHome(preview)
39+
const allPosts = (await getAllPostsForHome(preview)) ?? []
4040
return {
4141
props: { preview, allPosts },
4242
}
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
import { svg, arm } from './view-source.module.css'
22

33
const ViewSource = ({ pathname }) => (
4-
<a
5-
title="View Source"
6-
href={`https://github.com/vercel/next.js/tree/canary/examples/image-component/${pathname}`}
4+
<svg
5+
xmlns="http://www.w3.org/2000/svg"
6+
width="80"
7+
height="80"
8+
viewBox="0 0 250 250"
9+
fill="#151513"
10+
className={svg}
711
>
8-
<svg
9-
xmlns="http://www.w3.org/2000/svg"
10-
width="80"
11-
height="80"
12-
viewBox="0 0 250 250"
13-
fill="#151513"
14-
className={svg}
12+
<a
13+
title="View Source"
14+
href={`https://github.com/vercel/next.js/tree/canary/examples/image-component/${pathname}`}
1515
>
1616
<path d="M0 0l115 115h15l12 27 108 108V0z" fill="#fff" />
1717
<path
1818
className={arm}
1919
d="M128 109c-15-9-9-19-9-19 3-7 2-11 2-11-1-7 3-2 3-2 4 5 2 11 2 11-3 10 5 15 9 16"
2020
/>
2121
<path d="M115 115s4 2 5 0l14-14c3-2 6-3 8-3-8-11-15-24 2-41 5-5 10-7 16-7 1-2 3-7 12-11 0 0 5 3 7 16 4 2 8 5 12 9s7 8 9 12c14 3 17 7 17 7-4 8-9 11-11 11 0 6-2 11-7 16-16 16-30 10-41 2 0 3-1 7-5 11l-12 11c-1 1 1 5 1 5z" />
22-
</svg>
23-
</a>
22+
</a>
23+
</svg>
2424
)
2525

2626
export default ViewSource

examples/with-gsap/.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
.prettierrc
8+
9+
# testing
10+
/coverage
11+
12+
# next.js
13+
/.next/
14+
/out/
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# local env files
29+
.env.local
30+
.env.development.local
31+
.env.test.local
32+
.env.production.local
33+
34+
# vercel
35+
.vercel

examples/with-gsap/App.scss

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
@import url('https://fonts.googleapis.com/css?family=Bebas+Neue|Poppins:300,400&display=swap');
2+
3+
.header {
4+
width: 100%;
5+
display: flex;
6+
align-items: center;
7+
height: 100px;
8+
a {
9+
margin: 0 28px;
10+
text-decoration: none;
11+
color: #181818;
12+
font-size: 12px;
13+
font-weight: 600;
14+
font-family: 'Poppins';
15+
}
16+
}
17+
18+
.container {
19+
position: relative;
20+
width: 1280px;
21+
min-width: 1280px;
22+
margin: 0 auto;
23+
display: flex;
24+
justify-content: center;
25+
.page {
26+
position: absolute;
27+
.inner {
28+
display: flex;
29+
justify-content: center;
30+
h1 {
31+
font-family: 'Bebas Neue';
32+
font-size: 52px;
33+
letter-spacing: 0.1rem;
34+
.line-wrap {
35+
overflow: hidden;
36+
height: 66px;
37+
}
38+
}
39+
p {
40+
font-family: 'Poppins';
41+
margin-top: 200px;
42+
width: 340px;
43+
font-weight: 300;
44+
line-height: 24px;
45+
font-size: 14px;
46+
}
47+
}
48+
}
49+
}
50+
51+
.page-enter {
52+
opacity: 0;
53+
}
54+
.page-enter-active {
55+
opacity: 1;
56+
transition: opacity 400ms;
57+
transition-delay: 600ms;
58+
}
59+
.page-exit {
60+
opacity: 1;
61+
}
62+
.page-exit-active {
63+
opacity: 0;
64+
transition: opacity 400ms;
65+
}

examples/with-gsap/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Example app with GSAP
2+
3+
This example features how to use [GSAP](https://greensock.com/gsap/) as the animation library within a Next.js app.
4+
5+
## Deploy your own
6+
7+
Deploy the example using [Vercel](https://vercel.com):
8+
9+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/next.js/tree/canary/examples/with-gsap)
10+
11+
## How to use
12+
13+
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
14+
15+
```bash
16+
npx create-next-app --example with-gsap with-gsap-app
17+
# or
18+
yarn create next-app --example with-gsap with-gsap-app
19+
```
20+
21+
Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { useEffect, useRef } from 'react'
2+
import { gsap } from 'gsap'
3+
4+
const Content = () => {
5+
let line1 = useRef(null)
6+
useEffect(() => {
7+
gsap.from([line1], 0.6, {
8+
delay: 0.9,
9+
ease: 'power3.out',
10+
y: 24,
11+
stagger: {
12+
amount: 0.15,
13+
},
14+
})
15+
}, [line1])
16+
17+
return (
18+
<p ref={(el) => (line1 = el)} className="line">
19+
A Simple example using{' '}
20+
<a
21+
href="https://greensock.com/gsap/"
22+
style={{ fontWeight: 'bold', textDecoration: 'none' }}
23+
>
24+
GSAP
25+
</a>{' '}
26+
&{' '}
27+
<a
28+
href="https://www.npmjs.com/package/react-transition-group"
29+
style={{ fontWeight: 'bold', textDecoration: 'none' }}
30+
>
31+
react-transition-group
32+
</a>
33+
</p>
34+
)
35+
}
36+
37+
export default Content

examples/with-gsap/components/Home.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import Title from './Title'
2+
import Content from './Content'
3+
4+
const Home = () => {
5+
return (
6+
<div className="inner">
7+
<Title lineContent="With-GSAP" lineContent2="Using NEXT" />
8+
<div>
9+
<div className="other">
10+
{/* Does project report used question death, out more rhetoric unpleasing
11+
what compared both of sentinels. */}
12+
<Content />
13+
</div>
14+
</div>
15+
</div>
16+
)
17+
}
18+
19+
export default Home
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { useEffect, useRef } from 'react'
2+
import { gsap } from 'gsap'
3+
4+
const Title = ({ lineContent, lineContent2 }) => {
5+
let line1 = useRef(null)
6+
let line2 = useRef(null)
7+
useEffect(() => {
8+
gsap.from([line1, line2], 0.8, {
9+
delay: 0.8,
10+
ease: 'power3.out',
11+
y: 64,
12+
stagger: {
13+
amount: 0.15,
14+
},
15+
})
16+
}, [line1, line2])
17+
return (
18+
<h1 className="page-title">
19+
<div className="line-wrap">
20+
<div ref={(el) => (line1 = el)} className="line">
21+
{lineContent}
22+
</div>
23+
</div>
24+
<div className="line-wrap">
25+
<div ref={(el) => (line2 = el)} className="line">
26+
{lineContent2}
27+
</div>
28+
</div>
29+
</h1>
30+
)
31+
}
32+
33+
export default Title

0 commit comments

Comments
 (0)