Skip to content

Commit

Permalink
feat(bench): Add pre/post merge results
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonseydel committed Sep 9, 2019
1 parent 2d31b7f commit 78c3467
Show file tree
Hide file tree
Showing 98 changed files with 1,226 additions and 932 deletions.
2 changes: 1 addition & 1 deletion test/js-framework-benchmark/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ RUN bash /root/install_rust.sh

# RUN npm install
EXPOSE 8080
CMD ["/server/node_modules/.bin/http-server","-c-1","/build"]
CMD ["/server/node_modules/.bin/local-web-server","/build"]
10 changes: 5 additions & 5 deletions test/js-framework-benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ javac 1.8.0_131
As stated above building and running the benchmarks for all frameworks can be challenging, thus we start step by step...

Install global dependencies
This installs just a few top level dependencies for the building the frameworks and a http-server.
This installs just a few top level dependencies for the building the frameworks and a local-web-server.
```
npm install
```
We start the http-server in the root directory
We start the local-web-server in the root directory
```
npm start
```
Verify that the http-server works:
Verify that the local-web-server works:
Try to open [http://localhost:8080/index.html](http://localhost:8080/index.html). If you see something like that you're on the right track:
![Index.html](images/index.png?raw=true "Index.html")

Now open a new terminal window and keep http-server running in background.
Now open a new terminal window and keep local-web-server running in background.

### 3. Building and running a single framework

Expand Down Expand Up @@ -260,7 +260,7 @@ Contributions are very welcome. Please use the following rules:
* Name your directory frameworks/[keyed|non-keyed]/[FrameworkName]
* Each contribution must be buildable by `npm install` and `npm run build-prod` command in the directory. What build-prod does is up to you. Often there's an `npm run build-dev` that creates a development build
* Every implementation must use bootstrap provided in the root css directory.
* All npm dependencies should be installed locally (i.e. listed in your package.json). Http-server should not be a local dependency. It is installed from the root directory to allow access to bootstrap.
* All npm dependencies should be installed locally (i.e. listed in your package.json). local-web-server should not be a local dependency. It is installed from the root directory to allow access to bootstrap.
* Please use *fixed version* numbers, no ranges, in package.json. Otherwise the build will break sooner or later - believe me. Updating works IMO best with npm-check-updates, which keeps the version format.
* Webdriver-ts must be able to run the perf tests for the contribution. This means that all buttons (like "Create 1,000 rows") must have the correct id e.g. like in vanillajs. Using shadow DOM is a real pain for webdriver. The closer you can get to polymer the higher the chances I can make that contribution work.
* Don't change the ids in the index.html, since the automated benchmarking relies on those ids.
Expand Down
17 changes: 0 additions & 17 deletions test/js-framework-benchmark/frameworks/keyed/aurelia/.babelrc

This file was deleted.

12 changes: 12 additions & 0 deletions test/js-framework-benchmark/frameworks/keyed/aurelia/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# 2 space indentation
indent_style = space
indent_size = 2
39 changes: 37 additions & 2 deletions test/js-framework-benchmark/frameworks/keyed/aurelia/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,37 @@
scripts
src/environment.js

# You may want to customise this file depending on your Operating System
# and the editor that you use.
#
# We recommend that you use a Global Gitignore for files that are not related
# to the project. (https://help.github.com/articles/ignoring-files/#create-a-global-gitignore)

# OS
#
# Ref: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
# Ref: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
# Ref: https://github.com/github/gitignore/blob/master/Global/Linux.gitignore
.DS_STORE
Thumbs.db

# Editors
#
# Ref: https://github.com/github/gitignore/blob/master/Global
# Ref: https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore
# Ref: https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore
.idea
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# Dependencies
node_modules

# Compiled files
/scripts
/src/environment.js
/src/environment.ts
/dist
/test/coverage-jest
/test/coverage-karma
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
25 changes: 25 additions & 0 deletions test/js-framework-benchmark/frameworks/keyed/aurelia/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# `aurelia`

This project is bootstrapped by [aurelia-cli](https://github.com/aurelia/cli).

For more information, go to https://aurelia.io/docs/cli/webpack

## Run dev app

Run `npm start`, then open `http://localhost:8080`

You can change the standard webpack configurations from CLI easily with something like this: `npm start -- --open --port 8888`. However, it is better to change the respective npm scripts or `webpack.config.js` with these options, as per your need.

To enable Webpack Bundle Analyzer, do `npm run analyze` (production build).

To enable hot module reload, do `npm start -- --env.hmr`.

To change dev server port, do `au run --port 8888`.

To change dev server host, do `au run --host 127.0.0.1`

**PS:** You could mix all the flags as well, `au run --host 127.0.0.1 --port 7070 --open --env.hmr`

## Build for production

Run `npm run build`.
Original file line number Diff line number Diff line change
@@ -1,127 +1,30 @@
{
"name": "aurelia-v1.1.2-non-keyed",
"name": "aurelia",
"type": "project:application",
"bundler": {
"id": "cli",
"displayName": "Aurelia-CLI"
},
"build": {
"targets": [
{
"id": "web",
"displayName": "Web",
"index": "index.html",
"baseDir": ".",
"output": "scripts"
}
],
"options": {
"minify": "stage & prod",
"sourcemaps": "dev & stage"
},
"bundles": [
{
"name": "app-bundle.js",
"source": [
"[**/*.js]",
"**/*.{css,html}"
]
},
{
"name": "vendor-bundle.js",
"prepend": [
"node_modules/requirejs/require.js"
],
"dependencies": [
"aurelia-binding",
"aurelia-bootstrapper",
"aurelia-dependency-injection",
"aurelia-framework",
"aurelia-loader",
"aurelia-loader-default",
"aurelia-logging",
{
"name": "aurelia-logging-console",
"path": "../node_modules/aurelia-logging-console/dist/amd",
"main": "aurelia-logging-console",
"env": "dev & stage"
},
"aurelia-metadata",
"aurelia-pal",
"aurelia-pal-browser",
"aurelia-path",
"aurelia-task-queue",
"aurelia-templating",
"aurelia-templating-binding",
{
"name": "aurelia-templating-resources",
"path": "../node_modules/aurelia-templating-resources/dist/amd",
"main": "aurelia-templating-resources"
},
"text"
]
}
],
"loader": {
"type": "require",
"configTarget": "vendor-bundle.js",
"includeBundleMetadataInConfig": "auto",
"plugins": [
{
"name": "text",
"extensions": [
".html",
".css"
],
"stub": true
}
]
}
},
"platform": {
"id": "web",
"displayName": "Web",
"index": "index.html",
"baseDir": ".",
"output": "scripts"
},
"transpiler": {
"id": "babel",
"displayName": "Babel",
"fileExtension": ".js",
"options": {
"plugins": [
"transform-es2015-modules-amd"
]
},
"source": "src/**/*.js"
},
"markupProcessor": {
"id": "minimum",
"displayName": "Minimal Minification",
"fileExtension": ".html",
"source": "src/**/*.html"
},
"cssProcessor": {
"id": "none",
"displayName": "None",
"fileExtension": ".css",
"source": "src/**/*.css"
},
"editor": {
"id": "none",
"displayName": "None"
},
"unitTestRunner": {
"id": "none",
"displayName": "None"
},
"paths": {
"root": "src",
"resources": "resources",
"elements": "resources/elements",
"attributes": "resources/attributes",
"valueConverters": "resources/value-converters",
"bindingBehaviors": "resources/binding-behaviors"
},
"transpiler": {
"id": "typescript",
"fileExtension": ".ts"
},
"build": {
"options": {
"server": "dev",
"extractCss": "prod",
"coverage": false
}
},
"platform": {
"hmr": false,
"open": false,
"port": 8080,
"host": "localhost",
"output": "dist"
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "attribute",
"description": "Creates a custom attribute class and places it in the project resources."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import {inject} from 'aurelia-dependency-injection';
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';

@inject(Project, CLIOptions, UI)
export default class AttributeGenerator {
constructor(private project: Project, private options: CLIOptions, private ui: UI) { }

async execute() {
const name = await this.ui.ensureAnswer(
this.options.args[0],
'What would you like to call the custom attribute?'
);

let fileName = this.project.makeFileName(name);
let className = this.project.makeClassName(name);

this.project.attributes.add(
ProjectItem.text(`${fileName}.ts`, this.generateSource(className))
);

await this.project.commitChanges();
await this.ui.log(`Created ${fileName}.`);
}

generateSource(className) {
return `import {autoinject} from 'aurelia-framework';
@autoinject()
export class ${className}CustomAttribute {
constructor(private element: Element) { }
valueChanged(newValue, oldValue) {
//
}
}
`;
}
}
Loading

0 comments on commit 78c3467

Please sign in to comment.