Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable New Chunking Behavior #9731

Merged
merged 13 commits into from Jan 3, 2020
2 changes: 1 addition & 1 deletion packages/next/next-server/server/config.ts
Expand Up @@ -44,7 +44,7 @@ const defaultConfig: { [key: string]: any } = {
),
css: false,
documentMiddleware: false,
granularChunks: false,
granularChunks: true,
modern: false,
plugins: false,
profiling: false,
Expand Down
8 changes: 4 additions & 4 deletions test/integration/build-output/test/index.test.js
Expand Up @@ -25,7 +25,7 @@ describe('Build Output', () => {
expect(stdout).toMatch(/\/ [ ]* \d{1,} B/)
expect(stdout).toMatch(/\+ shared by all [ 0-9.]* kB/)
expect(stdout).toMatch(/ runtime\/main\.js [ 0-9.]* kB/)
expect(stdout).toMatch(/ chunks\/commons\.js [ 0-9. ]* kB/)
expect(stdout).toMatch(/ chunks\/framework\.js [ 0-9. ]* kB/)

expect(stdout).not.toContain('/_document')
expect(stdout).not.toContain('/_app')
Expand All @@ -51,7 +51,7 @@ describe('Build Output', () => {
expect(stdout).toMatch(/\/_app [ ]* \d{1,} B/)
expect(stdout).toMatch(/\+ shared by all [ 0-9.]* kB/)
expect(stdout).toMatch(/ runtime\/main\.js [ 0-9.]* kB/)
expect(stdout).toMatch(/ chunks\/commons\.js [ 0-9. ]* kB/)
expect(stdout).toMatch(/ chunks\/framework\.js [ 0-9. ]* kB/)

expect(stdout).not.toContain('/_document')
expect(stdout).not.toContain('/_error')
Expand All @@ -78,7 +78,7 @@ describe('Build Output', () => {
expect(stdout).toMatch(/\/hybrid [ 0-9.]* B/)
expect(stdout).toMatch(/\+ shared by all [ 0-9.]* kB/)
expect(stdout).toMatch(/ runtime\/main\.js [ 0-9.]* kB/)
expect(stdout).toMatch(/ chunks\/commons\.js [ 0-9. ]* kB/)
expect(stdout).toMatch(/ chunks\/framework\.js [ 0-9. ]* kB/)

expect(stdout).not.toContain('/_document')
expect(stdout).not.toContain('/_error')
Expand All @@ -103,7 +103,7 @@ describe('Build Output', () => {
expect(stdout).toMatch(/λ \/_error [ ]* \d{1,} B/)
expect(stdout).toMatch(/\+ shared by all [ 0-9.]* kB/)
expect(stdout).toMatch(/ runtime\/main\.js [ 0-9.]* kB/)
expect(stdout).toMatch(/ chunks\/commons\.js [ 0-9. ]* kB/)
expect(stdout).toMatch(/ chunks\/framework\.js [ 0-9. ]* kB/)

expect(stdout).not.toContain('/_document')
expect(stdout).not.toContain('/_app')
Expand Down
4 changes: 4 additions & 0 deletions test/integration/preload-viewport/pages/multi-prefetch.js
Expand Up @@ -8,6 +8,10 @@ export default () => {
router.prefetch('/dynamic/[hello]')
router.prefetch('/dynamic/[hello]')
router.prefetch('/dynamic/[hello]')

router.prefetch('/dynamic/first')
router.prefetch('/dynamic/first')
router.prefetch('/dynamic/first')
}, [router])
return (
<div>
Expand Down
4 changes: 2 additions & 2 deletions test/integration/size-limit/test/index.test.js
Expand Up @@ -81,7 +81,7 @@ describe('Production response size', () => {
)

// These numbers are without gzip compression!
const delta = responseSizeKilobytes - 230
const delta = responseSizeKilobytes - 234
expect(delta).toBeLessThanOrEqual(0) // don't increase size
expect(delta).toBeGreaterThanOrEqual(-1) // don't decrease size without updating target
})
Expand All @@ -101,7 +101,7 @@ describe('Production response size', () => {
)

// These numbers are without gzip compression!
const delta = responseSizeKilobytes - 197
const delta = responseSizeKilobytes - 202
expect(delta).toBeLessThanOrEqual(0) // don't increase size
expect(delta).toBeGreaterThanOrEqual(-1) // don't decrease size without updating target
})
Expand Down