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 A/B Tests and Feature Flags example #13629

Merged
merged 9 commits into from
Jun 21, 2020
Merged

Conversation

andresz1
Copy link
Contributor

@andresz1 andresz1 commented Jun 1, 2020

Summary

This PR adds a basic example of how Tesfy could be integrated with Next.js. Tesfy is a project that I've working on during quarantine weekends, mainly to learn new stuff and provide free and unlimited A/B Tests and Feature Flags while keeping a good performance and the library size as small as possible.

The configuration file could be set up using a web application (hosted in Vercel 🎉 ) or by your self.

Implementation

  • Created with-tesfy folder
  • Added two pages index.js and features.js to show how experiments and features could be used
  • The only thing that must be persisted is the userId. Used a cookie to save it.
  • Uses getServerSideProps to fetch the configuration file and get/create the userId.

Screenshots

There are some screenshots from the web application. Where you can easily configure experiments and audiences per project. Teams and features will soon be added.

Screenshot 2020-06-01 at 15 40 49
Screenshot 2020-06-01 at 15 41 02
Screenshot 2020-06-01 at 15 41 11

This is my first PR! sorry if I made something wrong 😞 . Any feedback is more than welcome. Also I want to thank you all for the awesome work with Next.js ❤️

@andresz1 andresz1 requested review from lfades and Timer as code owners June 1, 2020 13:46
@andresz1 andresz1 changed the title Add Tesfy example - A/B Tests and Feature Flags Add A/B Tests and Feature Flags example Jun 1, 2020
@andresz1 andresz1 changed the title Add A/B Tests and Feature Flags example Add A/B Tests and Feature Flags example - Tesfy Jun 1, 2020
@andresz1 andresz1 changed the title Add A/B Tests and Feature Flags example - Tesfy Add A/B Tests and Feature Flags example using Tesfy Jun 1, 2020
@andresz1 andresz1 changed the title Add A/B Tests and Feature Flags example using Tesfy Add A/B Tests and Feature Flags example Jun 1, 2020
@rafaelalmeidatk rafaelalmeidatk added the examples Issue was opened via the examples template. label Jun 3, 2020
@ijjk
Copy link
Member

ijjk commented Jun 3, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General
vercel/next.js canary andresz1/next.js canary Change
buildDuration 11.6s 11.8s ⚠️ +217ms
nodeModulesSize 66 MB 66 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary andresz1/next.js canary Change
/ failed reqs 0 0
/ total time (seconds) 2.098 2.106 ⚠️ +0.01
/ avg req/sec 1191.68 1187.23 -4.45
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.381 1.485 ⚠️ +0.1
/error-in-render avg req/sec 1809.66 1683.13 -126.53
Client Bundles (main, webpack, commons)
vercel/next.js canary andresz1/next.js canary Change
main-HASH.js gzip 6.59 kB 6.59 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..6c2a.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57 kB 57 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary andresz1/next.js canary Change
main-HASH.module.js gzip 5.67 kB 5.67 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary andresz1/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary andresz1/next.js canary Change
_app.js gzip 1.26 kB 1.26 kB
_error.js gzip 3.25 kB 3.25 kB
hooks.js gzip 881 B 881 B
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 8.21 kB 8.21 kB
Client Pages Modern
vercel/next.js canary andresz1/next.js canary Change
_app.module.js gzip 604 B 604 B
_error.module.js gzip 2.04 kB 2.04 kB
hooks.module.js gzip 383 B 383 B
index.module.js gzip 223 B 223 B
link.module.js gzip 1.51 kB 1.51 kB
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
Overall change 5.32 kB 5.32 kB
Client Build Manifests
vercel/next.js canary andresz1/next.js canary Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Rendered Page Sizes
vercel/next.js canary andresz1/next.js canary Change
index.html gzip 924 B 924 B
link.html gzip 934 B 934 B
withRouter.html gzip 922 B 922 B
Overall change 2.78 kB 2.78 kB

Serverless Mode
General
vercel/next.js canary andresz1/next.js canary Change
buildDuration 12.9s 13s ⚠️ +62ms
nodeModulesSize 66 MB 66 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary andresz1/next.js canary Change
main-HASH.js gzip 6.59 kB 6.59 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..6c2a.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57 kB 57 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary andresz1/next.js canary Change
main-HASH.module.js gzip 5.67 kB 5.67 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.93 kB 6.93 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.5 kB 52.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary andresz1/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary andresz1/next.js canary Change
_app.js gzip 1.26 kB 1.26 kB
_error.js gzip 3.25 kB 3.25 kB
hooks.js gzip 881 B 881 B
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 8.21 kB 8.21 kB
Client Pages Modern
vercel/next.js canary andresz1/next.js canary Change
_app.module.js gzip 604 B 604 B
_error.module.js gzip 2.04 kB 2.04 kB
hooks.module.js gzip 383 B 383 B
index.module.js gzip 223 B 223 B
link.module.js gzip 1.51 kB 1.51 kB
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
Overall change 5.32 kB 5.32 kB
Client Build Manifests
vercel/next.js canary andresz1/next.js canary Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Serverless bundles
vercel/next.js canary andresz1/next.js canary Change
_error.js 878 kB 878 kB
404.html 4.18 kB 4.18 kB
hooks.html 3.81 kB 3.81 kB
index.js 879 kB 879 kB
link.js 916 kB 916 kB
routerDirect.js 909 kB 909 kB
withRouter.js 909 kB 909 kB
Overall change 4.5 MB 4.5 MB

@ijjk
Copy link
Member

ijjk commented Jun 9, 2020

Failing test suites

test/integration/export-serverless/test/index.test.js

  • Static Export > should delete existing exported files
  • Static Export > API routes export > Should throw if a route is matched
  • Static Export > Dynamic routes export > Should throw error not matched route
  • Static Export > ExportPathMap's query in development mode > should be present in ctx.query
  • Static Export > ExportPathMap's query in development mode > should replace url query params in ctx.query when conflicting
  • Static Export > ExportPathMap's query in development mode > should be merged with url query params in ctx.query
  • Static Export > Render in development mode > should render the home page
  • Static Export > Render in development mode > should render pages only existent in exportPathMap page
  • Static Export > Render via SSR > should render the home page
  • Static Export > Render via SSR > should render the about page
  • Static Export > Render via SSR > should render links correctly
  • Static Export > Render via SSR > should render a page with getInitialProps
  • Static Export > Render via SSR > should render a dynamically rendered custom url page
  • Static Export > Render via SSR > should render pages with dynamic imports
  • Static Export > Render via SSR > should render paths with extensions
  • Static Export > Render via SSR > should give empty object for query if there is no query
  • Static Export > Render via SSR > should render _error on 404.html even if not provided in exportPathMap
  • Static Export > Render via SSR > should render _error on /404/index.html
  • Static Export > Render via SSR > Should serve static files
  • Static Export > Render via SSR > Should serve public files
  • Static Export > Render via SSR > Should render dynamic files with query
  • Static Export > Render via browser > should render the home page
  • Static Export > Render via browser > should add trailing slash on Link
  • Static Export > Render via browser > should not add trailing slash on Link when disabled
  • Static Export > Render via browser > should do navigations via Link
  • Static Export > Render via browser > should do navigations via Router
  • Static Export > Render via browser > should do run client side javascript
  • Static Export > Render via browser > should render pages using getInitialProps
  • Static Export > Render via browser > should render dynamic pages with custom urls
  • Static Export > Render via browser > should support client side naviagtion
  • Static Export > Render via browser > should render dynamic import components in the client
  • Static Export > Render via browser > should render pages with url hash correctly
  • Static Export > Render via browser > should navigate even if used a button inside
  • Static Export > Render via browser > should update query after mount
  • Static Export > Render via browser > pages in the nested level: level1 > should render the home page
  • Static Export > Render via browser > pages in the nested level: level1 > should render the about page
Expand output

● Static Export › should delete existing exported files

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should render the home page

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should render the about page

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should render links correctly

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should render a page with getInitialProps

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should render a dynamically rendered custom url page

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should render pages with dynamic imports

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should render paths with extensions

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should give empty object for query if there is no query

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should render _error on 404.html even if not provided in exportPathMap

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should render _error on /404/index.html

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › Should serve static files

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › Should serve public files

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › Should render dynamic files with query

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should render the home page

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should add trailing slash on Link

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should not add trailing slash on Link when disabled

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should do navigations via Link

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should do navigations via Router

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should do run client side javascript

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should render pages using getInitialProps

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should render dynamic pages with custom urls

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should support client side naviagtion

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should render dynamic import components in the client

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should render pages with url hash correctly

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should navigate even if used a button inside

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should update query after mount

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › pages in the nested level: level1 › should render the home page

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › pages in the nested level: level1 › should render the about page

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render in development mode › should render the home page

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render in development mode › should render pages only existent in exportPathMap page

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › ExportPathMap's query in development mode › should be present in ctx.query

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › ExportPathMap's query in development mode › should replace url query params in ctx.query when conflicting

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › ExportPathMap's query in development mode › should be merged with url query params in ctx.query

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Dynamic routes export › Should throw error not matched route

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › API routes export › Should throw if a route is matched

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Test suite failed to run

TypeError: Cannot read property '__app' of undefined

  306 | 
  307 | export async function stopApp(server) {
> 308 |   if (server.__app) {
      |              ^
  309 |     await server.__app.close()
  310 |   }
  311 |   await promiseCall(server, 'close')

  at stopApp (lib/next-test-utils.js:308:14)
  at integration/export-serverless/test/index.test.js:87:7

test/integration/export/test/index.test.js

  • Static Export > should delete existing exported files
  • Static Export > should honor exportTrailingSlash for 404 page
  • Static Export > should only output 404.html without exportTrailingSlash
  • Static Export > should not duplicate /index with exportTrailingSlash
  • Static Export > API routes export > Should throw if a route is matched
  • Static Export > Dynamic routes export > Should throw error not matched route
  • Static Export > ExportPathMap's query in development mode > should be present in ctx.query
  • Static Export > ExportPathMap's query in development mode > should replace url query params in ctx.query when conflicting
  • Static Export > ExportPathMap's query in development mode > should be merged with url query params in ctx.query
  • Static Export > Render in development mode > should render the home page
  • Static Export > Render in development mode > should render pages only existent in exportPathMap page
  • Static Export > Render via SSR > should render the home page
  • Static Export > Render via SSR > should render the about page
  • Static Export > Render via SSR > should render links correctly
  • Static Export > Render via SSR > should render a page with getInitialProps
  • Static Export > Render via SSR > should render a dynamically rendered custom url page
  • Static Export > Render via SSR > should render pages with dynamic imports
  • Static Export > Render via SSR > should render paths with extensions
  • Static Export > Render via SSR > should give empty object for query if there is no query
  • Static Export > Render via SSR > should render _error on 404.html even if not provided in exportPathMap
  • Static Export > Render via SSR > should render _error on /404/index.html
  • Static Export > Render via SSR > Should serve static files
  • Static Export > Render via SSR > Should serve public files
  • Static Export > Render via SSR > Should render dynamic files with query
  • Static Export > Render via browser > should render the home page
  • Static Export > Render via browser > should add trailing slash on Link
  • Static Export > Render via browser > should not add any slash on hash Link
  • Static Export > Render via browser > should preserve hash symbol on empty hash Link
  • Static Export > Render via browser > should preserve question mark on empty query Link
  • Static Export > Render via browser > should not add trailing slash on Link when disabled
  • Static Export > Render via browser > should do navigations via Link
  • Static Export > Render via browser > should do navigations via Router
  • Static Export > Render via browser > should do run client side javascript
  • Static Export > Render via browser > should render pages using getInitialProps
  • Static Export > Render via browser > should render dynamic pages with custom urls
  • Static Export > Render via browser > should support client side naviagtion
  • Static Export > Render via browser > should render dynamic import components in the client
  • Static Export > Render via browser > should render pages with url hash correctly
  • Static Export > Render via browser > should navigate even if used a button inside
  • Static Export > Render via browser > should update query after mount
  • Static Export > Render via browser > pages in the nested level: level1 > should render the home page
  • Static Export > Render via browser > pages in the nested level: level1 > should render the about page
Expand output

● Static Export › should delete existing exported files

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › should honor exportTrailingSlash for 404 page

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › should only output 404.html without exportTrailingSlash

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › should not duplicate /index with exportTrailingSlash

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should render the home page

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should render the about page

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should render links correctly

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should render a page with getInitialProps

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should render a dynamically rendered custom url page

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should render pages with dynamic imports

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should render paths with extensions

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should give empty object for query if there is no query

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should render _error on 404.html even if not provided in exportPathMap

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › should render _error on /404/index.html

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › Should serve static files

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › Should serve public files

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via SSR › Should render dynamic files with query

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should render the home page

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should add trailing slash on Link

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should not add any slash on hash Link

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should preserve hash symbol on empty hash Link

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should preserve question mark on empty query Link

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should not add trailing slash on Link when disabled

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should do navigations via Link

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should do navigations via Router

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should do run client side javascript

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should render pages using getInitialProps

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should render dynamic pages with custom urls

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should support client side naviagtion

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should render dynamic import components in the client

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should render pages with url hash correctly

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should navigate even if used a button inside

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › should update query after mount

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › pages in the nested level: level1 › should render the home page

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render via browser › pages in the nested level: level1 › should render the about page

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render in development mode › should render the home page

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Render in development mode › should render pages only existent in exportPathMap page

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › ExportPathMap's query in development mode › should be present in ctx.query

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › ExportPathMap's query in development mode › should replace url query params in ctx.query when conflicting

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › ExportPathMap's query in development mode › should be merged with url query params in ctx.query

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › Dynamic routes export › Should throw error not matched route

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Static Export › API routes export › Should throw if a route is matched

command failed with code 1

  133 |         code !== 0
  134 |       ) {
> 135 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  136 |       }
  137 | 
  138 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:135:23)

● Test suite failed to run

TypeError: Cannot read property '__app' of undefined

  306 | 
  307 | export async function stopApp(server) {
> 308 |   if (server.__app) {
      |              ^
  309 |     await server.__app.close()
  310 |   }
  311 |   await promiseCall(server, 'close')

  at stopApp (lib/next-test-utils.js:308:14)
  at integration/export/test/index.test.js:85:7

@ijjk
Copy link
Member

ijjk commented Jun 9, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary timneutkens/next.js canary Change
buildDuration 13.4s 13.3s -126ms
nodeModulesSize 64.9 MB 64.9 MB -356 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary timneutkens/next.js canary Change
/ failed reqs 0 0
/ total time (seconds) 2.302 2.313 ⚠️ +0.01
/ avg req/sec 1085.83 1080.99 -4.84
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.51 1.523 ⚠️ +0.01
/error-in-render avg req/sec 1655.11 1641.43 -13.68
Client Bundles (main, webpack, commons)
vercel/next.js canary timneutkens/next.js canary Change
main-HASH.js gzip 6.49 kB 6.49 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..ec24.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary timneutkens/next.js canary Change
main-HASH.module.js gzip 5.58 kB 5.58 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary timneutkens/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary timneutkens/next.js canary Change
_app.js gzip 1.26 kB 1.26 kB
_error.js gzip 3.25 kB 3.25 kB
hooks.js gzip 881 B 881 B
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 8.22 kB 8.22 kB
Client Pages Modern
vercel/next.js canary timneutkens/next.js canary Change
_app.module.js gzip 604 B 604 B
_error.module.js gzip 2.04 kB 2.04 kB
hooks.module.js gzip 383 B 383 B
index.module.js gzip 223 B 223 B
link.module.js gzip 1.52 kB 1.52 kB
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
Overall change 5.33 kB 5.33 kB
Client Build Manifests
vercel/next.js canary timneutkens/next.js canary Change
_buildManifest.js gzip 171 B 171 B
_buildManife..dule.js gzip 180 B 180 B
Overall change 351 B 351 B
Rendered Page Sizes
vercel/next.js canary timneutkens/next.js canary Change
index.html gzip 901 B 901 B
link.html gzip 906 B 906 B
withRouter.html gzip 894 B 894 B
Overall change 2.7 kB 2.7 kB

Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary timneutkens/next.js canary Change
buildDuration 14.4s 14.3s -80ms
nodeModulesSize 64.9 MB 64.9 MB -356 B
Client Bundles (main, webpack, commons)
vercel/next.js canary timneutkens/next.js canary Change
main-HASH.js gzip 6.49 kB 6.49 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..ec24.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary timneutkens/next.js canary Change
main-HASH.module.js gzip 5.58 kB 5.58 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary timneutkens/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary timneutkens/next.js canary Change
_app.js gzip 1.26 kB 1.26 kB
_error.js gzip 3.25 kB 3.25 kB
hooks.js gzip 881 B 881 B
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 8.22 kB 8.22 kB
Client Pages Modern
vercel/next.js canary timneutkens/next.js canary Change
_app.module.js gzip 604 B 604 B
_error.module.js gzip 2.04 kB 2.04 kB
hooks.module.js gzip 383 B 383 B
index.module.js gzip 223 B 223 B
link.module.js gzip 1.52 kB 1.52 kB
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
Overall change 5.33 kB 5.33 kB
Client Build Manifests
vercel/next.js canary timneutkens/next.js canary Change
_buildManifest.js gzip 171 B 171 B
_buildManife..dule.js gzip 180 B 180 B
Overall change 351 B 351 B
Serverless bundles
vercel/next.js canary timneutkens/next.js canary Change
_error.js 874 kB 874 kB
404.html 4.13 kB 4.13 kB
hooks.html 3.71 kB 3.71 kB
index.js 875 kB 875 kB
link.js 913 kB 913 kB
routerDirect.js 905 kB 905 kB
withRouter.js 905 kB 905 kB
Overall change 4.48 MB 4.48 MB

@ijjk
Copy link
Member

ijjk commented Jun 9, 2020

Failing test suites

test/integration/css/test/index.test.js

  • CSS Support > Ordering with Global CSS and Modules (dev) > should have the correct color (css ordering)
Expand output

● CSS Support › Ordering with Global CSS and Modules (dev) › should have the correct color (css ordering)

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `CSS Support Ordering with Global CSS and Modules (dev) should have the correct color (css ordering) 1`

Snapshot: "rgb(0, 0, 255)"
Received: "rgb(255, 0, 0)"

  824 |         `window.getComputedStyle(document.querySelector('#blueText')).color`
  825 |       )
> 826 |       expect(currentColor).toMatchInlineSnapshot(`"rgb(0, 0, 255)"`)
      |                            ^
  827 |     })
  828 | 
  829 |     it('should have the correct color (css ordering) during hot reloads', async () => {

  at Object.<anonymous> (integration/css/test/index.test.js:826:28)
      at runMicrotasks (<anonymous>)

@lfades lfades self-assigned this Jun 10, 2020
Copy link
Member

@lfades lfades left a comment

Choose a reason for hiding this comment

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

@andresz1 Hi there, thank you for the PR, I'm very resilient about adding examples using SSR with getInitialProps, you can read why in #11014

Having that said, I don't see how can A/B testing in this example work with SSG, which would be great, but not currently possible. For the moment let's switch from adding getInitialProps in _app and use getServerSideProps in the pages instead. That way static pages without A/B testing can still be static, and server code will only be needed for the server build.

@andresz1
Copy link
Contributor Author

Hi @lfades thank you so much for the review! I'll do the changes and let you know 😉

@andresz1
Copy link
Contributor Author

@lfades changes made! when you have time take a look and let me know 🙏 Thank you so much

@ijjk
Copy link
Member

ijjk commented Jun 20, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary andresz1/next.js canary Change
buildDuration 10.6s 10.7s ⚠️ +108ms
nodeModulesSize 67 MB 67 MB
Page Load Tests Overall increase ✓
vercel/next.js canary andresz1/next.js canary Change
/ failed reqs 0 0
/ total time (seconds) 1.839 1.808 -0.03
/ avg req/sec 1359.29 1382.93 ⚠️ +23.64
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.126 1.093 -0.03
/error-in-render avg req/sec 2219.5 2287.64 ⚠️ +68.14
Client Bundles (main, webpack, commons)
vercel/next.js canary andresz1/next.js canary Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..75a9.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary andresz1/next.js canary Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary andresz1/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary andresz1/next.js canary Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary andresz1/next.js canary Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary andresz1/next.js canary Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Rendered Page Sizes
vercel/next.js canary andresz1/next.js canary Change
index.html gzip 955 B 955 B
link.html gzip 961 B 961 B
withRouter.html gzip 948 B 948 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General
vercel/next.js canary andresz1/next.js canary Change
buildDuration 11.8s 11.6s -288ms
nodeModulesSize 67 MB 67 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary andresz1/next.js canary Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..75a9.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary andresz1/next.js canary Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary andresz1/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary andresz1/next.js canary Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary andresz1/next.js canary Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary andresz1/next.js canary Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Serverless bundles
vercel/next.js canary andresz1/next.js canary Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 914 kB 914 kB
routerDirect.js 906 kB 906 kB
withRouter.js 906 kB 906 kB
Overall change 4.48 MB 4.48 MB
Commit: 68af484

@ijjk
Copy link
Member

ijjk commented Jun 20, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary andresz1/next.js canary Change
buildDuration 12.4s 12.3s -71ms
nodeModulesSize 67 MB 67 MB
Page Load Tests Overall increase ✓
vercel/next.js canary andresz1/next.js canary Change
/ failed reqs 0 0
/ total time (seconds) 2.079 2.026 -0.05
/ avg req/sec 1202.23 1233.75 ⚠️ +31.52
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.305 1.31 ⚠️ +0.01
/error-in-render avg req/sec 1916.33 1908.25 -8.08
Client Bundles (main, webpack, commons)
vercel/next.js canary andresz1/next.js canary Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..75a9.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary andresz1/next.js canary Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary andresz1/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary andresz1/next.js canary Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary andresz1/next.js canary Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary andresz1/next.js canary Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Rendered Page Sizes
vercel/next.js canary andresz1/next.js canary Change
index.html gzip 955 B 955 B
link.html gzip 961 B 961 B
withRouter.html gzip 948 B 948 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General
vercel/next.js canary andresz1/next.js canary Change
buildDuration 13.3s 13.1s -195ms
nodeModulesSize 67 MB 67 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary andresz1/next.js canary Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..75a9.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary andresz1/next.js canary Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary andresz1/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
vercel/next.js canary andresz1/next.js canary Change
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
_error.js gzip 3.37 kB 3.37 kB
index.js gzip 222 B 222 B
link.js gzip 2.05 kB 2.05 kB
hooks.js gzip 881 B 881 B
_app.js gzip 1.26 kB 1.26 kB
Overall change 8.34 kB 8.34 kB
Client Pages Modern
vercel/next.js canary andresz1/next.js canary Change
index.module.js gzip 223 B 223 B
routerDirect..dule.js gzip 281 B 281 B
withRouter.m..dule.js gzip 278 B 278 B
hooks.module.js gzip 383 B 383 B
_error.module.js gzip 2.21 kB 2.21 kB
link.module.js gzip 1.52 kB 1.52 kB
_app.module.js gzip 604 B 604 B
Overall change 5.49 kB 5.49 kB
Client Build Manifests
vercel/next.js canary andresz1/next.js canary Change
_buildManifest.js gzip 270 B 270 B
_buildManife..dule.js gzip 274 B 274 B
Overall change 544 B 544 B
Serverless bundles
vercel/next.js canary andresz1/next.js canary Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 914 kB 914 kB
routerDirect.js 906 kB 906 kB
withRouter.js 906 kB 906 kB
Overall change 4.48 MB 4.48 MB
Commit: 6a93b3f

lfades
lfades previously approved these changes Jun 21, 2020
Copy link
Member

@lfades lfades left a comment

Choose a reason for hiding this comment

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

@andresz1 Thank you!, I did a minor change to use npx in this example and in other examples that were missing the change too 😅

@ijjk
Copy link
Member

ijjk commented Jun 21, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary andresz1/next.js canary Change
buildDuration 11.9s 11.9s ⚠️ +27ms
nodeModulesSize 67 MB 67 MB
Page Load Tests Overall increase ✓
vercel/next.js canary andresz1/next.js canary Change
/ failed reqs 0 0
/ total time (seconds) 1.956 1.947 -0.01
/ avg req/sec 1278.04 1283.8 ⚠️ +5.76
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.211 1.157 -0.05
/error-in-render avg req/sec 2064.29 2161.68 ⚠️ +97.39
Client Bundles (main, webpack, commons)
vercel/next.js canary andresz1/next.js canary Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..75a9.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary andresz1/next.js canary Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary andresz1/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary andresz1/next.js canary Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Rendered Page Sizes
vercel/next.js canary andresz1/next.js canary Change
index.html gzip 954 B 954 B
link.html gzip 959 B 959 B
withRouter.html gzip 947 B 947 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General
vercel/next.js canary andresz1/next.js canary Change
buildDuration 12.8s 12.8s -15ms
nodeModulesSize 67 MB 67 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary andresz1/next.js canary Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..75a9.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary andresz1/next.js canary Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary andresz1/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary andresz1/next.js canary Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Serverless bundles
vercel/next.js canary andresz1/next.js canary Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 914 kB 914 kB
routerDirect.js 906 kB 906 kB
withRouter.js 906 kB 906 kB
Overall change 4.48 MB 4.48 MB
Commit: a08c65b

@ijjk
Copy link
Member

ijjk commented Jun 21, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary andresz1/next.js canary Change
buildDuration 10.7s 10.5s -246ms
nodeModulesSize 67 MB 67 MB
Page Load Tests Overall increase ✓
vercel/next.js canary andresz1/next.js canary Change
/ failed reqs 0 0
/ total time (seconds) 1.756 1.806 ⚠️ +0.05
/ avg req/sec 1424 1384.18 -39.82
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.104 1.074 -0.03
/error-in-render avg req/sec 2264.4 2328.26 ⚠️ +63.86
Client Bundles (main, webpack, commons)
vercel/next.js canary andresz1/next.js canary Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..75a9.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary andresz1/next.js canary Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary andresz1/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary andresz1/next.js canary Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Rendered Page Sizes
vercel/next.js canary andresz1/next.js canary Change
index.html gzip 954 B 954 B
link.html gzip 959 B 959 B
withRouter.html gzip 947 B 947 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General
vercel/next.js canary andresz1/next.js canary Change
buildDuration 11s 11.2s ⚠️ +221ms
nodeModulesSize 67 MB 67 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary andresz1/next.js canary Change
main-HASH.js gzip 6.51 kB 6.51 kB
webpack-HASH.js gzip 746 B 746 B
19b7e98f51cc..75a9.js gzip 10.5 kB 10.5 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.9 kB 56.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary andresz1/next.js canary Change
main-HASH.module.js gzip 5.6 kB 5.6 kB
webpack-HASH..dule.js gzip 746 B 746 B
19b7e98f51cc..dule.js gzip 6.92 kB 6.92 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.4 kB 52.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary andresz1/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Build Manifests
vercel/next.js canary andresz1/next.js canary Change
_buildManifest.js gzip 267 B 267 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 539 B 539 B
Serverless bundles
vercel/next.js canary andresz1/next.js canary Change
_error.js 875 kB 875 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 875 kB 875 kB
link.js 914 kB 914 kB
routerDirect.js 906 kB 906 kB
withRouter.js 906 kB 906 kB
Overall change 4.48 MB 4.48 MB
Commit: 4001896

@andresz1
Copy link
Contributor Author

andresz1 commented Jun 21, 2020

Hi @lfades thank you so much for the quick review and the npx change. Oops! sorry I just forgot to fix a small linting issue 😔 . Now all test are passing 🙌

@kodiakhq kodiakhq bot merged commit 6424e1f into vercel:canary Jun 21, 2020
rokinsky pushed a commit to rokinsky/next.js that referenced this pull request Jul 11, 2020
## Summary
This PR adds a basic example of how [Tesfy](https://tesfy.io/) could be integrated with Next.js. Tesfy is a project that I've working on during quarantine weekends, mainly to learn new stuff and provide **free** and **unlimited** A/B Tests and Feature Flags while keeping a good performance and the library [size](https://bundlephobia.com/[email protected]) as small as possible.

The configuration file could be set up using a [web application](https://app.tesfy.io/) (hosted in Vercel 🎉 ) or by your self.

## Implementation
- Created `with-tesfy` folder
- Added two pages `index.js` and `features.js` to show how experiments and features could be used
- The only thing that must be persisted is the `userId`. Used a cookie to save it.
- Uses `getServerSideProps` to fetch the configuration file and get/create the `userId`.

## Screenshots

There are some screenshots from the web application. Where you can easily configure experiments and audiences per project. Teams and features will soon be added.

![Screenshot 2020-06-01 at 15 40 49](https://user-images.githubusercontent.com/6877967/83414811-60e7ce80-a41e-11ea-9e5c-887c66e80c65.png)
![Screenshot 2020-06-01 at 15 41 02](https://user-images.githubusercontent.com/6877967/83414823-66451900-a41e-11ea-885b-b58e78b042bb.png)
![Screenshot 2020-06-01 at 15 41 11](https://user-images.githubusercontent.com/6877967/83414828-6a713680-a41e-11ea-90a8-8d39a17f19a1.png)

This is my first PR! sorry if I made something wrong 😞 . Any feedback is more than welcome. Also I want to thank you all for the awesome work with Next.js ❤️
@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue was opened via the examples template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants