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

Add size-limit test #5339

Merged
merged 1 commit into from
Oct 20, 2018
Merged

Add size-limit test #5339

merged 1 commit into from
Oct 20, 2018

Conversation

HaNdTriX
Copy link
Contributor

@HaNdTriX HaNdTriX commented Sep 30, 2018

This PR adds test for checking the file size of each client bundle.

The size is calculated by add up html size & js size without gzip compression.

Run via:

yarn testonly --testPathPattern "size-limit"   

@HaNdTriX HaNdTriX force-pushed the add/size-limit branch 7 times, most recently from 9fbfdd2 to f36166d Compare September 30, 2018 17:21
@HaNdTriX HaNdTriX changed the title WIP: Add size-limit test Add size-limit test Oct 1, 2018
@HaNdTriX HaNdTriX force-pushed the add/size-limit branch 3 times, most recently from fab2ca9 to 15e4c15 Compare October 1, 2018 21:59
@HaNdTriX HaNdTriX force-pushed the add/size-limit branch 2 times, most recently from bd83149 to fc88016 Compare October 12, 2018 14:18
@timneutkens timneutkens merged commit d40f272 into vercel:canary Oct 20, 2018
timneutkens pushed a commit that referenced this pull request Dec 17, 2018
…#5857)

Resolves #4055 

Credit: #5095

I didn't use the ignore webpack plugin from the original PR and tested bundle size with #5339 - seems to be safe on that front.

Was able to get tests to pass locally, unsure of what goes wrong in CI 🤷‍♂️ 

**Questions**
1) The initial PR didn't include changes to `next-server/lib/router` in `getRouteInfo()`. Should the same changes be made within?

2) Should we add a test for rendering a component created via `forwardRef()`?

`component-with-forwardedRef`:
```javascript
export default React.forwardRef((props, ref) => <span {...props} forwardedRef={ref}>This is a component with a forwarded ref</span>);
```

some test:
```javascript
test('renders from forwardRef', async () => {
  const $ = await get$('/component-with-forwardedRef')
  const span = $('span')
  expect(span.text()).toMatch(/This is a component with a forwarded ref/)
})
```
@lock lock bot locked as resolved and limited conversation to collaborators Oct 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants