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

Experimental API support #7296

Merged
merged 5 commits into from
May 11, 2019
Merged

Experimental API support #7296

merged 5 commits into from
May 11, 2019

Conversation

huv1k
Copy link
Contributor

@huv1k huv1k commented May 10, 2019

Initial PR for #7297

This PR introduces support for pages/api. Details in #7297

Request handler looks like:

export default (req, res) => {}

@github-actions
Copy link
Contributor

Stats from current PR

Click to expand stats
zeit/next.js canary huv1k/next.js api-support Change
Build Duration 13.8s 13.6s -188ms
node_modules Size 40 MB 39.6 MB -359 kB
Total Bundle (main, webpack, commons) Size 209 kB 209 kB
Total Bundle (main, webpack, commons) gzip Size 68.3 kB 68.3 kB
Client _app Size 2.54 kB 2.54 kB
Client _app gzip Size 1.05 kB 1.05 kB
Client _error Size 8.19 kB 8.19 kB
Client _error gzip Size 3.12 kB 3.12 kB
Client pages/index Size 288 B 288 B
Client pages/index gzip Size 222 B 222 B
Client pages/link Size 4.83 kB 4.83 kB
Client pages/link gzip Size 2.11 kB 2.11 kB
Client pages/routerDirect Size 411 B 411 B
Client pages/routerDirect gzip Size 296 B 296 B
Client pages/withRouter Size 393 B 393 B
Client pages/withRouter gzip Size 280 B 280 B
Client main Size 23.3 kB 23.3 kB
Client main gzip Size 7.63 kB 7.63 kB
Client commons Size 183 kB 183 kB
Client commons gzip Size 59.4 kB 59.4 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 769 B 769 B
Base Rendered Size 1.34 kB 1.34 kB
Build Dir Size 801 kB 801 kB
Click to expand serverless stats
zeit/next.js canary huv1k/next.js api-support Change
Build Duration 14.3s 14.7s ⚠️ +370ms
node_modules Size 40 MB 39.6 MB -359 kB
Total Bundle (main, webpack, commons) Size 209 kB 209 kB
Total Bundle (main, webpack, commons) gzip Size 68.3 kB 68.3 kB ⚠️ +1 B
Client _app Size 2.54 kB 2.54 kB
Client _app gzip Size 1.05 kB 1.05 kB
Client _error Size 8.19 kB 8.19 kB
Client _error gzip Size 3.11 kB 3.12 kB ⚠️ +1 B
Client pages/index Size 288 B 288 B
Client pages/index gzip Size 222 B 222 B
Client pages/link Size 4.83 kB 4.83 kB
Client pages/link gzip Size 2.11 kB 2.11 kB
Client pages/routerDirect Size 411 B 411 B
Client pages/routerDirect gzip Size 296 B 296 B
Client pages/withRouter Size 393 B 393 B
Client pages/withRouter gzip Size 280 B 280 B
Client main Size 23.3 kB 23.3 kB
Client main gzip Size 7.63 kB 7.63 kB ⚠️ +1 B
Client commons Size 183 kB 183 kB
Client commons gzip Size 59.4 kB 59.4 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 769 B 769 B
Serverless pages/link Size 342 kB 342 kB
Serverless pages/link gzip Size 88.7 kB 88.7 kB ⚠️ +2 B
Serverless pages/index Size 333 kB 333 kB
Serverless pages/index gzip Size 86.3 kB 86.3 kB
Serverless pages/_error Size 334 kB 334 kB
Serverless pages/_error gzip Size 86.1 kB 86.1 kB
Serverless pages/routerDirect Size 333 kB 333 kB
Serverless pages/routerDirect gzip Size 86.3 kB 86.3 kB ⚠️ +1 B
Serverless pages/withRouter Size 333 kB 333 kB
Serverless pages/withRouter gzip Size 86.4 kB 86.4 kB ⚠️ +2 B
Build Dir Size 2.37 MB 2.37 MB

@github-actions
Copy link
Contributor

Stats from current PR

Click to expand stats
zeit/next.js canary huv1k/next.js api-support Change
Build Duration 14.5s 14.4s -125ms
node_modules Size 40 MB 39.6 MB -359 kB
Total Bundle (main, webpack, commons) Size 209 kB 209 kB
Total Bundle (main, webpack, commons) gzip Size 68.3 kB 68.3 kB
Client _app Size 2.54 kB 2.54 kB
Client _app gzip Size 1.05 kB 1.05 kB
Client _error Size 8.19 kB 8.19 kB
Client _error gzip Size 3.12 kB 3.12 kB
Client pages/index Size 288 B 288 B
Client pages/index gzip Size 222 B 222 B
Client pages/link Size 4.83 kB 4.83 kB
Client pages/link gzip Size 2.11 kB 2.11 kB
Client pages/routerDirect Size 411 B 411 B
Client pages/routerDirect gzip Size 296 B 296 B
Client pages/withRouter Size 393 B 393 B
Client pages/withRouter gzip Size 280 B 280 B
Client main Size 23.3 kB 23.3 kB
Client main gzip Size 7.63 kB 7.63 kB
Client commons Size 183 kB 183 kB
Client commons gzip Size 59.4 kB 59.4 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 769 B 769 B
Base Rendered Size 1.34 kB 1.34 kB
Build Dir Size 801 kB 801 kB
Click to expand serverless stats
zeit/next.js canary huv1k/next.js api-support Change
Build Duration 15.8s 15.4s -364ms
node_modules Size 40 MB 39.6 MB -359 kB
Total Bundle (main, webpack, commons) Size 209 kB 209 kB
Total Bundle (main, webpack, commons) gzip Size 68.3 kB 68.3 kB -1 B
Client _app Size 2.54 kB 2.54 kB
Client _app gzip Size 1.05 kB 1.05 kB
Client _error Size 8.19 kB 8.19 kB
Client _error gzip Size 3.12 kB 3.11 kB -1 B
Client pages/index Size 288 B 288 B
Client pages/index gzip Size 222 B 222 B
Client pages/link Size 4.83 kB 4.83 kB
Client pages/link gzip Size 2.11 kB 2.11 kB
Client pages/routerDirect Size 411 B 411 B
Client pages/routerDirect gzip Size 296 B 296 B
Client pages/withRouter Size 393 B 393 B
Client pages/withRouter gzip Size 280 B 280 B
Client main Size 23.3 kB 23.3 kB
Client main gzip Size 7.63 kB 7.63 kB -1 B
Client commons Size 183 kB 183 kB
Client commons gzip Size 59.4 kB 59.4 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 769 B 769 B
Serverless pages/link Size 342 kB 342 kB
Serverless pages/link gzip Size 88.7 kB 88.7 kB -1 B
Serverless pages/index Size 333 kB 333 kB
Serverless pages/index gzip Size 86.3 kB 86.3 kB -1 B
Serverless pages/_error Size 334 kB 334 kB
Serverless pages/_error gzip Size 86.1 kB 86.1 kB -2 B
Serverless pages/routerDirect Size 333 kB 333 kB
Serverless pages/routerDirect gzip Size 86.3 kB 86.3 kB ⚠️ +1 B
Serverless pages/withRouter Size 333 kB 333 kB
Serverless pages/withRouter gzip Size 86.4 kB 86.4 kB -5 B
Build Dir Size 2.37 MB 2.37 MB

@github-actions
Copy link
Contributor

Stats from current PR

Click to expand stats
zeit/next.js canary huv1k/next.js api-support Change
Build Duration 14.4s 14.4s ⚠️ +3ms
node_modules Size 40 MB 39.6 MB -359 kB
Total Bundle (main, webpack, commons) Size 209 kB 209 kB
Total Bundle (main, webpack, commons) gzip Size 68.3 kB 68.3 kB
Client _app Size 2.54 kB 2.54 kB
Client _app gzip Size 1.05 kB 1.05 kB
Client _error Size 8.19 kB 8.19 kB
Client _error gzip Size 3.12 kB 3.12 kB
Client pages/index Size 288 B 288 B
Client pages/index gzip Size 222 B 222 B
Client pages/link Size 4.83 kB 4.83 kB
Client pages/link gzip Size 2.11 kB 2.11 kB
Client pages/routerDirect Size 411 B 411 B
Client pages/routerDirect gzip Size 296 B 296 B
Client pages/withRouter Size 393 B 393 B
Client pages/withRouter gzip Size 280 B 280 B
Client main Size 23.3 kB 23.3 kB
Client main gzip Size 7.63 kB 7.63 kB
Client commons Size 183 kB 183 kB
Client commons gzip Size 59.4 kB 59.4 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 769 B 769 B
Base Rendered Size 1.34 kB 1.34 kB
Build Dir Size 801 kB 801 kB
Click to expand serverless stats
zeit/next.js canary huv1k/next.js api-support Change
Build Duration 15.8s 16.2s ⚠️ +424ms
node_modules Size 40 MB 39.6 MB -359 kB
Total Bundle (main, webpack, commons) Size 209 kB 209 kB
Total Bundle (main, webpack, commons) gzip Size 68.3 kB 68.3 kB
Client _app Size 2.54 kB 2.54 kB
Client _app gzip Size 1.05 kB 1.05 kB
Client _error Size 8.19 kB 8.19 kB
Client _error gzip Size 3.12 kB 3.12 kB
Client pages/index Size 288 B 288 B
Client pages/index gzip Size 222 B 222 B
Client pages/link Size 4.83 kB 4.83 kB
Client pages/link gzip Size 2.11 kB 2.11 kB
Client pages/routerDirect Size 411 B 411 B
Client pages/routerDirect gzip Size 296 B 296 B
Client pages/withRouter Size 393 B 393 B
Client pages/withRouter gzip Size 280 B 280 B
Client main Size 23.3 kB 23.3 kB
Client main gzip Size 7.63 kB 7.63 kB
Client commons Size 183 kB 183 kB
Client commons gzip Size 59.4 kB 59.4 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 769 B 769 B
Serverless pages/link Size 342 kB 342 kB
Serverless pages/link gzip Size 88.7 kB 88.7 kB ⚠️ +1 B
Serverless pages/index Size 333 kB 333 kB
Serverless pages/index gzip Size 86.3 kB 86.3 kB ⚠️ +1 B
Serverless pages/_error Size 334 kB 334 kB
Serverless pages/_error gzip Size 86.1 kB 86.1 kB
Serverless pages/routerDirect Size 333 kB 333 kB
Serverless pages/routerDirect gzip Size 86.3 kB 86.3 kB
Serverless pages/withRouter Size 333 kB 333 kB
Serverless pages/withRouter gzip Size 86.4 kB 86.4 kB ⚠️ +1 B
Build Dir Size 2.37 MB 2.37 MB

@github-actions
Copy link
Contributor

Stats from current PR

Click to expand stats
zeit/next.js canary huv1k/next.js api-support Change
Build Duration 15.9s 15.7s -127ms
node_modules Size 40 MB 39.6 MB -359 kB
Total Bundle (main, webpack, commons) Size 209 kB 209 kB
Total Bundle (main, webpack, commons) gzip Size 68.3 kB 68.3 kB
Client _app Size 2.54 kB 2.54 kB
Client _app gzip Size 1.05 kB 1.05 kB
Client _error Size 8.19 kB 8.19 kB
Client _error gzip Size 3.12 kB 3.12 kB
Client pages/index Size 288 B 288 B
Client pages/index gzip Size 222 B 222 B
Client pages/link Size 4.83 kB 4.83 kB
Client pages/link gzip Size 2.11 kB 2.11 kB
Client pages/routerDirect Size 411 B 411 B
Client pages/routerDirect gzip Size 296 B 296 B
Client pages/withRouter Size 393 B 393 B
Client pages/withRouter gzip Size 280 B 280 B
Client main Size 23.3 kB 23.3 kB
Client main gzip Size 7.63 kB 7.63 kB
Client commons Size 183 kB 183 kB
Client commons gzip Size 59.4 kB 59.4 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 769 B 769 B
Base Rendered Size 1.34 kB 1.34 kB
Build Dir Size 801 kB 801 kB
Click to expand serverless stats
zeit/next.js canary huv1k/next.js api-support Change
Build Duration 16.4s 16.5s ⚠️ +142ms
node_modules Size 40 MB 39.6 MB -359 kB
Total Bundle (main, webpack, commons) Size 209 kB 209 kB
Total Bundle (main, webpack, commons) gzip Size 68.3 kB 68.3 kB
Client _app Size 2.54 kB 2.54 kB
Client _app gzip Size 1.05 kB 1.05 kB
Client _error Size 8.19 kB 8.19 kB
Client _error gzip Size 3.12 kB 3.12 kB
Client pages/index Size 288 B 288 B
Client pages/index gzip Size 222 B 222 B
Client pages/link Size 4.83 kB 4.83 kB
Client pages/link gzip Size 2.11 kB 2.11 kB
Client pages/routerDirect Size 411 B 411 B
Client pages/routerDirect gzip Size 296 B 296 B
Client pages/withRouter Size 393 B 393 B
Client pages/withRouter gzip Size 280 B 280 B
Client main Size 23.3 kB 23.3 kB
Client main gzip Size 7.63 kB 7.63 kB
Client commons Size 183 kB 183 kB
Client commons gzip Size 59.4 kB 59.4 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 769 B 769 B
Serverless pages/link Size 342 kB 342 kB
Serverless pages/link gzip Size 88.7 kB 88.7 kB ⚠️ +1 B
Serverless pages/index Size 333 kB 333 kB
Serverless pages/index gzip Size 86.3 kB 86.3 kB -1 B
Serverless pages/_error Size 334 kB 334 kB
Serverless pages/_error gzip Size 86.1 kB 86.1 kB -2 B
Serverless pages/routerDirect Size 333 kB 333 kB
Serverless pages/routerDirect gzip Size 86.3 kB 86.3 kB
Serverless pages/withRouter Size 333 kB 333 kB
Serverless pages/withRouter gzip Size 86.4 kB 86.4 kB -1 B
Build Dir Size 2.37 MB 2.37 MB

@timneutkens timneutkens changed the title First basic API support API support May 10, 2019
@github-actions
Copy link
Contributor

Stats from current PR

Click to expand stats
zeit/next.js canary huv1k/next.js api-support Change
Build Duration 13.6s 14.9s ⚠️ +1.3s
node_modules Size 40 MB 39.6 MB -359 kB
Total Bundle (main, webpack, commons) Size 209 kB 209 kB
Total Bundle (main, webpack, commons) gzip Size 68.3 kB 68.3 kB
Client _app Size 2.54 kB 2.54 kB
Client _app gzip Size 1.05 kB 1.05 kB
Client _error Size 8.19 kB 8.19 kB
Client _error gzip Size 3.12 kB 3.12 kB
Client pages/index Size 288 B 288 B
Client pages/index gzip Size 222 B 222 B
Client pages/link Size 4.83 kB 4.83 kB
Client pages/link gzip Size 2.11 kB 2.11 kB
Client pages/routerDirect Size 411 B 411 B
Client pages/routerDirect gzip Size 296 B 296 B
Client pages/withRouter Size 393 B 393 B
Client pages/withRouter gzip Size 280 B 280 B
Client main Size 23.3 kB 23.3 kB
Client main gzip Size 7.63 kB 7.63 kB
Client commons Size 183 kB 183 kB
Client commons gzip Size 59.4 kB 59.4 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 769 B 769 B
Base Rendered Size 1.34 kB 1.34 kB
Build Dir Size 801 kB 801 kB
Click to expand serverless stats
zeit/next.js canary huv1k/next.js api-support Change
Build Duration 16s 16s ⚠️ +28ms
node_modules Size 40 MB 39.6 MB -359 kB
Total Bundle (main, webpack, commons) Size 209 kB 209 kB
Total Bundle (main, webpack, commons) gzip Size 68.3 kB 68.3 kB
Client _app Size 2.54 kB 2.54 kB
Client _app gzip Size 1.05 kB 1.05 kB
Client _error Size 8.19 kB 8.19 kB
Client _error gzip Size 3.12 kB 3.12 kB
Client pages/index Size 288 B 288 B
Client pages/index gzip Size 222 B 222 B
Client pages/link Size 4.83 kB 4.83 kB
Client pages/link gzip Size 2.11 kB 2.11 kB
Client pages/routerDirect Size 411 B 411 B
Client pages/routerDirect gzip Size 296 B 296 B
Client pages/withRouter Size 393 B 393 B
Client pages/withRouter gzip Size 280 B 280 B
Client main Size 23.3 kB 23.3 kB
Client main gzip Size 7.63 kB 7.63 kB
Client commons Size 183 kB 183 kB
Client commons gzip Size 59.4 kB 59.4 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 769 B 769 B
Serverless pages/link Size 342 kB 342 kB
Serverless pages/link gzip Size 88.7 kB 88.7 kB -1 B
Serverless pages/index Size 333 kB 333 kB
Serverless pages/index gzip Size 86.3 kB 86.3 kB
Serverless pages/_error Size 334 kB 334 kB
Serverless pages/_error gzip Size 86.1 kB 86.1 kB
Serverless pages/routerDirect Size 333 kB 333 kB
Serverless pages/routerDirect gzip Size 86.3 kB 86.3 kB ⚠️ +5 B
Serverless pages/withRouter Size 333 kB 333 kB
Serverless pages/withRouter gzip Size 86.4 kB 86.4 kB -1 B
Build Dir Size 2.37 MB 2.37 MB

@timneutkens timneutkens changed the title API support experimental API support May 11, 2019
@timneutkens timneutkens changed the title experimental API support Experimental API support May 11, 2019
Copy link
Member

@timneutkens timneutkens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still needs more work on the compilation side of things, like excluding the api files from client compilation. But it's fine as the initial implementation.

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