Commit graph

26 commits

Author SHA1 Message Date
Joe Haddad
6c625703ed
Dynamic Routes: Change impl from $param to [param] (#7623)
* Dynamic Routes: Change impl from $param to [param]

* Update expected test snapshot

* Update test to use new syntax

* Update test file

* Test more behavior

* Update route sorter for new param syntax

* Update dynamic routing tests

* Update danging test file

* Tweak test

* Fix dev and update tests
2019-06-20 18:27:04 -04:00
Joe Haddad
eddc852de3
Extract isDynamicRoute helper (#7622) 2019-06-20 14:41:02 -04:00
Tim Neutkens
7e7f2c0a6d
Simplify a few parts of the codebase (#7506)
* Move client-side dev JS to dev folder

* Move eventsource polyfill

* Move source-map-support

* Move error boundary

* Deprecate Container in _app

* Make initialRender check better

* Remove unused code

* Only support one subscription as there is only one

* Don’t spread object

* Shorten property name

* Add container in development too

* Simplify query update logic
2019-06-05 20:15:42 +02:00
Tim Neutkens
3e51ddb8af
Move syntax formatting to prettier (#7454)
* Run prettier over packages/**/*.js

* Run prettier over packages/**/*.ts

* Run prettier over examples

* Remove tslint

* Run prettier over examples

* Run prettier over all markdown files

* Run prettier over json files
2019-05-29 13:57:26 +02:00
Rafael Almeida
6f6f40dba7 Implement UI to show building activity (#6526)
* Initial version of build watcher working

* Move build watcher div to Main component

* Add a better design, remove container from DOM when not visible

* Fix flickering when closing and opening too fast

* Add a field on next config file for two styles and completely removal

* Ops, bring back fade-in animation

* Remove unnecessary commas

* Render building text by CSS, remove unnecessary jsx attribute

* Remove React usage

* Add support to IE/Edge

* Fix linter issues

* Set custom property with data attribute

* Use ondemand: 1 to don't override current listeners

* Use more strict rules to avoid outside CSS effects

* Use lighter box shadow

* Fix registering HMR callback

* Move initializing build watcher to client/next-dev

* Remove buildWatcherStyle and only use minimal

* Move build watcher element to render

* Move it to create element on initialize

* Fix type error from canary

* Remove extra log

* Simplify SVG markup
2019-05-27 13:59:25 -07:00
Joe Haddad
19c635175b
Make Client request BUILD_ID from the Server (#6891)
* Generate two versions of pages

* Add code VSCode deleted

* Add dynamicBuildId option to __NEXT_DATA__

* Reduce amount of diff

* Make getPageFile code easier to read

* Minimize diff

* minimize diff

* Fix default value for dynamicBuildId

* Fix weird bug

* Fetch the head build id on client

* Move __selectivePageBuilding

* Add tests

* Remove _this

* Add console warning
2019-04-04 17:54:01 -04:00
JJ Kasper
7e5e414bcb Add RouterContext in production mode (#6883) 2019-04-03 22:21:16 +02:00
Tim Neutkens
b1fdffec75
amp-bind data injection (#6840) 2019-04-02 16:09:34 +02:00
Tim Neutkens
0e39b24592
Clean up ErrorBoundary component (#6703) 2019-03-18 18:08:51 +01:00
Tim Neutkens
b41c85e32a
Remove headManager property as it’s unused (#6700)
This was leftover from before we moved to `HeadManagerContext`

Also removes `emitterProp` as it's unused in the Next.js codebase too.
2019-03-18 16:22:36 +01:00
JJ Kasper
ff7299d184 Update react-error-overlay and use reportRuntimeError (#6577)
Fixes: #5481
2019-03-08 16:24:15 +01:00
Connor Davis
fcf1167cd4 Upgrade standard and fix files (#6358)
Upgrades `standard` to major version 12
2019-02-19 22:45:07 +01:00
Sultan Tarimo
1a416b688e Load ErrorComponent dynamically (#6171)
Closes #6152.

- Only dynamically load /_error.js when an exception occurs.
- Fix websocket “/_error.js” ping oddity.
2019-01-31 20:45:36 +00:00
Tim Neutkens
6c49bee959
Make side-effect.js smaller (#6118)
Start at making side-effect.js / head.js smaller.
2019-01-25 01:39:15 +01:00
Alexander Nanberg
7e7be0e2e8 Revert #6030 (#6052)
* Revert #6030

* Fix _app childContextTypes
2019-01-14 15:41:09 +01:00
Alexander Nanberg
ff5cf6d4de Migrate next/head to use React.createContext (#6038)
Continuation of #5945
2019-01-14 01:59:26 +01:00
Alexander Nanberg
25fb3f9c2e Migrate next/router to use React.createContext (#6030)
Fixes parts of #5716. I had some issues with the test suite but I'm fairly certain that I got it working correctly.
2019-01-11 16:04:56 +01:00
Luc
fc19b233eb Replace event-emitter.js by mitt (#5987)
This PR aims at replacing next-server/lib/event-emitter.js by mitt.

Fix https://github.com/zeit/next.js/issues/4908

event-emitter.js is ~400 bytes gzipped vs mitt is 200 bytes
2019-01-04 21:49:21 +01:00
Tim Neutkens
36164ead80
Don’t bundle next/asset if it’s not used (#5971) 2018-12-31 19:05:34 +01:00
Kyle Holmberg
72e7929242 Change page export validity check on client and server in development (#5857)
Resolves #4055 

Credit: https://github.com/zeit/next.js/pull/5095

I didn't use the ignore webpack plugin from the original PR and tested bundle size with https://github.com/zeit/next.js/pull/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/)
})
```
2018-12-17 16:09:23 +01:00
Tim Neutkens
15bb1c5e79
Use Typescript to transpile Next.js core files instead of Babel (#5747)
- Replaces taskr-babel with taskr-typescript for the `next` package
- Makes sure Node 8+ is used, no unneeded transpilation
- Compile Next.js client side files through babel the same way pages are
- Compile Next.js client side files to esmodules, not commonjs, so that tree shaking works.
- Move error-debug.js out of next-server as it's only used/require in development
- Drop ansi-html as dependency from next-server
- Make next/link esmodule (for tree-shaking)
- Make next/router esmodule (for tree-shaking)
- add typescript compilation to next-server
- Remove last remains of Flow
- Move hoist-non-react-statics to next, out of next-server
- Move htmlescape to next, out of next-server
- Remove runtime-corejs2 from next-server
2018-11-28 15:03:02 +01:00
Tim Neutkens
b65c464d60
Move __NEXT_DATA__ into an application/json script tag (#5584)
* Move __NEXT_DATA__ into a application/json script tag

As outlined by @dav-is here https://github.com/zeit/next.js/pull/4943

* Set __NEXT_DATA__ for backwards compatability
2018-11-03 19:49:09 +01:00
Tim Neutkens
a2553bb46e
Remove registration code from initial markup (#5583)
Clears the way a bit for #4943, also makes _document.js less complex, and will allow us to move `__NEXT_DATA__` to a `application/json` script tag.

Also this causes a slightly smaller bundle size 😌
2018-11-03 01:59:54 +01:00
Tim Neutkens
965f50beb2
Remove pathname (#5424) 2018-10-10 21:58:15 +02:00
Tim Neutkens
82d56e063a
next-server (#5357) 2018-10-02 00:55:31 +02:00
Tim Neutkens
b1c4f3aec4
Monorepo (#5341)
- Implements Lerna
- Moves all source code into `packages/next`
- Keeps integration tests in the root directory
2018-10-01 01:02:10 +02:00
Renamed from client/index.js (Browse further)