-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding bottleneck vanilla test sites: number of elements, middleware,…
… and number of data requests
- Loading branch information
Showing
12 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/react-server-test-pages/pages/bottleneck/colors/blue.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$blueish: blue; | ||
|
||
.blue-thing { | ||
background-color: $blueish; | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/react-server-test-pages/pages/bottleneck/colors/green.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$greenish: green; | ||
|
||
.green-thing { | ||
background-color: $greenish; | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/react-server-test-pages/pages/bottleneck/colors/indigo.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$indigoish: indigo; | ||
|
||
.indigo-thing { | ||
background-color: $indigoish; | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/react-server-test-pages/pages/bottleneck/colors/orange.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$orangeish: orange; | ||
|
||
.orange-thing { | ||
background-color: $orangeish; | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/react-server-test-pages/pages/bottleneck/colors/purple.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$purpleish: purple; | ||
|
||
.purple-thing { | ||
background-color: $purpleish; | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/react-server-test-pages/pages/bottleneck/colors/red.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$reddish: red; | ||
|
||
.red-thing { | ||
background-color: $reddish; | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/react-server-test-pages/pages/bottleneck/colors/white.sass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
$whiteish: white | ||
|
||
.white-thing | ||
background-color: $whiteish |
5 changes: 5 additions & 0 deletions
5
packages/react-server-test-pages/pages/bottleneck/colors/yellow.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$yellowish: yellow; | ||
|
||
.yellow-thing { | ||
background-color: $yellowish; | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/react-server-test-pages/pages/bottleneck/dataRequests.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {ReactServerAgent} from "react-server"; | ||
|
||
export default class DataRequestsPage { | ||
|
||
getElements() { | ||
//Perform 1 million data requests before returning | ||
for (var i = 0; i < 999999; i++) { | ||
ReactServerAgent.get('/data/delay'); | ||
} | ||
return (<div>Data requests complete!</div>); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
packages/react-server-test-pages/pages/bottleneck/elements.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import "./colors/red.scss"; | ||
import "./colors/blue.scss"; | ||
import "./colors/purple.scss"; | ||
import "./colors/green.scss"; | ||
import "./colors/orange.scss"; | ||
import "./colors/indigo.scss"; | ||
import "./colors/yellow.scss"; | ||
|
||
const RedThing = () => <div className="red-thing">This should be red</div>; | ||
const BlueThing = () => <div className="blue-thing">This should be blue</div>; | ||
const PurpleThing = () => <div className="purple-thing">This should be purple</div>; | ||
const GreenThing = () => <div className="green-thing">This should be green</div>; | ||
const OrangeThing = () => <div className="orange-thing">This should be orange</div>; | ||
const IndigoThing = () => <div className="indigo-thing">This should be indigo</div>; | ||
const YellowThing = () => <div className="yellow-thing">This should be yellow</div>; | ||
const ColorWheel = [RedThing(), BlueThing(), PurpleThing(), GreenThing(), | ||
OrangeThing(), IndigoThing(), YellowThing()]; | ||
|
||
export default class ElementsPage { | ||
|
||
getElements() { | ||
|
||
const colorThings = []; | ||
for (var i = 0; i < 99999; i++) { | ||
let selection = Math.floor(Math.random() * 7); | ||
colorThings.push(ColorWheel[selection]); | ||
}; | ||
|
||
return (<div> | ||
{colorThings} | ||
</div>); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
packages/react-server-test-pages/pages/bottleneck/middleware.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import JsonResponseMiddleware from "react-server-middleware-json-response" | ||
|
||
|
||
export default class MiddlewarePage { | ||
|
||
static middleware() { | ||
return [JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, | ||
JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware, JsonResponseMiddleware]; | ||
} | ||
|
||
getResponseData() { | ||
return; | ||
} | ||
} |