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

Feature/next plugin storybook #1

Open
wants to merge 55 commits into
base: canary
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
a38167f
Fix with-docker example fails to load image (#25536)
LiuuY May 28, 2021
b924207
Update to latest webpack 5 and webpack-sources (#25558)
ijjk May 29, 2021
d84e2f5
Set default webpack publicPath value to override auto (#25452)
ijjk May 29, 2021
f817e60
Update size limit test
timneutkens May 29, 2021
9890565
Add helpful error for link with multiple children (#25657)
timneutkens May 31, 2021
89dd5c1
ESLint Config: Adds `alt` text rule for Image (#25462)
housseindjirdeh Jun 1, 2021
d5c2fe6
v10.2.4-canary.1
ijjk Jun 1, 2021
5476827
Ensure rewrites are resolved correctly through history (#25666)
ijjk Jun 1, 2021
9c3780f
Fix rewrite and dynamic params on navigating to initial history entry…
PepijnSenders Jun 1, 2021
5a5f0d0
Enable serial build by default (#25642)
timneutkens Jun 2, 2021
1cb4aaa
Don't show webpack version message in production server (#25654)
timneutkens Jun 2, 2021
58a4482
Font optimization add preconnect (#25346)
janicklas-ralph Jun 2, 2021
1ee97b3
Enable Strict Mode in new `create-next-app` projects (#25696)
devknoll Jun 2, 2021
d27cbf0
Enable new babel mode (#25635)
timneutkens Jun 2, 2021
ed3e8f7
Remove deprecated features (#25446)
timneutkens Jun 2, 2021
69b214b
Updated with-mdx-remote dynamic components example (#25366)
payapula Jun 2, 2021
7456fcf
v10.2.4-canary.2
ijjk Jun 2, 2021
aada946
up-to-date electron (#25551)
tmtk75 Jun 3, 2021
5bbcc9e
Disable split chunks in webpack 5 in dev mode (#25735)
ijjk Jun 3, 2021
b05719f
Remove experimental tag from Script component (#25435)
janicklas-ralph Jun 3, 2021
bbc28cc
`next lint` + ESLint in Create Next App (#25064)
housseindjirdeh Jun 3, 2021
9184fc9
v10.2.4-canary.3
timneutkens Jun 3, 2021
73995f6
doc: update TS version for --incremental (#25736)
hiramhuang Jun 3, 2021
3ae27a8
Bump "engines" to node >= 12.0.0 (#25761)
styfle Jun 3, 2021
9d14dd8
Update tsconfig of example to be consistent with default output of ne…
daku10 Jun 3, 2021
9b295f5
Support for static image imports (#24993)
atcastle Jun 4, 2021
dfc5907
v10.2.4-canary.4
timneutkens Jun 4, 2021
c922c6a
Replace 'require' with 'import' in bench files and update dependancie…
matamatanot Jun 4, 2021
56794c7
Remove react-relay-network-modern example. (#25815)
leerob Jun 5, 2021
5d38d06
Update ESLint docs. (#25816)
leerob Jun 5, 2021
b7cd0a1
fix mobx-state-tree-typesript missing babel/core dependency (#25589)
pelhage Jun 5, 2021
5879641
feat: bump styled-components version on examples (#25826)
Lukazovic Jun 6, 2021
8ae12db
ESLint Plugin: Fix Document and Head import rules (#25730)
housseindjirdeh Jun 7, 2021
f9fc8bc
Adding `--typescript` option (#25831)
Jun 7, 2021
a09425f
Bump minimum React version to `^17.0.2` (#25788)
devknoll Jun 7, 2021
62a4de9
Remove feature flags for static image and blurry placeholder (#25797)
atcastle Jun 7, 2021
4df4a25
v10.2.4-canary.5
timneutkens Jun 7, 2021
5be354e
Add note to upgrading guide about React version (#25849)
timneutkens Jun 7, 2021
7038b62
Fix occasional test failures (#25855)
ijjk Jun 7, 2021
5d99c09
Fix "env" key in babelrc with new Babel mode (#25841)
timneutkens Jun 7, 2021
7d02abc
feat: have .tsx be in ts template for create-next-app (#25820)
gleich Jun 7, 2021
069f7e8
Run acceptance tests non-concurrently (#25861)
ijjk Jun 7, 2021
e1502bc
Enable webpack5 for all apps (#25639)
timneutkens Jun 7, 2021
b1b3b75
Add run on Google Cloud Run button to the docker example (#25824)
geshan Jun 7, 2021
5d208e9
updated example for zustand v3.5.1 interface change (#25066)
Munawwar Jun 7, 2021
d22be5e
Fix types for static image (#25808)
ykzts Jun 7, 2021
ff1b8e9
fix: added typescript dependency in next-sitemap example (#25866)
vitalybaev Jun 7, 2021
8c63d17
v10.2.4-canary.6
ijjk Jun 8, 2021
3b76d33
Fix command in upgrade guide (#25879)
mottox2 Jun 8, 2021
0a1d418
Do not remove placeholder for data URL (#24704)
ykzts Jun 8, 2021
23ca042
v10.2.4-canary.7
timneutkens Jun 8, 2021
583b5b9
Add warning for older TypeScript versions (#25867)
ijjk Jun 8, 2021
18f8198
Prevent node inspect from causing webpack check to fail (#25876)
ijjk Jun 8, 2021
ca2921f
Update CNA build target in tsconfig (#25780)
matamatanot Jun 8, 2021
6bb037c
copy files from lbke/next-plugin-storybook-demo
eric-burel Jun 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Set default webpack publicPath value to override auto (vercel#25452)
* Set default webpack publicPath value to override auto

* Add test case

* update size-test
ijjk authored May 29, 2021
commit d84e2f58e799d9c909f44a200ac79b87cb0abedc
3 changes: 3 additions & 0 deletions packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
@@ -919,6 +919,9 @@ export default async function getBaseWebpackConfig(
},
}
: {}),
// we must set publicPath to an empty value to override the default of
// auto which doesn't work in IE11
publicPath: '',
path:
isServer && isWebpack5 && !dev
? path.join(outputPath, 'chunks')
8 changes: 4 additions & 4 deletions test/integration/build-output/test/index.test.js
Original file line number Diff line number Diff line change
@@ -123,16 +123,16 @@ describe('Build Output', () => {
)
expect(indexSize.endsWith('B')).toBe(true)

expect(parseFloat(indexFirstLoad)).toBeCloseTo(gz ? 63.6 : 195, 1)
expect(parseFloat(indexFirstLoad)).toBeCloseTo(gz ? 63.4 : 195, 1)
expect(indexFirstLoad.endsWith('kB')).toBe(true)

expect(parseFloat(err404Size)).toBeCloseTo(gz ? 3.06 : 8.15, 1)
expect(err404Size.endsWith('kB')).toBe(true)

expect(parseFloat(err404FirstLoad)).toBeCloseTo(gz ? 66.45 : 203, 1)
expect(parseFloat(err404FirstLoad)).toBeCloseTo(gz ? 66.3 : 202, 1)
expect(err404FirstLoad.endsWith('kB')).toBe(true)

expect(parseFloat(sharedByAll)).toBeCloseTo(gz ? 63.4 : 195, 1)
expect(parseFloat(sharedByAll)).toBeCloseTo(gz ? 63.2 : 194, 1)
expect(sharedByAll.endsWith('kB')).toBe(true)

const appSizeValue = _appSize.endsWith('kB')
@@ -144,7 +144,7 @@ describe('Build Output', () => {
const webpackSizeValue = webpackSize.endsWith('kB')
? parseFloat(webpackSize)
: parseFloat(webpackSize) / 1000
expect(webpackSizeValue).toBeCloseTo(gz ? 0.95 : 1.81, 2)
expect(webpackSizeValue).toBeCloseTo(gz ? 0.76 : 1.45, 2)
expect(webpackSize.endsWith('kB') || webpackSize.endsWith(' B')).toBe(
true
)
24 changes: 23 additions & 1 deletion test/integration/production/test/index.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-env jest */
/* global browserName */
import cheerio from 'cheerio'
import { existsSync } from 'fs'
import fs, { existsSync } from 'fs-extra'
import globOriginal from 'glob'
import {
nextServer,
renderViaHTTP,
@@ -24,6 +25,10 @@ import { join } from 'path'
import dynamicImportTests from './dynamic'
import processEnv from './process-env'
import security from './security'
import { promisify } from 'util'

const glob = promisify(globOriginal)

const appDir = join(__dirname, '../')
let appPort
let server
@@ -64,6 +69,23 @@ describe('Production Usage', () => {
expect(output.match(/Generating static pages/g).length).toBe(5)
})

it('should not contain currentScript usage for publicPath', async () => {
const globResult = await glob('webpack-*.js', {
cwd: join(appDir, '.next/static/chunks'),
})

if (!globResult || globResult.length !== 1) {
throw new Error('could not find webpack-hash.js chunk')
}

const content = await fs.readFile(
join(appDir, '.next/static/chunks', globResult[0]),
'utf8'
)

expect(content).not.toContain('.currentScript')
})

describe('With basic usage', () => {
it('should render the page', async () => {
const html = await renderViaHTTP(appPort, '/')