Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
1cbb5958
Commit
1cbb5958
authored
Jul 19, 2019
by
JJ Kasper
Committed by
Joe Haddad
Jul 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix syntax error in ie11 from next-server/amp (#8032)
parent
2758060b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
amp.js
packages/next-server/amp.js
+2
-2
some-amp.js
test/integration/production/pages/some-amp.js
+11
-0
index.test.js
test/integration/production/test/index.test.js
+7
-0
No files found.
packages/next-server/amp.js
View file @
1cbb5958
const
{
useAmp
}
=
require
(
'./dist/lib/amp'
)
const
amp
=
require
(
'./dist/lib/amp'
)
module
.
exports
=
{
useAmp
}
module
.
exports
=
{
useAmp
:
amp
.
useAmp
}
test/integration/production/pages/some-amp.js
0 → 100644
View file @
1cbb5958
import
{
useAmp
}
from
'next/amp'
if
(
typeof
window
!==
'undefined'
)
{
window
.
addEventListener
(
'error'
,
()
=>
{
document
.
querySelector
(
'p'
).
innerText
(
'error'
)
})
}
export
const
config
=
{
amp
:
'hybrid'
}
export
default
()
=>
<
p
>
{
useAmp
()
?
'AMP'
:
'Not AMP'
}
<
/p
>
test/integration/production/test/index.test.js
View file @
1cbb5958
...
@@ -566,6 +566,13 @@ describe('Production Usage', () => {
...
@@ -566,6 +566,13 @@ describe('Production Usage', () => {
expect
(
text
).
toMatch
(
/some interesting title/
)
expect
(
text
).
toMatch
(
/some interesting title/
)
})
})
it
(
'should handle AMP correctly in IE'
,
async
()
=>
{
const
browser
=
await
webdriver
(
appPort
,
'/some-amp'
)
await
waitFor
(
1000
)
const
text
=
await
browser
.
elementByCss
(
'p'
).
text
()
expect
(
text
).
toBe
(
'Not AMP'
)
})
dynamicImportTests
(
context
,
(
p
,
q
)
=>
renderViaHTTP
(
context
.
appPort
,
p
,
q
))
dynamicImportTests
(
context
,
(
p
,
q
)
=>
renderViaHTTP
(
context
.
appPort
,
p
,
q
))
processEnv
(
context
)
processEnv
(
context
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment