diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 000000000..ffe689184 --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,72 @@ +name: Benchmark +on: [pull_request] +jobs: + benchmark: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: nanasess/setup-chromedriver@master + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - uses: actions-rs/install@v0.1 + with: + crate: wasm-bindgen-cli + version: latest + use-tool-cache: true + + - uses: actions-rs/install@v0.1 + with: + crate: wasm-pack + version: latest + use-tool-cache: true + + - uses: actions-rs/install@v0.1 + with: + crate: https + version: latest + use-tool-cache: true + + - name: Server + run: http -p 8080 & + + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: 12 + + - name: Npm Install + run: | + npm install + (cd webdriver-ts && npm install) + (cd webdriver-ts-results && npm install) + + - name: Build + run: | + npm run build-prod + (cd webdriver-ts && npm run build-prod) + + - name: Benchmark + run: npm run bench -- --headless + + - name: Results + run: npm run results + + - name: Build comment message + run: | + msg=$(cd results_diff && cargo run) + msg="${msg//'%'/'%25'}" + msg="${msg//$'\n'/'%0A'}" + msg="${msg//$'\r'/'%0D'}" + echo "::set-env name=MSG::$msg" + + - name: Comment PR + uses: unsplash/comment-on-pr@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + msg: "${{ env.MSG }}" + check_for_duplicate_msg: false diff --git a/README.md b/README.md index c7a360457..9a0bdceed 100755 --- a/README.md +++ b/README.md @@ -1,11 +1,7 @@ -[![CircleCI](https://circleci.com/gh/krausest/js-framework-benchmark.svg?style=svg)](https://circleci.com/gh/krausest/js-framework-benchmark) - # js-framework-benchmark This is a simple benchmark for several javascript frameworks. The benchmarks creates a large table with randomized entries and measures the time for various operations including rendering duration. -![Screenshot](images/screenshot.png?raw=true "Screenshot") - ## About the benchmarks The following operations are benchmarked for each framework: @@ -32,60 +28,58 @@ The following operations are benchmarked for each framework: * total byte weight: The lighthouse metric TotalByteWeight: Network transfer cost (post-compression) of all the resources loaded into the page. For all benchmarks the duration is measured including rendering time. You can read some details on this [article](http://www.stefankrause.net/wp/?p=218). -The results of this benchmark is outlined on my blog ([round 1](http://www.stefankrause.net/wp/?p=191), [round 2](http://www.stefankrause.net/wp/?p=283), [round 3](http://www.stefankrause.net/wp/?p=301), [round 4](http://www.stefankrause.net/wp/?p=316), [round 5](http://www.stefankrause.net/wp/?p=392), [round 6](http://www.stefankrause.net/wp/?p=431), [round 7](http://www.stefankrause.net/wp/?p=454) and [round 8](http://www.stefankrause.net/wp/?p=504)). - -## Snapshot of the results - -Official results are posted on the blog mentioned above. The current snapshot that may not have the same quality (i.e. -results might be for mixed browser versions, number of runs per benchmark may vary) can be seen [here](https://rawgit.com/krausest/js-framework-benchmark/master/webdriver-ts-results/table.html) -[![Results](images/results.png?raw=true "Results")](https://krausest.github.io/js-framework-benchmark/current.html) ## How to get started - building and running -There are currently ~60 framework entries in this repository. Installing (and maintaining) those can be challenging, but here are simplified instructions how to get started. +There are 3 framework entries in this repository: + +* `keyed/wasm-bindgen` +* `keyed/yew` +* `keyed/yew-baseline` _(Used to determine if recent changes improved performance)_ ### 1. Prerequisites -Have *node.js (>=10.0)* installed. If you want to do yourself a favour use nvm for that and install yarn. The benchmark has been tested with node v10.16.3. -For some frameworks you'll also need *java* (>=8, e.g. openjdk-8-jre on ubuntu). +Have *node.js (>=10.0)* installed. We recommend using `nvm` to manage node versions The benchmark has been tested with node v12.16.2. Please make sure that the following command work before trying to build: ``` > npm npm -version -5.0.0 +6.14.15 +> nvm current +v12.16.2 > node --version -v8.0.0 -> echo %JAVA_HOME% / echo $JAVA_HOME -> java -version -java version "1.8.0_131" ... -> javac -version -javac 1.8.0_131 +v12.16.2 ``` -### 2. Start installing +### Install `chromedriver` -As stated above building and running the benchmarks for all frameworks can be challenging, thus we start step by step... +https://chromedriver.chromium.org/downloads + + +### Setup local server + +You can use any server which properly handles the MIME type of wasm files. We recommend the `https` crate: -Install global dependencies -This installs just a few top level dependencies for the building the frameworks and a http-server. ``` -npm install +cargo install https ``` -We start the http-server in the root directory + +Start server in the root directory ``` -npm start +http -p 8080 ``` -Verify that the http-server works: + +Verify that the 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 `http` running in background. -### 3. Building and running a single framework +### 2. Building and running a single framework -We now try to build the first framework. Go to the vanillajs reference implementation +We now try to build a framework. Go to the `wasm-bindgen` reference implementation ``` -cd frameworks/keyed/vanillajs +cd frameworks/keyed/wasm-bindgen ``` and install the dependencies ``` @@ -96,36 +90,16 @@ and build the framework npm run build-prod ``` There should be no build errors and we can open the framework in the browser: -[http://localhost:8080/frameworks/keyed/vanillajs/](http://localhost:8080/frameworks/keyed/vanillajs/) +[http://localhost:8080/frameworks/keyed/wasm-bindgen/index.html](http://localhost:8080/frameworks/keyed/wasm-bindgen/index.html) -Some frameworks like binding.scala or ember can't be opened that way, because they need a 'dist' or 'target/web/stage' or something in the URL. You can find out the correct URL in the [index.html](http://localhost:8080/index.html) you've opened before or take a look whether there's a customURL property under js-framework-benchmark in the [package.json](https://github.com/krausest/js-framework-benchmark/blob/master/frameworks/keyed/ember/package.json#L10) that represents the url. +## 3. Running a single framework with the automated benchmark driver -## Optional 3.1: Contributing a new implementation +The benchmark uses an automated benchmark driver using `chromedriver` to measure the duration for each operation using chrome's timeline. Here are the steps to run for a single framework: -For contributions it is basically sufficient to create a new directory for your framework that supports `npm install` and `npm run build-prod` and can be then opened in the browser. All other steps are optional. Let's simulate that by copying vanillajs. -``` -cd ../frameworks/keyed -cp -r vanillajs super-vanillajs -cd super-vanillajs -``` -Then we edit super-vanillajs/index.html to have a correct index.html: -``` -Super-VanillaJS-"keyed" -... -

Super-VanillaJS-"keyed"

-``` -In most cases you'll need `npm install` and `npm run build-prod` and then check whether it works in the browser on [http://localhost:8080/frameworks/keyed/super-vanillajs/](http://localhost:8080/frameworks/keyed/super-vanillajs/). +### Run benchmarks -(Of course in reality you'd rather throw out the javascript source files and use your framework there instead of only changing the html file.) +First, navigate to the `webdriver-ts/` directory. -## 4. Running a single framework with the automated benchmark driver - -The benchmark uses an automated benchmark driver using chromedriver to measure the duration for each operation using chrome's timeline. Here are the steps to run is for a single framework: - -``` -cd ../../.. -cd webdriver-ts -``` and install the dependencies ``` npm install @@ -134,143 +108,79 @@ and build the benchmark driver ``` npm run build-prod ``` -now run the benchmark driver for the vanillajs-keyed framework: +now run the benchmark driver for the "wasmbindgen-keyed" framework: ``` -npm run bench keyed/vanillajs +npm run bench -- --headless keyed/wasm-bindgen ``` -Just lean back and watch chrome run the benchmarks. -If it doesn't complain then the html for the table should be fine and your categorization as keyed or non-keyed should also be correct. - - -You should keep the chrome window visible since otherwise it seems like paint events can be skipped leading to wrong results. On the terminal will appear various log statements. +Just lean back and wait for chrome to run the benchmarks. +Keep an eye on the console output to see if benchmark checks are timing out. If so, visit [http://localhost:8080/frameworks/keyed/wasm-bindgen/index.html](http://localhost:8080/frameworks/keyed/wasm-bindgen/index.html) and check for console errors. You could also try without using `--headless` to debug. The results for that run will be saved in the `webdriver-ts/results` directory. We can take a look at the results of a single result: ``` -cat results/vanillajs-keyed_01_run1k.json -{"framework":"vanillajs-keyed","benchmark":"01_run1k","type":"cpu","min":135.532,"max":154.821,"mean":143.79166666666666,"median":141.022,"geometricMean":143.56641695989177,"standardDeviation":8.114582360718808,"values":[154.821,135.532,141.022]} -``` -As you can see the mean duration for create 1000 rows was 144 msecs. +cat results/wasm-bindgen-v0.2.47-keyed_01_run1k.json + +{ + "framework": "wasm-bindgen-v0.2.47-keyed", + "keyed": true, + "benchmark": "01_run1k", + "type": "cpu", + "min": 101.123, + "max": 114.547, + "mean": 107.69300000000001, + "median": 105.821, + "geometricMean": 107.5587774247631, + "standardDeviation": 6.028027040417119, + "values": [ + 114.547, + 113.509, + 103.465, + 105.821, + 101.123 + ] +} +``` +As you can see the mean duration for create 1000 rows was 107 msecs. You can also check whether the implementation appears to be compliant to the rules: ``` -npm run check keyed/vanillajs +npm run check keyed/wasm-bindgen ``` If it finds anything it'll report an ERROR. -## 6. Building the result table +## 4. Building the result table Install libraries ``` -cd .. -cd webdriver-ts-results -npm install -cd .. -cd webdriver-ts +(cd webdriver-ts-results && npm install) ``` -In the webdriver-ts directory issue the follwing command: +In the webdriver-ts directory issue the following command: ``` npm run results ``` Now a result table should have been created which can be opened on [http://localhost:8080/webdriver-ts-results/table.html](http://localhost:8080/webdriver-ts-results/table.html). -There's nothing in table except for the column vanillajs-keyed at the right end of the first table. -![First Run Results](images/staticResults.png?raw=true "First Run Results") - -## 6.1 Adding your new implementation to the results table. -(Notice: Updating common.ts is no longer necessary, super-vanillajs is visible in the result table) - -Your package.json must include some information for the benchmark. Since you copied it, the important section is already there: -``` - ... - "js-framework-benchmark": { - "frameworkVersion": "" - }, - ... - -``` -This one is a bit exceptional since vanillajs has no version. If you use a normal framework like react it carries a version information. For most frameworks you'll add a -dependency to your framework in package.json. The benchmark can automatically determine the correct version information from package.json and package-lock.json if you specify the -package name like that: -``` - "js-framework-benchmark": { - "frameworkVersionFromPackage": "react" - }, -``` -Now the benchmark will fetch the installed react version from package-lock.json in the react directory and use that version number to compute the correct version string. -If your library has multiple important packages like react + redux you can put them separated with a colon there like "react:redux". -If you don't pull your framework from npm you can hardcode a version like `"frameworkVersion": "0.0.1"`. -The other important, but optional properties for js-framework-benchmark are shown in the following example: -``` -"customURL": "/target/web/stage", -"useShadowRoot": true -```` -You can set an optional different URL if needed or specify that your DOM uses a shadow root. +## 5. Building and running the benchmarks for all frameworks -## Optional 6.2 Updating the index.html file -With +From the base directory, you can build all frameworks by running ``` -npm run index +npm install +npm run build-prod ``` -you include Super-VanillaJS-keyed in [http://localhost:8080/index.html](http://localhost:8080/index.html) -## Optional 7. Building and running the benchmarks for all frameworks +You can now run the benchmark for all frameworks by: -This is not for the faint at heart. You can build all frameworks simply by issuing -``` -cd .. -npm run build-prod -``` -After downloading the whole internet it starts building it. Basically there should be no errors during the build, but I can't guarantee that the dependencies won't break. (There's a docker build on the way which might make building it more robust. See https://github.com/krausest/js-framework-benchmark/wiki/%5BUnder-construction%5D-Build-all-frameworks-with-docker) -You can now run the benchmark for all frameworks by invoking -`npm run bench-all` -in the root directory. +1. Navigate to the `webdriver-ts/` directory +2. Run benches: `npm run bench -- --headless --count ` +3. Process results: `npm run results` -After that you can check all results in [http://localhost:8080/webdriver-ts/table.html](http://localhost:8080/webdriver-ts/table.html). +After that, you can check all results in [http://localhost:8080/webdriver-ts/table.html](http://localhost:8080/webdriver-ts/table.html). ## Tips and tricks -* You can select multiple frameworks and benchmarks for running with prefixes like in the following example in the webdriver-ts directory: -`npm run bench -- --framework angular bob --benchmark 01_ 02_` -runs the test for all frameworks that contain either angular or bob, which means all angular versions and bobril and all benchmarks whose id contain 01_ or 02_ -* You can also run implementations by passing their directory names (cd to webdriver-ts): -`npm run bench keyed/angular keyed/react` or if you want to pass more options it becomes: -`npm run bench -- --count 3 keyed/angular keyed/react`. +* You can run multiple frameworks by passing their directory names (cd to webdriver-ts): +`npm run bench keyed/yew-baseline keyed/yew` or if you want to pass more options it becomes: +`npm run bench -- --count 3 keyed/yew`. * You can run all of the frameworks you've installed using `npm run bench -- --installed` -* If you can't get one framework to compile or run, just move it out of the root directory and remove it from common.ts, recompile and re-run * To achieve good precision you should run each framework often enough. I recommend at least 10 times, more is better. The result table contains the mean and the standard deviation. You can seen the effect on the latter pretty well if you increase the count. -* One can check whether an implementation is keyed or non-keyed via `npm run isKeyed` in the webdriver-ts directory. You can limit which frameworks to check in the same way as the webdriver test runner like e.g. `npm run isKeyed -- --framework svelte`. The program will report an error if a benchmark implementation is incorrectly classified. - -## How to contribute - -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. -* 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. -* Please push only files in your framework folder (not index.html or results.json) -* **Please make sure your implementation is validated by the test tool.** cd to webdriver-ts and invoke it with `npm run check [keyed|non-keyed]/[FrameworkName]`. It'll print an error if your framework behaves other as specified. It'll print a big ERROR explaining if it isn't happy with the implementation. -* Please don't commit any of the result file webdriver-ts/table.html, webdriver-ts-results/src/results.ts or webdriver-ts-results/table.html. I use to run the benchmarks after merging and publish updated (temporary) results. -* The latest stable chrome can be used regarding web features and language level (babel-preset-env "last 1 chrome versions") -* The vanillajs implementations and some others include code that try to approximate the repaint duration through javascript code. Implemenatations are not required to include that measurement. Remember: The real measurements are taken by the automated test driver by examining chrome timeline entries. -* **Please don't over-optimize. Other contributors will review your implementation so beware of discussions ([#521](https://github.com/krausest/js-framework-benchmark/pull/521), [#519](https://github.com/krausest/js-framework-benchmark/pull/519), [#430](https://github.com/krausest/js-framework-benchmark/issues/430)) and rejection if the community finds you cheating. When are you safe?** - * If the initial rendering is able to render the selection state - * The implementation uses only the idiomatic style of its library - * If you don't use userland hacks in your implementation like dom manipulations or request animation frame calls -Tip: If you start with your implementation do not take vanillajs as the reference. It violates those rules and serves only as a performance baseline and not as a best practice implementation. - -This work is derived from a benchmark that Richard Ayotte published on https://gist.github.com/RichAyotte/a7b8780341d5e75beca7 and adds more framework and more operations. Thanks for the great work. - -Thanks to Baptiste Augrain for making the benchmarks more sophisticated and adding frameworks. - -## History -Frameworks without activity on github or npm for more than a year will be removed. -The following frameworks were removed 9/16/2019: -- [x] angular-light Last commit Nov 30, 2017 -- [x] nx. Last commit Feb 2017 -- [x] maik-h Last commit Dec 15, 2017 -- [x] rivets Last commit Oct 22, 2016 -- [x] tsers. Last commit Jun 19, 2016 + diff --git a/frameworks/keyed/angular-ng/.gitignore b/frameworks/keyed/angular-ng/.gitignore deleted file mode 100644 index 86d943a9b..000000000 --- a/frameworks/keyed/angular-ng/.gitignore +++ /dev/null @@ -1,46 +0,0 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. - -# compiled output -/dist -/tmp -/out-tsc -# Only exists if Bazel was run -/bazel-out - -# dependencies -/node_modules - -# profiling files -chrome-profiler-events*.json -speed-measure-plugin*.json - -# IDEs and editors -/.idea -.project -.classpath -.c9/ -*.launch -.settings/ -*.sublime-workspace - -# IDE - VSCode -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -.history/* - -# misc -/.sass-cache -/connect.lock -/coverage -/libpeerconnection.log -npm-debug.log -yarn-error.log -testem.log -/typings - -# System Files -.DS_Store -Thumbs.db diff --git a/frameworks/keyed/angular-ng/.npmrc b/frameworks/keyed/angular-ng/.npmrc deleted file mode 100644 index 3ca369a11..000000000 --- a/frameworks/keyed/angular-ng/.npmrc +++ /dev/null @@ -1 +0,0 @@ -NG_CLI_ANALYTICS=false \ No newline at end of file diff --git a/frameworks/keyed/angular-ng/README.md b/frameworks/keyed/angular-ng/README.md deleted file mode 100644 index b485ab8eb..000000000 --- a/frameworks/keyed/angular-ng/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# AngularNg - -This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.3.24. - -## Development server - -Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. - -## Code scaffolding - -Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. - -## Build - -Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. - -## Running unit tests - -Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). - -## Running end-to-end tests - -Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). - -## Further help - -To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). diff --git a/frameworks/keyed/angular-ng/angular.json b/frameworks/keyed/angular-ng/angular.json deleted file mode 100644 index e51c46141..000000000 --- a/frameworks/keyed/angular-ng/angular.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "$schema": "./node_modules/@angular/cli/lib/config/schema.json", - "version": 1, - "newProjectRoot": "projects", - "projects": { - "angular-ng": { - "projectType": "application", - "schematics": {}, - "root": "", - "sourceRoot": "src", - "prefix": "app", - "architect": { - "build": { - "builder": "@angular-devkit/build-angular:browser", - "options": { - "outputPath": "dist/angular-ng", - "index": "src/index.html", - "main": "src/main.ts", - "polyfills": "src/polyfills.ts", - "tsConfig": "tsconfig.app.json", - "aot": false, - "assets": [ - { "glob": "**/*", "input": "src/css/", "output": "/css/" } - ], - "styles": [ - ], - "scripts": [] - }, - "configurations": { - "production": { - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.prod.ts" - } - ], - "optimization": true, - "outputHashing": "all", - "sourceMap": false, - "extractCss": true, - "namedChunks": false, - "aot": true, - "extractLicenses": true, - "vendorChunk": false, - "buildOptimizer": true, - "budgets": [ - { - "type": "initial", - "maximumWarning": "2mb", - "maximumError": "5mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "6kb", - "maximumError": "10kb" - } - ] - } - } - }, - "serve": { - "builder": "@angular-devkit/build-angular:dev-server", - "options": { - "browserTarget": "angular-ng:build" - }, - "configurations": { - "production": { - "browserTarget": "angular-ng:build:production" - } - } - }, - "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", - "options": { - "browserTarget": "angular-ng:build" - } - } - } - }}, - "defaultProject": "angular-ng" -} \ No newline at end of file diff --git a/frameworks/keyed/angular-ng/browserslist b/frameworks/keyed/angular-ng/browserslist deleted file mode 100644 index 1dae0a755..000000000 --- a/frameworks/keyed/angular-ng/browserslist +++ /dev/null @@ -1,8 +0,0 @@ -# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. -# For additional information regarding the format and rule options, please see: -# https://github.com/browserslist/browserslist#queries - -# You can see what browsers were selected by your queries by running: -# npx browserslist - -last 1 chrome versions \ No newline at end of file diff --git a/frameworks/keyed/angular-ng/package.json b/frameworks/keyed/angular-ng/package.json deleted file mode 100644 index de17c795a..000000000 --- a/frameworks/keyed/angular-ng/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "angular-ng", - "version": "0.0.0", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "@angular/core", - "customURL": "/dist/angular-ng/" - }, - "scripts": { - "ng": "ng", - "start": "ng serve", - "build": "ng build", - "test": "ng test", - "lint": "ng lint", - "build-prod": "ng build --prod=true --buildOptimizer=true --sourceMap=false", - "build-dev": "ng serve" - }, - "private": true, - "dependencies": { - "@angular/animations": "9.1.2", - "@angular/common": "9.1.2", - "@angular/compiler": "9.1.2", - "@angular/core": "9.1.2", - "@angular/platform-browser": "9.1.2", - "@angular/platform-browser-dynamic": "9.1.2", - "rxjs": "6.5.5", - "tslib": "^1.11.1", - "zone.js": "0.10.3" - }, - "devDependencies": { - "@angular-devkit/build-angular": "0.901.1", - "@angular/cli": "9.1.1", - "@angular/compiler-cli": "9.1.2", - "@angular/language-service": "9.1.2", - "@types/node": "13.13.0", - "ts-node": "8.8.2", - "tslint": "6.1.1", - "typescript": "3.8.3" - } -} diff --git a/frameworks/keyed/angular-ng/src/app/app.component.html b/frameworks/keyed/angular-ng/src/app/app.component.html deleted file mode 100644 index 1092fbb53..000000000 --- a/frameworks/keyed/angular-ng/src/app/app.component.html +++ /dev/null @@ -1,42 +0,0 @@ -
-
-
-
-

Angular {{version}} keyed

-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- - - - - - - - - -
{{item.id}} - {{item.label}} -
- -
\ No newline at end of file diff --git a/frameworks/keyed/angular-ng/src/app/app.component.ts b/frameworks/keyed/angular-ng/src/app/app.component.ts deleted file mode 100644 index 29291a91c..000000000 --- a/frameworks/keyed/angular-ng/src/app/app.component.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { Component, VERSION, AfterViewChecked} from '@angular/core'; - -interface Data { - id: number; - label: string; -} - -@Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styles: [] -}) -export class AppComponent { - data: Array = []; - selected: number = undefined; - id: number = 1; - backup: Array = undefined; - version: string; - - constructor() { - this.version = VERSION.full; - } - - buildData(count: number = 1000): Array { - var adjectives = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy"]; - var colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"]; - var nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"]; - var data: Array = []; - for (var i = 0; i < count; i++) { - data.push({ id: this.id, label: adjectives[this._random(adjectives.length)] + " " + colours[this._random(colours.length)] + " " + nouns[this._random(nouns.length)] }); - this.id++; - } - return data; - } - - _random(max: number) { - return Math.round(Math.random() * 1000) % max; - } - - itemById(index: number, item: Data) { - return item.id; - } - - select(item: Data, event: Event) { - event.preventDefault(); - this.selected = item.id; - } - - delete(item: Data, event: Event) { - event.preventDefault(); - for (let i = 0, l = this.data.length; i < l; i++) { - if (this.data[i].id === item.id) { - this.data.splice(i, 1); - break; - } - } - } - - run() { - this.data = this.buildData(); - } - - add() { - this.data = this.data.concat(this.buildData(1000)); - } - - update() { - for (let i = 0; i < this.data.length; i += 10) { - this.data[i].label += ' !!!'; - } - } - runLots() { - this.data = this.buildData(10000); - this.selected = undefined; - } - clear() { - this.data = []; - this.selected = undefined; - } - swapRows() { - if (this.data.length > 998) { - var a = this.data[1]; - this.data[1] = this.data[998]; - this.data[998] = a; - } - } -} \ No newline at end of file diff --git a/frameworks/keyed/angular-ng/src/app/app.module.ts b/frameworks/keyed/angular-ng/src/app/app.module.ts deleted file mode 100644 index f65716351..000000000 --- a/frameworks/keyed/angular-ng/src/app/app.module.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; - -import { AppComponent } from './app.component'; - -@NgModule({ - declarations: [ - AppComponent - ], - imports: [ - BrowserModule - ], - providers: [], - bootstrap: [AppComponent] -}) -export class AppModule { } diff --git a/frameworks/keyed/angular-ng/src/environments/environment.prod.ts b/frameworks/keyed/angular-ng/src/environments/environment.prod.ts deleted file mode 100644 index 3612073bc..000000000 --- a/frameworks/keyed/angular-ng/src/environments/environment.prod.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const environment = { - production: true -}; diff --git a/frameworks/keyed/angular-ng/src/environments/environment.ts b/frameworks/keyed/angular-ng/src/environments/environment.ts deleted file mode 100644 index 7b4f817ad..000000000 --- a/frameworks/keyed/angular-ng/src/environments/environment.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file can be replaced during build by using the `fileReplacements` array. -// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. -// The list of file replacements can be found in `angular.json`. - -export const environment = { - production: false -}; - -/* - * For easier debugging in development mode, you can import the following file - * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. - * - * This import should be commented out in production mode because it will have a negative impact - * on performance if an error is thrown. - */ -// import 'zone.js/dist/zone-error'; // Included with Angular CLI. diff --git a/frameworks/keyed/angular-ng/src/favicon.ico b/frameworks/keyed/angular-ng/src/favicon.ico deleted file mode 100644 index 997406ad2..000000000 Binary files a/frameworks/keyed/angular-ng/src/favicon.ico and /dev/null differ diff --git a/frameworks/keyed/angular-ng/src/index.html b/frameworks/keyed/angular-ng/src/index.html deleted file mode 100644 index a306d0744..000000000 --- a/frameworks/keyed/angular-ng/src/index.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Angular - - - - - - - - - - diff --git a/frameworks/keyed/angular-ng/src/main.ts b/frameworks/keyed/angular-ng/src/main.ts deleted file mode 100644 index d9d924350..000000000 --- a/frameworks/keyed/angular-ng/src/main.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { enableProdMode } from '@angular/core'; -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; - -import { AppModule } from './app/app.module'; -import { environment } from './environments/environment'; - -// if (environment.production) { - enableProdMode(); -// } - -platformBrowserDynamic().bootstrapModule(AppModule) - .catch(err => console.error(err)); diff --git a/frameworks/keyed/angular-ng/src/polyfills.ts b/frameworks/keyed/angular-ng/src/polyfills.ts deleted file mode 100644 index aa665d6b8..000000000 --- a/frameworks/keyed/angular-ng/src/polyfills.ts +++ /dev/null @@ -1,63 +0,0 @@ -/** - * This file includes polyfills needed by Angular and is loaded before the app. - * You can add your own extra polyfills to this file. - * - * This file is divided into 2 sections: - * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. - * 2. Application imports. Files imported after ZoneJS that should be loaded before your main - * file. - * - * The current setup is for so-called "evergreen" browsers; the last versions of browsers that - * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), - * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. - * - * Learn more in https://angular.io/guide/browser-support - */ - -/*************************************************************************************************** - * BROWSER POLYFILLS - */ - -/** IE10 and IE11 requires the following for NgClass support on SVG elements */ -// import 'classlist.js'; // Run `npm install --save classlist.js`. - -/** - * Web Animations `@angular/platform-browser/animations` - * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. - * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). - */ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. - -/** - * By default, zone.js will patch all possible macroTask and DomEvents - * user can disable parts of macroTask/DomEvents patch by setting following flags - * because those flags need to be set before `zone.js` being loaded, and webpack - * will put import in the top of bundle, so user need to create a separate file - * in this directory (for example: zone-flags.ts), and put the following flags - * into that file, and then add the following code before importing zone.js. - * import './zone-flags.ts'; - * - * The flags allowed in zone-flags.ts are listed here. - * - * The following flags will work for all browsers. - * - * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame - * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick - * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames - * - * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js - * with the following flag, it will bypass `zone.js` patch for IE/Edge - * - * (window as any).__Zone_enable_cross_context_check = true; - * - */ - -/*************************************************************************************************** - * Zone JS is required by default for Angular itself. - */ -import 'zone.js/dist/zone'; // Included with Angular CLI. - - -/*************************************************************************************************** - * APPLICATION IMPORTS - */ diff --git a/frameworks/keyed/angular-ng/src/styles.css b/frameworks/keyed/angular-ng/src/styles.css deleted file mode 100644 index 90d4ee007..000000000 --- a/frameworks/keyed/angular-ng/src/styles.css +++ /dev/null @@ -1 +0,0 @@ -/* You can add global styles to this file, and also import other style files */ diff --git a/frameworks/keyed/angular-ng/tsconfig.app.json b/frameworks/keyed/angular-ng/tsconfig.app.json deleted file mode 100644 index 565a11a21..000000000 --- a/frameworks/keyed/angular-ng/tsconfig.app.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "./out-tsc/app", - "types": [] - }, - "files": [ - "src/main.ts", - "src/polyfills.ts" - ], - "include": [ - "src/**/*.ts" - ], - "exclude": [ - "src/test.ts", - "src/**/*.spec.ts" - ] -} diff --git a/frameworks/keyed/angular-ng/tsconfig.json b/frameworks/keyed/angular-ng/tsconfig.json deleted file mode 100644 index 30956ae7e..000000000 --- a/frameworks/keyed/angular-ng/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compileOnSave": false, - "compilerOptions": { - "baseUrl": "./", - "outDir": "./dist/out-tsc", - "sourceMap": true, - "declaration": false, - "downlevelIteration": true, - "experimentalDecorators": true, - "module": "esnext", - "moduleResolution": "node", - "importHelpers": true, - "target": "es2015", - "typeRoots": [ - "node_modules/@types" - ], - "lib": [ - "es2018", - "dom" - ] - }, - "angularCompilerOptions": { - "fullTemplateTypeCheck": true, - "strictInjectionParameters": true - } -} diff --git a/frameworks/keyed/angular-noopzone/.gitignore b/frameworks/keyed/angular-noopzone/.gitignore deleted file mode 100644 index 2c9699a8d..000000000 --- a/frameworks/keyed/angular-noopzone/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -dist/ -node_modules/ -tmp/ diff --git a/frameworks/keyed/angular-noopzone/closure.conf b/frameworks/keyed/angular-noopzone/closure.conf deleted file mode 100644 index da5827062..000000000 --- a/frameworks/keyed/angular-noopzone/closure.conf +++ /dev/null @@ -1,40 +0,0 @@ ---compilation_level=ADVANCED_OPTIMIZATIONS ---language_out=ES5 ---output_wrapper="(function() {%output%}).call(this);" ---js_output_file=dist/bundle.js ---output_manifest=dist/manifest.MF ---variable_renaming_report=dist/variable_renaming_report ---property_renaming_report=dist/property_renaming_report ---create_source_map=%outname%.map - ---warning_level=QUIET ---dependency_mode=STRICT ---rewrite_polyfills=false ---jscomp_off=checkVars ---module_resolution=node ---process_common_js_modules ---package_json_entry_names=es2015 - -node_modules/zone.js/dist/zone_externs.js - ---js node_modules/rxjs/package.json ---js node_modules/rxjs/_esm2015/index.js ---js node_modules/rxjs/_esm2015/internal/**.js ---js node_modules/rxjs/operators/package.json ---js node_modules/rxjs/_esm2015/operators/index.js - ---js node_modules/@angular/core/package.json ---js node_modules/@angular/core/fesm2015/core.js ---js node_modules/@angular/core/src/testability/testability.externs.js - ---js node_modules/@angular/common/package.json ---js node_modules/@angular/common/fesm2015/common.js - ---js node_modules/@angular/compiler/package.json ---js node_modules/@angular/compiler/fesm2015/compiler.js - ---js node_modules/@angular/platform-browser/package.json ---js node_modules/@angular/platform-browser/fesm2015/platform-browser.js - ---js tmp/**.js ---entry_point=./tmp/src/main diff --git a/frameworks/keyed/angular-noopzone/index.html b/frameworks/keyed/angular-noopzone/index.html deleted file mode 100644 index 90c5e36b4..000000000 --- a/frameworks/keyed/angular-noopzone/index.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Angular - - - - - - - - - - \ No newline at end of file diff --git a/frameworks/keyed/angular-noopzone/package.json b/frameworks/keyed/angular-noopzone/package.json deleted file mode 100644 index c698fce82..000000000 --- a/frameworks/keyed/angular-noopzone/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "angular-closure", - "version": "1.0.0", - "description": "An angular app using closure compiler", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "@angular/core" - }, - "scripts": { - "start": "echo 'please start in root project'", - "test": "karma start", - "ngc": "ngc", - "preclosure": "rimraf dist", - "closure": "google-closure-compiler --flagfile closure.conf", - "build-prod": "npm run ngc && npm run closure", - "rollup": "rollup -c rollup.config.js", - "build-dev": "npm run ngc && npm run rollup" - }, - "license": "MIT", - "dependencies": { - "@angular/common": "8.0.1", - "@angular/compiler": "8.0.1", - "@angular/compiler-cli": "8.0.1", - "@angular/core": "8.0.1", - "@angular/platform-browser": "8.0.1", - "core-js": "3.1.4", - "rxjs": "6.5.2", - "tsickle": "0.35.0", - "zone.js": "0.9.1" - }, - "devDependencies": { - "google-closure-compiler": "20190528.0.0", - "http-server": "0.11.1", - "rimraf": "2.6.3", - "rollup": "1.15.5", - "rollup-plugin-commonjs": "10.0.0", - "rollup-plugin-node-resolve": "5.0.2", - "rollup-plugin-uglify": "6.0.2", - "typescript": "3.4.5", - "yargs": "13.2.4" - } -} diff --git a/frameworks/keyed/angular-noopzone/rollup.config.js b/frameworks/keyed/angular-noopzone/rollup.config.js deleted file mode 100644 index 4f3e6de64..000000000 --- a/frameworks/keyed/angular-noopzone/rollup.config.js +++ /dev/null @@ -1,14 +0,0 @@ -import nodeResolve from 'rollup-plugin-node-resolve' - -export default { - input: 'tmp/src/main.js', - output: { - file: 'dist/bundle.js', - format: 'iife', - }, - plugins: [ - nodeResolve({ - module: true, - }), - ] -} diff --git a/frameworks/keyed/angular-noopzone/src/app.ts b/frameworks/keyed/angular-noopzone/src/app.ts deleted file mode 100644 index b26c1df0f..000000000 --- a/frameworks/keyed/angular-noopzone/src/app.ts +++ /dev/null @@ -1,162 +0,0 @@ -import { AfterViewChecked, ApplicationRef, Component, NgModule, VERSION } from '@angular/core'; -import { BrowserModule } from '@angular/platform-browser'; - -interface Data { - id: number; - label: string; -} - -@Component({ - selector: 'my-app', - template: ` -
-
-
-
-

Angular keyed (no Zone.js)

-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- - - - - - - - - -
{{item.id}} - {{item.label}} -
- -
` -}) -export class AppComponent { - data: Array = []; - selected: number = undefined; - id: number = 1; - backup: Array = undefined; - - constructor(private appRef: ApplicationRef) { - console.info(VERSION.full); - } - - buildData(count: number = 1000): Array { - var adjectives = ['pretty', 'large', 'big', 'small', 'tall', 'short', 'long', 'handsome', 'plain', 'quaint', 'clean', 'elegant', 'easy', 'angry', 'crazy', 'helpful', 'mushy', 'odd', 'unsightly', 'adorable', 'important', 'inexpensive', 'cheap', 'expensive', 'fancy']; - var colours = ['red', 'yellow', 'blue', 'green', 'pink', 'brown', 'purple', 'brown', 'white', 'black', 'orange']; - var nouns = ['table', 'chair', 'house', 'bbq', 'desk', 'car', 'pony', 'cookie', 'sandwich', 'burger', 'pizza', 'mouse', 'keyboard']; - var data: Array = []; - for (var i = 0; i < count; i++) { - data.push({ - id: this.id, - label: adjectives[this._random(adjectives.length)] + ' ' + colours[this._random(colours.length)] + ' ' + nouns[this._random(nouns.length)] - }); - this.id++; - } - return data; - } - - _random(max: number) { - return Math.round(Math.random() * 1000) % max; - } - - itemById(index: number, item: Data) { - return item.id; - } - - select(item: Data, event: Event) { - event.preventDefault(); - this.selected = item.id; - this.appRef.tick(); - } - - delete(item: Data, event: Event) { - event.preventDefault(); - for (let i = 0, l = this.data.length; i < l; i++) { - if (this.data[i].id === item.id) { - this.data.splice(i, 1); - break; - } - } - this.appRef.tick(); - } - - run() { - this.data = this.buildData(); - this.appRef.tick(); - } - - add() { - this.data = this.data.concat(this.buildData(1000)); - this.appRef.tick(); - } - - update() { - for (let i = 0; i < this.data.length; i += 10) { - this.data[i].label += ' !!!'; - } - this.appRef.tick(); - } - - runLots() { - this.data = this.buildData(10000); - this.selected = undefined; - this.appRef.tick(); - } - - clear() { - this.data = []; - this.selected = undefined; - this.appRef.tick(); - } - - swapRows() { - if (this.data.length > 998) { - var a = this.data[1]; - this.data[1] = this.data[998]; - this.data[998] = a; - } - this.appRef.tick(); - } -} - -@NgModule({ - imports: [BrowserModule], - declarations: [AppComponent], - bootstrap: [AppComponent] -}) -export class AppModule { -} diff --git a/frameworks/keyed/angular-noopzone/src/main.ts b/frameworks/keyed/angular-noopzone/src/main.ts deleted file mode 100644 index 2ac1cf99b..000000000 --- a/frameworks/keyed/angular-noopzone/src/main.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { platformBrowser } from '@angular/platform-browser'; -import { enableProdMode, ApplicationRef } from '@angular/core'; -import { AppModuleNgFactory } from './app.ngfactory'; - -window['Zone'] = { - get current() { return this }, - assertZonePatched() { }, - fork() { return this }, - get() { return true }, - run(fn: Function) { return fn() }, - runGuarded(fn: Function) { return fn() }, -} - -enableProdMode(); -platformBrowser().bootstrapModuleFactory(AppModuleNgFactory, { ngZone: 'noop' }) diff --git a/frameworks/keyed/angular-noopzone/tsconfig.json b/frameworks/keyed/angular-noopzone/tsconfig.json deleted file mode 100644 index edfe04a15..000000000 --- a/frameworks/keyed/angular-noopzone/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - "target": "es2015", - "module": "es2015", - "moduleResolution": "node", - "sourceMap": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "lib": [ - "es2015", - "dom" - ], - "noImplicitAny": true, - "suppressImplicitAnyIndexErrors": true, - "outDir": "tmp" - }, - "angularCompilerOptions": { - "annotationsAs": "static fields", - "annotateForClosureCompiler": true, - "preserveWhitespaces": false, - "strictMetadataEmit": true - }, - "exclude": [ - "node_modules", - "tmp", - "dist" - ] -} \ No newline at end of file diff --git a/frameworks/keyed/angular-optimized/.gitignore b/frameworks/keyed/angular-optimized/.gitignore deleted file mode 100644 index 2c9699a8d..000000000 --- a/frameworks/keyed/angular-optimized/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -dist/ -node_modules/ -tmp/ diff --git a/frameworks/keyed/angular-optimized/closure.conf b/frameworks/keyed/angular-optimized/closure.conf deleted file mode 100644 index e0086ebfe..000000000 --- a/frameworks/keyed/angular-optimized/closure.conf +++ /dev/null @@ -1,43 +0,0 @@ ---compilation_level=ADVANCED_OPTIMIZATIONS ---language_out=ES5 ---output_wrapper="(function() {%output%}).call(this);" ---js_output_file=dist/bundle.js ---output_manifest=dist/manifest.MF ---variable_renaming_report=dist/variable_renaming_report ---property_renaming_report=dist/property_renaming_report ---create_source_map=%outname%.map - ---warning_level=QUIET ---dependency_mode=STRICT ---rewrite_polyfills=false ---jscomp_off=checkVars ---module_resolution=node ---process_common_js_modules ---package_json_entry_names=es2015 - -node_modules/zone.js/dist/zone_externs.js - ---js node_modules/rxjs/package.json ---js node_modules/rxjs/_esm2015/index.js ---js node_modules/rxjs/_esm2015/internal/**.js ---js node_modules/rxjs/operators/package.json ---js node_modules/rxjs/_esm2015/operators/index.js - ---js node_modules/@angular/core/package.json ---js node_modules/@angular/core/fesm2015/core.js ---js node_modules/@angular/core/src/testability/testability.externs.js - ---js node_modules/@angular/common/package.json ---js node_modules/@angular/common/fesm2015/common.js - ---js node_modules/@angular/compiler/package.json ---js node_modules/@angular/compiler/fesm2015/compiler.js - ---js node_modules/@angular/platform-browser/package.json ---js node_modules/@angular/platform-browser/fesm2015/platform-browser.js - ---js node_modules/@angular-contrib/core/package.json ---js node_modules/@angular-contrib/core/esm2015/angular-contrib-core.js - ---js tmp/**.js ---entry_point=./tmp/src/main diff --git a/frameworks/keyed/angular-optimized/index.html b/frameworks/keyed/angular-optimized/index.html deleted file mode 100644 index 90c5e36b4..000000000 --- a/frameworks/keyed/angular-optimized/index.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Angular - - - - - - - - - - \ No newline at end of file diff --git a/frameworks/keyed/angular-optimized/package.json b/frameworks/keyed/angular-optimized/package.json deleted file mode 100644 index 3671dcaa5..000000000 --- a/frameworks/keyed/angular-optimized/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "angular-closure", - "version": "1.0.0", - "description": "An angular app using closure compiler", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "@angular/core" - }, - "scripts": { - "start": "echo 'please start in root project'", - "test": "karma start", - "ngc": "ngc", - "preclosure": "rimraf dist", - "closure": "google-closure-compiler --flagfile closure.conf", - "build-prod": "npm run ngc && npm run closure", - "rollup": "rollup -c rollup.config.js", - "build-dev": "npm run ngc && npm run rollup" - }, - "license": "MIT", - "dependencies": { - "@angular-contrib/core": "0.0.2", - "@angular/common": "8.0.1", - "@angular/compiler": "8.0.1", - "@angular/compiler-cli": "8.0.1", - "@angular/core": "8.0.1", - "@angular/platform-browser": "8.0.1", - "core-js": "3.1.4", - "rxjs": "6.5.2", - "tsickle": "0.35.0", - "zone.js": "0.9.1" - }, - "devDependencies": { - "google-closure-compiler": "20190528.0.0", - "http-server": "0.11.1", - "rimraf": "2.6.3", - "rollup": "1.15.5", - "rollup-plugin-commonjs": "10.0.0", - "rollup-plugin-node-resolve": "5.0.2", - "rollup-plugin-uglify": "6.0.2", - "typescript": "3.4.5", - "yargs": "13.2.4" - } -} diff --git a/frameworks/keyed/angular-optimized/rollup.config.js b/frameworks/keyed/angular-optimized/rollup.config.js deleted file mode 100644 index fa88b347a..000000000 --- a/frameworks/keyed/angular-optimized/rollup.config.js +++ /dev/null @@ -1,14 +0,0 @@ -import nodeResolve from 'rollup-plugin-node-resolve'; - -export default { - input: 'tmp/src/main.js', - output: { - file: 'dist/bundle.js', - format: 'iife', - }, - plugins: [ - nodeResolve({ - module: true, - }), - ] -} \ No newline at end of file diff --git a/frameworks/keyed/angular-optimized/src/app.ts b/frameworks/keyed/angular-optimized/src/app.ts deleted file mode 100644 index 6a545c0e9..000000000 --- a/frameworks/keyed/angular-optimized/src/app.ts +++ /dev/null @@ -1,170 +0,0 @@ -import { AfterViewChecked, ApplicationRef, Component, NgModule, IterableDiffers, VERSION } from '@angular/core'; -import { BrowserModule } from '@angular/platform-browser'; -import { FastIterableDifferFactory } from '@angular-contrib/core'; - -interface Data { - id: number; - label: string; -} - -@Component({ - selector: 'my-app', - template: ` -
-
-
-
-

Angular keyed (Optimized)

-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- - - - - - - - - -
{{item.id}} - {{item.label}} - - - - -
- -
` -}) -export class AppComponent { - data: Array = []; - selected: number = undefined; - id: number = 1; - backup: Array = undefined; - - constructor(private appRef: ApplicationRef, differs: IterableDiffers, fastDifferFactory: FastIterableDifferFactory) { - console.info(VERSION.full); - - // TODO: remove this. The normal setup does not work in Closure Compiler "ADVANCED" mode, figure it out. - differs.factories.unshift(fastDifferFactory); - } - - buildData(count: number = 1000): Array { - var adjectives = ['pretty', 'large', 'big', 'small', 'tall', 'short', 'long', 'handsome', 'plain', 'quaint', 'clean', 'elegant', 'easy', 'angry', 'crazy', 'helpful', 'mushy', 'odd', 'unsightly', 'adorable', 'important', 'inexpensive', 'cheap', 'expensive', 'fancy']; - var colours = ['red', 'yellow', 'blue', 'green', 'pink', 'brown', 'purple', 'brown', 'white', 'black', 'orange']; - var nouns = ['table', 'chair', 'house', 'bbq', 'desk', 'car', 'pony', 'cookie', 'sandwich', 'burger', 'pizza', 'mouse', 'keyboard']; - var data: Array = []; - for (var i = 0; i < count; i++) { - data.push({ - id: this.id, - label: adjectives[this._random(adjectives.length)] + ' ' + colours[this._random(colours.length)] + ' ' + nouns[this._random(nouns.length)] - }); - this.id++; - } - return data; - } - - _random(max: number) { - return Math.round(Math.random() * 1000) % max; - } - - itemById(index: number, item: Data) { - return item.id; - } - - select(item: Data, event: Event) { - event.preventDefault(); - this.selected = item.id; - this.appRef.tick(); - } - - delete(item: Data, event: Event) { - event.preventDefault(); - for (let i = 0, l = this.data.length; i < l; i++) { - if (this.data[i].id === item.id) { - this.data.splice(i, 1); - break; - } - } - this.appRef.tick(); - } - - run() { - this.data = this.buildData(); - this.appRef.tick(); - } - - add() { - this.data = this.data.concat(this.buildData(1000)); - this.appRef.tick(); - } - - update() { - for (let i = 0; i < this.data.length; i += 10) { - this.data[i].label += ' !!!'; - } - this.appRef.tick(); - } - - runLots() { - this.data = this.buildData(10000); - this.selected = undefined; - this.appRef.tick(); - } - - clear() { - this.data = []; - this.selected = undefined; - this.appRef.tick(); - } - - swapRows() { - if (this.data.length > 998) { - var a = this.data[1]; - this.data[1] = this.data[998]; - this.data[998] = a; - } - this.appRef.tick(); - } -} - -@NgModule({ - imports: [BrowserModule], - declarations: [AppComponent], - bootstrap: [AppComponent], - providers: [FastIterableDifferFactory] -}) -export class AppModule { -} diff --git a/frameworks/keyed/angular-optimized/src/main.ts b/frameworks/keyed/angular-optimized/src/main.ts deleted file mode 100644 index 2ac1cf99b..000000000 --- a/frameworks/keyed/angular-optimized/src/main.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { platformBrowser } from '@angular/platform-browser'; -import { enableProdMode, ApplicationRef } from '@angular/core'; -import { AppModuleNgFactory } from './app.ngfactory'; - -window['Zone'] = { - get current() { return this }, - assertZonePatched() { }, - fork() { return this }, - get() { return true }, - run(fn: Function) { return fn() }, - runGuarded(fn: Function) { return fn() }, -} - -enableProdMode(); -platformBrowser().bootstrapModuleFactory(AppModuleNgFactory, { ngZone: 'noop' }) diff --git a/frameworks/keyed/angular-optimized/tsconfig.json b/frameworks/keyed/angular-optimized/tsconfig.json deleted file mode 100644 index edfe04a15..000000000 --- a/frameworks/keyed/angular-optimized/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - "target": "es2015", - "module": "es2015", - "moduleResolution": "node", - "sourceMap": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "lib": [ - "es2015", - "dom" - ], - "noImplicitAny": true, - "suppressImplicitAnyIndexErrors": true, - "outDir": "tmp" - }, - "angularCompilerOptions": { - "annotationsAs": "static fields", - "annotateForClosureCompiler": true, - "preserveWhitespaces": false, - "strictMetadataEmit": true - }, - "exclude": [ - "node_modules", - "tmp", - "dist" - ] -} \ No newline at end of file diff --git a/frameworks/keyed/angular/.gitignore b/frameworks/keyed/angular/.gitignore deleted file mode 100644 index 2c9699a8d..000000000 --- a/frameworks/keyed/angular/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -dist/ -node_modules/ -tmp/ diff --git a/frameworks/keyed/angular/closure.conf b/frameworks/keyed/angular/closure.conf deleted file mode 100644 index da5827062..000000000 --- a/frameworks/keyed/angular/closure.conf +++ /dev/null @@ -1,40 +0,0 @@ ---compilation_level=ADVANCED_OPTIMIZATIONS ---language_out=ES5 ---output_wrapper="(function() {%output%}).call(this);" ---js_output_file=dist/bundle.js ---output_manifest=dist/manifest.MF ---variable_renaming_report=dist/variable_renaming_report ---property_renaming_report=dist/property_renaming_report ---create_source_map=%outname%.map - ---warning_level=QUIET ---dependency_mode=STRICT ---rewrite_polyfills=false ---jscomp_off=checkVars ---module_resolution=node ---process_common_js_modules ---package_json_entry_names=es2015 - -node_modules/zone.js/dist/zone_externs.js - ---js node_modules/rxjs/package.json ---js node_modules/rxjs/_esm2015/index.js ---js node_modules/rxjs/_esm2015/internal/**.js ---js node_modules/rxjs/operators/package.json ---js node_modules/rxjs/_esm2015/operators/index.js - ---js node_modules/@angular/core/package.json ---js node_modules/@angular/core/fesm2015/core.js ---js node_modules/@angular/core/src/testability/testability.externs.js - ---js node_modules/@angular/common/package.json ---js node_modules/@angular/common/fesm2015/common.js - ---js node_modules/@angular/compiler/package.json ---js node_modules/@angular/compiler/fesm2015/compiler.js - ---js node_modules/@angular/platform-browser/package.json ---js node_modules/@angular/platform-browser/fesm2015/platform-browser.js - ---js tmp/**.js ---entry_point=./tmp/src/main diff --git a/frameworks/keyed/angular/index.html b/frameworks/keyed/angular/index.html deleted file mode 100644 index 2527412e5..000000000 --- a/frameworks/keyed/angular/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Angular - - - - - - - - - - - diff --git a/frameworks/keyed/angular/package.json b/frameworks/keyed/angular/package.json deleted file mode 100644 index b81a4eb9e..000000000 --- a/frameworks/keyed/angular/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "angular-closure", - "version": "1.0.0", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "@angular/core" - }, - "description": "An angular app using closure compiler", - "scripts": { - "start": "echo 'please start in root project'", - "test": "karma start", - "ngc": "ngc", - "preclosure": "rimraf dist", - "closure": "google-closure-compiler --flagfile closure.conf", - "build-prod": "npm run ngc && npm run closure", - "rollup": "rollup -c rollup.config.js", - "build-dev": "npm run ngc && npm run rollup" - }, - "license": "MIT", - "dependencies": { - "@angular/common": "8.2.14", - "@angular/compiler": "8.2.14", - "@angular/compiler-cli": "8.2.14", - "@angular/core": "8.2.14", - "@angular/platform-browser": "8.2.14", - "core-js": "3.6.4", - "rxjs": "6.5.4", - "tsickle": "0.38.0", - "tslib": "1.10.0", - "zone.js": "0.10.2" - }, - "devDependencies": { - "google-closure-compiler": "20190528.0.0", - "http-server": "0.12.1", - "rimraf": "3.0.1", - "rollup": "1.15.5", - "rollup-plugin-commonjs": "10.0.0", - "rollup-plugin-node-resolve": "5.0.2", - "rollup-plugin-uglify": "6.0.2", - "typescript": "~3.5.3", - "yargs": "15.1.0" - } -} diff --git a/frameworks/keyed/angular/rollup.config.js b/frameworks/keyed/angular/rollup.config.js deleted file mode 100644 index e690ed034..000000000 --- a/frameworks/keyed/angular/rollup.config.js +++ /dev/null @@ -1,14 +0,0 @@ -import nodeResolve from 'rollup-plugin-node-resolve'; - -export default { - input: 'tmp/src/main.js', - output: { - file: 'dist/bundle.js', - format: 'iife', - }, - plugins: [ - nodeResolve({ - module: true, - }), - ] -} diff --git a/frameworks/keyed/angular/src/app.ts b/frameworks/keyed/angular/src/app.ts deleted file mode 100644 index 1e01972c3..000000000 --- a/frameworks/keyed/angular/src/app.ts +++ /dev/null @@ -1,134 +0,0 @@ -import { Component, NgModule, AfterViewChecked, VERSION } from '@angular/core'; -import { BrowserModule } from '@angular/platform-browser'; - -interface Data { - id: number; - label: string; -} - -@Component({ - selector: 'my-app', - template: `
-
-
-
-

Angular keyed

-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- - - - - - - - - -
{{item.id}} - {{item.label}} -
- -
` -}) -export class AppComponent { - data: Array = []; - selected: number = undefined; - id: number = 1; - backup: Array = undefined; - - constructor() { - console.info(VERSION.full); - } - - buildData(count: number = 1000): Array { - var adjectives = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy"]; - var colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"]; - var nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"]; - var data: Array = []; - for (var i = 0; i < count; i++) { - data.push({ id: this.id, label: adjectives[this._random(adjectives.length)] + " " + colours[this._random(colours.length)] + " " + nouns[this._random(nouns.length)] }); - this.id++; - } - return data; - } - - _random(max: number) { - return Math.round(Math.random() * 1000) % max; - } - - itemById(index: number, item: Data) { - return item.id; - } - - select(item: Data, event: Event) { - event.preventDefault(); - this.selected = item.id; - } - - delete(item: Data, event: Event) { - event.preventDefault(); - for (let i = 0, l = this.data.length; i < l; i++) { - if (this.data[i].id === item.id) { - this.data.splice(i, 1); - break; - } - } - } - - run() { - this.data = this.buildData(); - } - - add() { - this.data = this.data.concat(this.buildData(1000)); - } - - update() { - for (let i = 0; i < this.data.length; i += 10) { - this.data[i].label += ' !!!'; - } - } - runLots() { - this.data = this.buildData(10000); - this.selected = undefined; - } - clear() { - this.data = []; - this.selected = undefined; - } - swapRows() { - if (this.data.length > 998) { - var a = this.data[1]; - this.data[1] = this.data[998]; - this.data[998] = a; - } - } -} - -@NgModule({ - imports: [BrowserModule], - declarations: [AppComponent], - bootstrap: [AppComponent], -}) -export class AppModule { } diff --git a/frameworks/keyed/angular/src/main.ts b/frameworks/keyed/angular/src/main.ts deleted file mode 100644 index f4b1ad659..000000000 --- a/frameworks/keyed/angular/src/main.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { platformBrowser } from '@angular/platform-browser'; -import { enableProdMode } from '@angular/core'; -import { AppModuleNgFactory } from './app.ngfactory'; - -enableProdMode(); -platformBrowser().bootstrapModuleFactory(AppModuleNgFactory) diff --git a/frameworks/keyed/angular/tsconfig.json b/frameworks/keyed/angular/tsconfig.json deleted file mode 100644 index b7aa823ea..000000000 --- a/frameworks/keyed/angular/tsconfig.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "compilerOptions": { - "target": "es2015", - "module": "es2015", - "moduleResolution": "node", - "sourceMap": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "importHelpers": true, - "lib": [ - "es2015", - "dom" - ], - "noImplicitAny": true, - "suppressImplicitAnyIndexErrors": true, - "outDir": "tmp" - }, - "angularCompilerOptions": { - "annotationsAs": "static fields", - "annotateForClosureCompiler": true, - "preserveWhitespaces": false, - "strictMetadataEmit": true - }, - "exclude": [ - "node_modules", - "tmp", - "dist" - ] -} diff --git a/frameworks/keyed/angularjs/index.html b/frameworks/keyed/angularjs/index.html deleted file mode 100755 index e9d197831..000000000 --- a/frameworks/keyed/angularjs/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - AngularJS - - - - - - - diff --git a/frameworks/keyed/angularjs/package.json b/frameworks/keyed/angularjs/package.json deleted file mode 100644 index e32cb8d43..000000000 --- a/frameworks/keyed/angularjs/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "js-framework-benchmark-angular", - "version": "1.0.0", - "description": "Boilerplate for Angular.js", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "angular" - }, - "scripts": { - "build-dev": "webpack -w", - "build-prod": "webpack -p" - }, - "keywords": [ - "angular" - ], - "author": "Stefan Krause", - "license": "Apache-2.0", - "homepage": "https://github.com/krausest/js-framework-benchmark", - "repository": { - "type": "git", - "url": "https://github.com/krausest/js-framework-benchmark.git" - }, - "devDependencies": { - "@babel/core": "7.2.2", - "@babel/preset-env": "7.3.1", - "babel-loader": "8.0.6", - "raw-loader": "3.0.0", - "webpack": "4.34.0", - "webpack-cli": "^3.3.4" - }, - "dependencies": { - "angular": "1.7.8" - } -} diff --git a/frameworks/keyed/angularjs/src/home.controller.js b/frameworks/keyed/angularjs/src/home.controller.js deleted file mode 100644 index b901c636c..000000000 --- a/frameworks/keyed/angularjs/src/home.controller.js +++ /dev/null @@ -1,62 +0,0 @@ - -export default class HomeController { - $onInit() { - this.start = 0; - this.data = []; - this.id = 1; - } - - buildData(count = 1000) { - const adjectives = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy"]; - const colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"]; - const nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"]; - const data = []; - for (let i = 0, len = count; i < len; i++) { - data.push({ id: this.id++, label: adjectives[this._random(adjectives.length)] + " " + colours[this._random(colours.length)] + " " + nouns[this._random(nouns.length)] }); - } - return data; - } - _random(max) { - return Math.round(Math.random() * 1000) % max; - } - add() { - this.start = performance.now(); - this.data = this.data.concat(this.buildData(1000)); - } - select(item) { - this.start = performance.now(); - this.selected = item.id; - } - del(item) { - this.start = performance.now(); - const idx = this.data.findIndex(d => d.id===item.id); - this.data.splice(idx, 1); - } - update() { - this.start = performance.now(); - for (let i=0;i 998) { - var a = this.data[1]; - this.data[1] = this.data[998]; - this.data[998] = a; - } - }; -}; \ No newline at end of file diff --git a/frameworks/keyed/angularjs/src/home.template.html b/frameworks/keyed/angularjs/src/home.template.html deleted file mode 100644 index 6e55eb175..000000000 --- a/frameworks/keyed/angularjs/src/home.template.html +++ /dev/null @@ -1,44 +0,0 @@ -
-
-
-
-

AngularJS

-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
-
- - - - - - - - - -
{{item.id}} - {{item.label}} -
- -
\ No newline at end of file diff --git a/frameworks/keyed/angularjs/src/main.js b/frameworks/keyed/angularjs/src/main.js deleted file mode 100644 index df23dc2bf..000000000 --- a/frameworks/keyed/angularjs/src/main.js +++ /dev/null @@ -1,20 +0,0 @@ -import angular from 'angular'; -import controller from './home.controller'; -import template from './home.template.html'; - -angular - .module('app', []) - .config(['$compileProvider', function ($compileProvider) { - $compileProvider.debugInfoEnabled(false); - }]) - .run(() => { - console.info(angular.version.full); - }) - .component('home', { - controller, - template, - }); - -angular.element(document).ready(() => { - angular.bootstrap(document.body, ['app'], { strictDi: true }); -}); \ No newline at end of file diff --git a/frameworks/keyed/angularjs/webpack.config.js b/frameworks/keyed/angularjs/webpack.config.js deleted file mode 100755 index 3c39de79c..000000000 --- a/frameworks/keyed/angularjs/webpack.config.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; -var path = require('path') - -module.exports = { - entry: { - main: './src/main' - }, - output: { - path: path.join(__dirname, 'dist'), - filename: 'main.js' - }, - module: { - rules: [ - { - test: /.js$/, - loader: 'babel-loader', - options: { - presets: ['@babel/preset-env'] - }, - }, - { - test: /\.html$/, - loader: 'raw-loader' - }, - ] - } -}; \ No newline at end of file diff --git a/frameworks/keyed/apprun/index.html b/frameworks/keyed/apprun/index.html deleted file mode 100644 index bc13c5f7b..000000000 --- a/frameworks/keyed/apprun/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - AppRun - - - -
- - - diff --git a/frameworks/keyed/apprun/package.json b/frameworks/keyed/apprun/package.json deleted file mode 100644 index 7de482515..000000000 --- a/frameworks/keyed/apprun/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "js-framework-benchmark-apprun-v2.23.10", - "version": "1.0.0", - "description": "AppRun demo", - "main": "index.js", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "apprun" - }, - "scripts": { - "build-dev": "webpack -w -d", - "build-prod": "webpack -p" - }, - "keywords": [ - "apprun", - "js benmarks" - ], - "author": "Yiyi Sun { - const rows = model.data.map((curr) => { - const selected = curr.id == model.selected ? 'danger' : undefined; - const id = curr.id; - return - {id} - - {curr.label} - - - - - - - - ; - }); - - return (
-
-
-
-

AppRun

-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
-
- - - {rows} - -
- -
); -} - -const getId = (elem) => { - while (elem) { - if (elem.tagName === "TR") { - return elem.id; - } - elem = elem.parentNode; - } - return undefined; -} - -const click = (e) => { - const t = e.target as HTMLElement; - if (!t) return; - if (t.tagName === 'BUTTON' && t.id) { - e.preventDefault(); - component.run(t.id); - } else if (t.matches('.remove')) { - e.preventDefault(); - component.run('remove', getId(t)); - } else if (t.matches('.lbl')) { - e.preventDefault(); - component.run('select', getId(t)); - } -}; - -const component = new Component(store, view, update); -component['-patch-vdom-on'] = true; -component.rendered = () => { - store.selected && (document.getElementById(store.selected).className = 'danger'); -} -component.start(document.getElementById('main')); diff --git a/frameworks/keyed/apprun/src/store.ts b/frameworks/keyed/apprun/src/store.ts deleted file mode 100644 index 6050c30ef..000000000 --- a/frameworks/keyed/apprun/src/store.ts +++ /dev/null @@ -1,72 +0,0 @@ -function _random(max) { - return Math.round(Math.random()*1000)%max; -} - -export default class Store { - data = []; - backup = null; - selected = null; - id = 1; - constructor() { - } - buildData(count = 1000) { - var adjectives = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy"]; - var colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"]; - var nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"]; - var data = []; - for (var i = 0; i < count; i++) - data.push({id: this.id++, label: adjectives[_random(adjectives.length)] + " " + colours[_random(colours.length)] + " " + nouns[_random(nouns.length)] }); - return data; - } - updateData(mod = 10) { - for (let i=0;i d.id==id); - this.data = this.data.filter((e, i) => e.id != id); - if (id === this.selected) this.selected = null; - } - run() { - this.data = this.buildData(); - this.selected = null; - } - add() { - this.data = this.data.concat(this.buildData(1000)); - this.selected = null; - } - update() { - this.updateData(); - } - select(id) { - this.selected = id; - } - hideAll() { - this.backup = this.data; - this.data = []; - this.selected = null; - } - showAll() { - this.data = this.backup; - this.backup = null; - this.selected = null; - } - runLots() { - this.data = this.buildData(10000); - this.selected = null; - } - clear() { - this.data = []; - this.selected = null; - } - swapRows() { - if (this.data.length > 4) { - var idx = this.data.length - 2; - var a = this.data[1]; - this.data[1] = this.data[idx]; - this.data[idx] = a; - } - } -} \ No newline at end of file diff --git a/frameworks/keyed/apprun/tsconfig.json b/frameworks/keyed/apprun/tsconfig.json deleted file mode 100644 index c7df68076..000000000 --- a/frameworks/keyed/apprun/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "compilerOptions": { - "target": "es2015", - "module": "es2015", - "moduleResolution": "node", - "jsx": "react", - "reactNamespace": "app", - "lib": ["dom", "es2015.promise", "es5"] - } -} \ No newline at end of file diff --git a/frameworks/keyed/apprun/webpack.config.js b/frameworks/keyed/apprun/webpack.config.js deleted file mode 100644 index f7bea084f..000000000 --- a/frameworks/keyed/apprun/webpack.config.js +++ /dev/null @@ -1,20 +0,0 @@ -var path = require('path') - -module.exports = { - entry: { - 'main': './src/main.tsx', - }, - output: { - path: path.resolve(__dirname, "dist"), - filename: '[name].js' - }, - resolve: { - extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js'] - }, - module: { - rules: [ - { test: /\.tsx?$/, loader: 'ts-loader' }, - { test: /\.json$/, loader: 'json-loader' } - ] - } -} \ No newline at end of file diff --git a/frameworks/keyed/attodom/.editorconfig b/frameworks/keyed/attodom/.editorconfig deleted file mode 100644 index dd7255e8a..000000000 --- a/frameworks/keyed/attodom/.editorconfig +++ /dev/null @@ -1,8 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true diff --git a/frameworks/keyed/attodom/index.html b/frameworks/keyed/attodom/index.html deleted file mode 100644 index b49eea7d0..000000000 --- a/frameworks/keyed/attodom/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - attodom - - - - - - diff --git a/frameworks/keyed/attodom/index.js b/frameworks/keyed/attodom/index.js deleted file mode 100644 index dbf0dae48..000000000 --- a/frameworks/keyed/attodom/index.js +++ /dev/null @@ -1,8 +0,0 @@ -/*eslint indent: ["warn", 2, { "VariableDeclarator": 2 }]*/ - -var Store = require('./src/store'), - View = require('./src/view') - -var view = View(new Store) -view.update() -document.body.appendChild(view) diff --git a/frameworks/keyed/attodom/package.json b/frameworks/keyed/attodom/package.json deleted file mode 100644 index 8c1860186..000000000 --- a/frameworks/keyed/attodom/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "js-framework-benchmark-attodom", - "version": "0.12.0", - "description": "Benchmark for attodom", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "attodom" - }, - "scripts": { - "build-dev": "node -e \"require('@hugov/cjs-to-iife')('./index.js').then(code => {if (!fs.existsSync('./dist')) {fs.mkdirSync('./dist');} fs.writeFileSync('./dist/main.js', code); })\"", - "build-prod": "npm run build-dev && uglifyjs ./dist/main.js -c -m -o ./dist/main.js" - }, - "author": "Hugo Villeneuve", - "license": "Apache-2.0", - "homepage": "https://github.com/krausest/js-framework-benchmark", - "repository": { - "type": "git", - "url": "https://github.com/krausest/js-framework-benchmark.git" - }, - "devDependencies": { - "@hugov/cjs-to-iife": "^0.1.3", - "@types/node": "^12.0.8", - "uglify-js": "3.6.0" - }, - "dependencies": { - "attodom": "^0.12.0" - } -} diff --git a/frameworks/keyed/attodom/src/store.js b/frameworks/keyed/attodom/src/store.js deleted file mode 100644 index 539e5b189..000000000 --- a/frameworks/keyed/attodom/src/store.js +++ /dev/null @@ -1,87 +0,0 @@ -/*eslint indent: ["warn", 2, { "VariableDeclarator": 2 }]*/ -/*eslint quotes:0*/ -function _random(max) { - return Math.round(Math.random()*1000)%max -} - -module.exports = Store - -function Store() { - this.data = [] - this.backup = null - this.selected = null - this.id = 1 -} - -Store.prototype.buildData = function(count) { - if (!(count >=0)) count = 1000 - var adjectives = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy"] - var colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"] - var nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"] - var data = [] - for (var i=0; i < count; ++i) - data.push({id: this.id++, label: adjectives[_random(adjectives.length)] + " " + colours[_random(colours.length)] + " " + nouns[_random(nouns.length)] }) - return data -} - -Store.prototype.updateData = function(mod) { - if (!(mod >=0)) mod = 1000 - for (var i=0; i 998) { - var a = this.data[1] - this.data[1] = this.data[998] - this.data[998] = a - } -} diff --git a/frameworks/keyed/attodom/src/view.js b/frameworks/keyed/attodom/src/view.js deleted file mode 100644 index e475d4579..000000000 --- a/frameworks/keyed/attodom/src/view.js +++ /dev/null @@ -1,86 +0,0 @@ -/*eslint indent: ["warn", 2, { "VariableDeclarator": 2 }]*/ -var h = require('attodom/el'), - list = require('attodom/list') - -var TITLE = 'attodom v0.12.0' - -module.exports = function(store) { - function clickHandlerMenu(e) { - var key = e.target.id - if (key) { - e.preventDefault() - store[key === 'runlots' ? 'runLots' : key === 'swaprows' ? 'swapRows' : key]() - rowList.update(store.data) - } - } - - function updateRow(v) { - if (this.$label.data !== v.label) this.$label.data = v.label - var className = (this.id === store.selected) ? 'danger' : '' - if (this.className !== className) this.className = className - } - - function makeRow(rec) { - var $label - var row = h('tr', - h('td', {class: 'col-md-1'}, rec.id), - h('td', {class: 'col-md-4', onClick: clickHandlerSelect}, - h('a', {class: 'lbl'}, $label = document.createTextNode(rec.label)) - ), - h('td', {class: 'col-md-1', onClick: clickHandlerDelete}, - h('a', {class: 'remove'}, - h('span', {class: 'glyphicon glyphicon-remove remove', 'aria-hidden': 'true'}) - ) - ), - h('td', {class: 'col-md-6'}) - ) - row.id = rec.id - row.update = updateRow - row.$label = $label - return row - } - - function clickHandlerSelect(e) { - e.preventDefault() - store.select(this.parentNode.id) - rowList.update(store.data) - } - - function clickHandlerDelete(e) { - e.preventDefault() - store.delete(+this.parentNode.id) - rowList.update(store.data) - } - - var rowList = list(h('tbody', {id: 'tbody'}), makeRow, {key: 'id'}) - - return h('div', {id: 'main', update: function() { rowList.update(store.data) }}, - h('div', {class: 'container'}, - h('div', {class: 'jumbotron'}, - h('div', {class: 'row'}, - h('div', {class: 'col-md-6'}, - h('h1', TITLE) - ), - h('div', {class: 'col-md-6'}, - h('div', {class: 'row', onclick: clickHandlerMenu}, - button('run', 'Create 1,000 rows'), - button('runlots', 'Create 10,000 rows'), - button('add', 'Append 1,000 rows'), - button('update', 'Update every 10th row'), - button('clear', 'Clear'), - button('swaprows', 'Swap Rows') - ) - ) - ) - ), - h('table', {class: 'table table-hover table-striped test-data'}, rowList.parent), - h('span', {class: 'preloadicon glyphicon glyphicon-remove', 'aria-hidden': ''}) - ) - ) -} - -function button(id, tx) { - return h('div', {class: 'col-sm-6 smallpad'}, - h('button', {id: id, class: 'btn btn-primary btn-block', type: 'button'}, tx) - ) -} diff --git a/frameworks/keyed/aurelia/.babelrc b/frameworks/keyed/aurelia/.babelrc deleted file mode 100755 index 2b0041b33..000000000 --- a/frameworks/keyed/aurelia/.babelrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "sourceMap": true, - "sourceRoot": "src", - "moduleIds": false, - "comments": false, - "compact": false, - "code": true, - "presets": [ - ["es2015", {"loose": true}], - "stage-1" - ], - "plugins": [ - "syntax-flow", - "transform-decorators-legacy", - "transform-flow-strip-types" - ] -} diff --git a/frameworks/keyed/aurelia/.gitignore b/frameworks/keyed/aurelia/.gitignore deleted file mode 100644 index 12448646b..000000000 --- a/frameworks/keyed/aurelia/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -scripts -src/environment.js \ No newline at end of file diff --git a/frameworks/keyed/aurelia/aurelia_project/aurelia.json b/frameworks/keyed/aurelia/aurelia_project/aurelia.json deleted file mode 100644 index db9fe05d9..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/aurelia.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "name": "aurelia-v1.1.2-non-keyed", - "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" - } -} \ No newline at end of file diff --git a/frameworks/keyed/aurelia/aurelia_project/environments/dev.js b/frameworks/keyed/aurelia/aurelia_project/environments/dev.js deleted file mode 100644 index f346d5a79..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/environments/dev.js +++ /dev/null @@ -1,3 +0,0 @@ -export default { - debug: true -}; diff --git a/frameworks/keyed/aurelia/aurelia_project/environments/prod.js b/frameworks/keyed/aurelia/aurelia_project/environments/prod.js deleted file mode 100644 index 0159bfda3..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/environments/prod.js +++ /dev/null @@ -1,3 +0,0 @@ -export default { - debug: false -}; diff --git a/frameworks/keyed/aurelia/aurelia_project/environments/stage.js b/frameworks/keyed/aurelia/aurelia_project/environments/stage.js deleted file mode 100644 index f346d5a79..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/environments/stage.js +++ /dev/null @@ -1,3 +0,0 @@ -export default { - debug: true -}; diff --git a/frameworks/keyed/aurelia/aurelia_project/generators/attribute.js b/frameworks/keyed/aurelia/aurelia_project/generators/attribute.js deleted file mode 100644 index 7be503935..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/generators/attribute.js +++ /dev/null @@ -1,44 +0,0 @@ -import {inject} from 'aurelia-dependency-injection'; -import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; - -@inject(Project, CLIOptions, UI) -export default class AttributeGenerator { - constructor(project, options, ui) { - this.project = project; - this.options = options; - this.ui = ui; - } - - execute() { - return this.ui - .ensureAnswer(this.options.args[0], 'What would you like to call the custom attribute?') - .then(name => { - let fileName = this.project.makeFileName(name); - let className = this.project.makeClassName(name); - - this.project.attributes.add( - ProjectItem.text(`${fileName}.js`, this.generateSource(className)) - ); - - return this.project.commitChanges() - .then(() => this.ui.log(`Created ${fileName}.`)); - }); - } - - generateSource(className) { - return `import {inject} from 'aurelia-framework'; - -@inject(Element) -export class ${className}CustomAttribute { - constructor(element) { - this.element = element; - } - - valueChanged(newValue, oldValue) { - - } -} - -`; - } -} diff --git a/frameworks/keyed/aurelia/aurelia_project/generators/attribute.json b/frameworks/keyed/aurelia/aurelia_project/generators/attribute.json deleted file mode 100644 index ddf940c55..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/generators/attribute.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "attribute", - "description": "Creates a custom attribute class and places it in the project resources." -} diff --git a/frameworks/keyed/aurelia/aurelia_project/generators/binding-behavior.js b/frameworks/keyed/aurelia/aurelia_project/generators/binding-behavior.js deleted file mode 100644 index 8726a1083..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/generators/binding-behavior.js +++ /dev/null @@ -1,41 +0,0 @@ -import {inject} from 'aurelia-dependency-injection'; -import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; - -@inject(Project, CLIOptions, UI) -export default class BindingBehaviorGenerator { - constructor(project, options, ui) { - this.project = project; - this.options = options; - this.ui = ui; - } - - execute() { - return this.ui - .ensureAnswer(this.options.args[0], 'What would you like to call the binding behavior?') - .then(name => { - let fileName = this.project.makeFileName(name); - let className = this.project.makeClassName(name); - - this.project.bindingBehaviors.add( - ProjectItem.text(`${fileName}.js`, this.generateSource(className)) - ); - - return this.project.commitChanges() - .then(() => this.ui.log(`Created ${fileName}.`)); - }); - } - - generateSource(className) { - return `export class ${className}BindingBehavior { - bind(binding, source) { - - } - - unbind(binding, source) { - - } -} - -` - } -} diff --git a/frameworks/keyed/aurelia/aurelia_project/generators/binding-behavior.json b/frameworks/keyed/aurelia/aurelia_project/generators/binding-behavior.json deleted file mode 100644 index 60906a174..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/generators/binding-behavior.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "binding-behavior", - "description": "Creates a binding behavior class and places it in the project resources." -} diff --git a/frameworks/keyed/aurelia/aurelia_project/generators/component.js b/frameworks/keyed/aurelia/aurelia_project/generators/component.js deleted file mode 100644 index 8f381c780..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/generators/component.js +++ /dev/null @@ -1,51 +0,0 @@ -import { inject } from 'aurelia-dependency-injection'; -import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli'; - -var path = require('path'); - -@inject(Project, CLIOptions, UI) -export default class ElementGenerator { - constructor(project, options, ui) { - this.project = project; - this.options = options; - this.ui = ui; - } - - execute() { - let self = this; - - return this.ui - .ensureAnswer(this.options.args[0], 'What would you like to call the component?') - .then(name => { - - return self.ui.ensureAnswer(this.options.args[1], 'What sub-folder would you like to add it to?\nIf it doesn\'t exist it will be created for you.\n\nDefault folder is the source folder (src).', ".") - .then(subFolders => { - - let fileName = this.project.makeFileName(name); - let className = this.project.makeClassName(name); - - self.project.root.add( - ProjectItem.text(path.join(subFolders, fileName + ".js"), this.generateJSSource(className)), - ProjectItem.text(path.join(subFolders, fileName + ".html"), this.generateHTMLSource(className)) - ); - - return this.project.commitChanges() - .then(() => this.ui.log(`Created ${name} in the '${path.join(self.project.root.name, subFolders)}' folder`)); - }); - }); - } - - generateJSSource(className) { - return `export class ${className} { - constructor() { - this.message = 'Hello world'; - } -}` - } - - generateHTMLSource(className) { - return `` - } -} \ No newline at end of file diff --git a/frameworks/keyed/aurelia/aurelia_project/generators/component.json b/frameworks/keyed/aurelia/aurelia_project/generators/component.json deleted file mode 100644 index ec3907561..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/generators/component.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "component", - "description": "Creates a custom component class and template (view model and view), placing them in the project source folder (or optionally in sub folders)." -} \ No newline at end of file diff --git a/frameworks/keyed/aurelia/aurelia_project/generators/element.js b/frameworks/keyed/aurelia/aurelia_project/generators/element.js deleted file mode 100644 index a1b48b9c1..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/generators/element.js +++ /dev/null @@ -1,48 +0,0 @@ -import {inject} from 'aurelia-dependency-injection'; -import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; - -@inject(Project, CLIOptions, UI) -export default class ElementGenerator { - constructor(project, options, ui) { - this.project = project; - this.options = options; - this.ui = ui; - } - - execute() { - return this.ui - .ensureAnswer(this.options.args[0], 'What would you like to call the custom element?') - .then(name => { - let fileName = this.project.makeFileName(name); - let className = this.project.makeClassName(name); - - this.project.elements.add( - ProjectItem.text(`${fileName}.js`, this.generateJSSource(className)), - ProjectItem.text(`${fileName}.html`, this.generateHTMLSource(className)) - ); - - return this.project.commitChanges() - .then(() => this.ui.log(`Created ${fileName}.`)); - }); - } - - generateJSSource(className) { - return `import {bindable} from 'aurelia-framework'; - -export class ${className} { - @bindable value; - - valueChanged(newValue, oldValue) { - - } -} - -`; - } - - generateHTMLSource(className) { - return ``; - } -} diff --git a/frameworks/keyed/aurelia/aurelia_project/generators/element.json b/frameworks/keyed/aurelia/aurelia_project/generators/element.json deleted file mode 100644 index 68d8c54e0..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/generators/element.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "element", - "description": "Creates a custom element class and template, placing them in the project resources." -} diff --git a/frameworks/keyed/aurelia/aurelia_project/generators/generator.js b/frameworks/keyed/aurelia/aurelia_project/generators/generator.js deleted file mode 100644 index 416284286..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/generators/generator.js +++ /dev/null @@ -1,73 +0,0 @@ -import {inject} from 'aurelia-dependency-injection'; -import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; - -@inject(Project, CLIOptions, UI) -export default class GeneratorGenerator { - constructor(project, options, ui) { - this.project = project; - this.options = options; - this.ui = ui; - } - - execute() { - return this.ui - .ensureAnswer(this.options.args[0], 'What would you like to call the generator?') - .then(name => { - let fileName = this.project.makeFileName(name); - let className = this.project.makeClassName(name); - - this.project.generators.add( - ProjectItem.text(`${fileName}.js`, this.generateSource(className)) - ); - - return this.project.commitChanges() - .then(() => this.ui.log(`Created ${fileName}.`)); - }); - } - - generateSource(className) { - return `import {inject} from 'aurelia-dependency-injection'; -import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; - -@inject(Project, CLIOptions, UI) -export default class ${className}Generator { - constructor(project, options, ui) { - this.project = project; - this.options = options; - this.ui = ui; - } - - execute() { - return this.ui - .ensureAnswer(this.options.args[0], 'What would you like to call the new item?') - .then(name => { - let fileName = this.project.makeFileName(name); - let className = this.project.makeClassName(name); - - this.project.elements.add( - ProjectItem.text(\`\${fileName}.js\`, this.generateSource(className)) - ); - - return this.project.commitChanges() - .then(() => this.ui.log(\`Created \${fileName}.\`)); - }); - } - - generateSource(className) { -return \`import {bindable} from 'aurelia-framework'; - -export class \${className} { - @bindable value; - - valueChanged(newValue, oldValue) { - - } -} - -\` - } -} - -`; - } -} diff --git a/frameworks/keyed/aurelia/aurelia_project/generators/generator.json b/frameworks/keyed/aurelia/aurelia_project/generators/generator.json deleted file mode 100644 index be946a5a9..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/generators/generator.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "generator", - "description": "Creates a generator class and places it in the project generators folder." -} diff --git a/frameworks/keyed/aurelia/aurelia_project/generators/task.js b/frameworks/keyed/aurelia/aurelia_project/generators/task.js deleted file mode 100644 index a70f10b65..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/generators/task.js +++ /dev/null @@ -1,41 +0,0 @@ -import {inject} from 'aurelia-dependency-injection'; -import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; - -@inject(Project, CLIOptions, UI) -export default class TaskGenerator { - constructor(project, options, ui) { - this.project = project; - this.options = options; - this.ui = ui; - } - - execute() { - return this.ui - .ensureAnswer(this.options.args[0], 'What would you like to call the task?') - .then(name => { - let fileName = this.project.makeFileName(name); - let functionName = this.project.makeFunctionName(name); - - this.project.tasks.add( - ProjectItem.text(`${fileName}.js`, this.generateSource(functionName)) - ); - - return this.project.commitChanges() - .then(() => this.ui.log(`Created ${fileName}.`)); - }); - } - - generateSource(functionName) { - return `import gulp from 'gulp'; -import changed from 'gulp-changed'; -import project from '../aurelia.json'; - -export default function ${functionName}() { - return gulp.src(project.paths.???) - .pipe(changed(project.paths.output, {extension: '.???'})) - .pipe(gulp.dest(project.paths.output)); -} - -`; - } -} diff --git a/frameworks/keyed/aurelia/aurelia_project/generators/task.json b/frameworks/keyed/aurelia/aurelia_project/generators/task.json deleted file mode 100644 index fd15bc626..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/generators/task.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "task", - "description": "Creates a task and places it in the project tasks folder." -} diff --git a/frameworks/keyed/aurelia/aurelia_project/generators/value-converter.js b/frameworks/keyed/aurelia/aurelia_project/generators/value-converter.js deleted file mode 100644 index df7997106..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/generators/value-converter.js +++ /dev/null @@ -1,41 +0,0 @@ -import {inject} from 'aurelia-dependency-injection'; -import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; - -@inject(Project, CLIOptions, UI) -export default class ValueConverterGenerator { - constructor(project, options, ui) { - this.project = project; - this.options = options; - this.ui = ui; - } - - execute() { - return this.ui - .ensureAnswer(this.options.args[0], 'What would you like to call the value converter?') - .then(name => { - let fileName = this.project.makeFileName(name); - let className = this.project.makeClassName(name); - - this.project.valueConverters.add( - ProjectItem.text(`${fileName}.js`, this.generateSource(className)) - ); - - return this.project.commitChanges() - .then(() => this.ui.log(`Created ${fileName}.`)); - }); - } - - generateSource(className) { - return `export class ${className}ValueConverter { - toView(value) { - - } - - fromView(value) { - - } -} - -`; - } -} diff --git a/frameworks/keyed/aurelia/aurelia_project/generators/value-converter.json b/frameworks/keyed/aurelia/aurelia_project/generators/value-converter.json deleted file mode 100644 index 11081226c..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/generators/value-converter.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "value-converter", - "description": "Creates a value converter class and places it in the project resources." -} diff --git a/frameworks/keyed/aurelia/aurelia_project/tasks/build.js b/frameworks/keyed/aurelia/aurelia_project/tasks/build.js deleted file mode 100644 index a1ea53966..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/tasks/build.js +++ /dev/null @@ -1,40 +0,0 @@ -import gulp from 'gulp'; -import {CLIOptions, build as buildCLI} from 'aurelia-cli'; -import transpile from './transpile'; -import processMarkup from './process-markup'; -import processCSS from './process-css'; -import copyFiles from './copy-files'; -import watch from './watch'; -import project from '../aurelia.json'; - -let build = gulp.series( - readProjectConfiguration, - gulp.parallel( - transpile, - processMarkup, - processCSS, - copyFiles - ), - writeBundles -); - -let main; - -if (CLIOptions.taskName() === 'build' && CLIOptions.hasFlag('watch')) { - main = gulp.series( - build, - (done) => { watch(); done(); } - ); -} else { - main = build; -} - -function readProjectConfiguration() { - return buildCLI.src(project); -} - -function writeBundles() { - return buildCLI.dest(); -} - -export { main as default }; diff --git a/frameworks/keyed/aurelia/aurelia_project/tasks/build.json b/frameworks/keyed/aurelia/aurelia_project/tasks/build.json deleted file mode 100644 index ada5ca483..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/tasks/build.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "build", - "description": "Builds and processes all application assets.", - "flags": [ - { - "name": "env", - "description": "Sets the build environment.", - "type": "string" - }, - { - "name": "watch", - "description": "Watches source files for changes and refreshes the bundles automatically.", - "type": "boolean" - } - ] -} diff --git a/frameworks/keyed/aurelia/aurelia_project/tasks/copy-files.js b/frameworks/keyed/aurelia/aurelia_project/tasks/copy-files.js deleted file mode 100644 index 61a24d174..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/tasks/copy-files.js +++ /dev/null @@ -1,45 +0,0 @@ -import gulp from 'gulp'; -import path from 'path'; -import minimatch from 'minimatch'; -import changedInPlace from 'gulp-changed-in-place'; -import project from '../aurelia.json'; - -export default function copyFiles(done) { - if (typeof project.build.copyFiles !== 'object') { - done(); - return; - } - - const instruction = getNormalizedInstruction(); - const files = Object.keys(instruction); - - return gulp.src(files) - .pipe(changedInPlace({ firstPass: true })) - .pipe(gulp.dest(x => { - const filePath = prepareFilePath(x.path); - const key = files.find(f => minimatch(filePath, f)); - return instruction[key]; - })); -} - -function getNormalizedInstruction() { - const files = project.build.copyFiles; - let normalizedInstruction = {}; - - for (let key in files) { - normalizedInstruction[path.posix.normalize(key)] = files[key]; - } - - return normalizedInstruction; -} - -function prepareFilePath(filePath) { - let preparedPath = filePath.replace(process.cwd(), '').substring(1); - - //if we are running on windows we have to fix the path - if (/^win/.test(process.platform)) { - preparedPath = preparedPath.replace(/\\/g, '/'); - } - - return preparedPath; -} diff --git a/frameworks/keyed/aurelia/aurelia_project/tasks/lint.js b/frameworks/keyed/aurelia/aurelia_project/tasks/lint.js deleted file mode 100644 index e5d5f9d7d..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/tasks/lint.js +++ /dev/null @@ -1,10 +0,0 @@ -import gulp from 'gulp'; -import eslint from 'gulp-eslint'; -import project from '../aurelia.json'; - -export default function lint() { - return gulp.src([project.transpiler.source]) - .pipe(eslint()) - .pipe(eslint.format()) - .pipe(eslint.failAfterError()); -} diff --git a/frameworks/keyed/aurelia/aurelia_project/tasks/process-css.js b/frameworks/keyed/aurelia/aurelia_project/tasks/process-css.js deleted file mode 100644 index 5557344e6..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/tasks/process-css.js +++ /dev/null @@ -1,10 +0,0 @@ -import gulp from 'gulp'; -import changedInPlace from 'gulp-changed-in-place'; -import project from '../aurelia.json'; -import {build} from 'aurelia-cli'; - -export default function processCSS() { - return gulp.src(project.cssProcessor.source) - .pipe(changedInPlace({firstPass: true})) - .pipe(build.bundle()); -} diff --git a/frameworks/keyed/aurelia/aurelia_project/tasks/process-markup.js b/frameworks/keyed/aurelia/aurelia_project/tasks/process-markup.js deleted file mode 100644 index 451727682..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/tasks/process-markup.js +++ /dev/null @@ -1,21 +0,0 @@ -import gulp from 'gulp'; -import htmlmin from 'gulp-htmlmin'; -import plumber from 'gulp-plumber'; -import notify from 'gulp-notify'; -import changedInPlace from 'gulp-changed-in-place'; -import project from '../aurelia.json'; -import {build} from 'aurelia-cli'; - -export default function processMarkup() { - return gulp.src(project.markupProcessor.source) - .pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')})) - .pipe(changedInPlace({firstPass:true})) - .pipe(htmlmin({ - removeComments: true, - collapseWhitespace: true, - minifyCSS: true, - minifyJS: true, - ignoreCustomFragments: [/\${.*?}/g] // ignore interpolation expressions - })) - .pipe(build.bundle()); -} \ No newline at end of file diff --git a/frameworks/keyed/aurelia/aurelia_project/tasks/run.js b/frameworks/keyed/aurelia/aurelia_project/tasks/run.js deleted file mode 100644 index 12fad9d69..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/tasks/run.js +++ /dev/null @@ -1,54 +0,0 @@ -import gulp from 'gulp'; -import browserSync from 'browser-sync'; -import historyApiFallback from 'connect-history-api-fallback/lib'; -import {CLIOptions} from 'aurelia-cli'; -import project from '../aurelia.json'; -import build from './build'; -import watch from './watch'; - -let serve = gulp.series( - build, - done => { - browserSync({ - online: false, - open: false, - port: 9000, - logLevel: 'silent', - server: { - baseDir: [project.platform.baseDir], - middleware: [historyApiFallback(), function(req, res, next) { - res.setHeader('Access-Control-Allow-Origin', '*'); - next(); - }] - } - }, function (err, bs) { - if (err) return done(err); - let urls = bs.options.get('urls').toJS(); - log(`Application Available At: ${urls.local}`); - log(`BrowserSync Available At: ${urls.ui}`); - done(); - }); - } -); - -function log(message) { - console.log(message); //eslint-disable-line no-console -} - -function reload() { - log('Refreshing the browser'); - browserSync.reload(); -} - -let run; - -if (CLIOptions.hasFlag('watch')) { - run = gulp.series( - serve, - done => { watch(reload); done(); } - ); -} else { - run = serve; -} - -export default run; diff --git a/frameworks/keyed/aurelia/aurelia_project/tasks/run.json b/frameworks/keyed/aurelia/aurelia_project/tasks/run.json deleted file mode 100644 index 6f617e4b6..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/tasks/run.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "run", - "description": "Builds the application and serves up the assets via a local web server, watching files for changes as you work.", - "flags": [ - { - "name": "env", - "description": "Sets the build environment.", - "type": "string" - }, - { - "name": "watch", - "description": "Watches source files for changes and refreshes the app automatically.", - "type": "boolean" - } - ] -} diff --git a/frameworks/keyed/aurelia/aurelia_project/tasks/transpile.js b/frameworks/keyed/aurelia/aurelia_project/tasks/transpile.js deleted file mode 100644 index 3c5df7305..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/tasks/transpile.js +++ /dev/null @@ -1,32 +0,0 @@ -import gulp from 'gulp'; -import changedInPlace from 'gulp-changed-in-place'; -import plumber from 'gulp-plumber'; -import babel from 'gulp-babel'; -import sourcemaps from 'gulp-sourcemaps'; -import notify from 'gulp-notify'; -import rename from 'gulp-rename'; -import project from '../aurelia.json'; -import {CLIOptions, build} from 'aurelia-cli'; - -function configureEnvironment() { - let env = CLIOptions.getEnvironment(); - - return gulp.src(`aurelia_project/environments/${env}.js`) - .pipe(changedInPlace({firstPass: true})) - .pipe(rename('environment.js')) - .pipe(gulp.dest(project.paths.root)); -} - -function buildJavaScript() { - return gulp.src(project.transpiler.source) - .pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')})) - .pipe(changedInPlace({firstPass: true})) - .pipe(sourcemaps.init()) - .pipe(babel(project.transpiler.options)) - .pipe(build.bundle()); -} - -export default gulp.series( - configureEnvironment, - buildJavaScript -); diff --git a/frameworks/keyed/aurelia/aurelia_project/tasks/watch.js b/frameworks/keyed/aurelia/aurelia_project/tasks/watch.js deleted file mode 100644 index 9df951649..000000000 --- a/frameworks/keyed/aurelia/aurelia_project/tasks/watch.js +++ /dev/null @@ -1,128 +0,0 @@ -import gulp from 'gulp'; -import minimatch from 'minimatch'; -import gulpWatch from 'gulp-watch'; -import debounce from 'debounce'; -import { build } from 'aurelia-cli'; -import project from '../aurelia.json'; -import transpile from './transpile'; -import processMarkup from './process-markup'; -import processCSS from './process-css'; -import copyFiles from './copy-files'; - -const debounceWaitTime = 100; -let isBuilding = false; -let pendingRefreshPaths = []; -let watchCallback = () => { }; -let watches = [ - { name: 'transpile', callback: transpile, source: project.transpiler.source }, - { name: 'markup', callback: processMarkup, source: project.markupProcessor.source }, - { name: 'CSS', callback: processCSS, source: project.cssProcessor.source } -]; - -if (typeof project.build.copyFiles === 'object') { - for (let src of Object.keys(project.build.copyFiles)) { - watches.push({ name: 'file copy', callback: copyFiles, source: src }); - } -} - -let watch = (callback) => { - watchCallback = callback || watchCallback; - - // watch every glob individually - for(let watcher of watches) { - if (Array.isArray(watcher.source)) { - for(let glob of watcher.source) { - watchPath(glob); - } - } else { - watchPath(watcher.source); - } - } -}; - -let watchPath = (p) => { - gulpWatch( - p, - { - read: false, // performance optimization: do not read actual file contents - verbose: true - }, - (vinyl) => processChange(vinyl)); -}; - -let processChange = (vinyl) => { - if (vinyl.path && vinyl.cwd && vinyl.path.startsWith(vinyl.cwd)) { - let pathToAdd = vinyl.path.substr(vinyl.cwd.length + 1); - log(`Watcher: Adding path ${pathToAdd} to pending build changes...`); - pendingRefreshPaths.push(pathToAdd); - refresh(); - } -} - -let refresh = debounce(() => { - if (isBuilding) { - log('Watcher: A build is already in progress, deferring change detection...'); - return; - } - - isBuilding = true; - - let paths = pendingRefreshPaths.splice(0); - let refreshTasks = []; - - // determine which tasks need to be executed - // based on the files that have changed - for (let watcher of watches) { - if (Array.isArray(watcher.source)) { - for(let source of watcher.source) { - if (paths.find(path => minimatch(path, source))) { - refreshTasks.push(watcher); - } - } - } - else { - if (paths.find(path => minimatch(path, watcher.source))) { - refreshTasks.push(watcher); - } - } - } - - if (refreshTasks.length === 0) { - log('Watcher: No relevant changes found, skipping next build.'); - isBuilding = false; - return; - } - - log(`Watcher: Running ${refreshTasks.map(x => x.name).join(', ')} tasks on next build...`); - - let toExecute = gulp.series( - readProjectConfiguration, - gulp.parallel(refreshTasks.map(x => x.callback)), - writeBundles, - (done) => { - isBuilding = false; - watchCallback(); - done(); - if (pendingRefreshPaths.length > 0) { - log('Watcher: Found more pending changes after finishing build, triggering next one...'); - refresh(); - } - } - ); - - toExecute(); -}, debounceWaitTime); - -function log(message) { - console.log(message); -} - -function readProjectConfiguration() { - return build.src(project); -} - -function writeBundles() { - return build.dest(); -} - -export default watch; \ No newline at end of file diff --git a/frameworks/keyed/aurelia/favicon.ico b/frameworks/keyed/aurelia/favicon.ico deleted file mode 100755 index 9bd337167..000000000 Binary files a/frameworks/keyed/aurelia/favicon.ico and /dev/null differ diff --git a/frameworks/keyed/aurelia/index.html b/frameworks/keyed/aurelia/index.html deleted file mode 100755 index 52393262e..000000000 --- a/frameworks/keyed/aurelia/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - Aurelia - - - - - - - - diff --git a/frameworks/keyed/aurelia/jsconfig.json b/frameworks/keyed/aurelia/jsconfig.json deleted file mode 100755 index dd9df72d1..000000000 --- a/frameworks/keyed/aurelia/jsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "target": "es2015", - "lib": ["es2017", "dom"], - "experimentalDecorators": true - }, - "exclude": [ - "node_modules", - "dist" - ] -} diff --git a/frameworks/keyed/aurelia/package.json b/frameworks/keyed/aurelia/package.json deleted file mode 100644 index 3bc47692c..000000000 --- a/frameworks/keyed/aurelia/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "js-framework-benchmark-aurelia", - "version": "1.0.0", - "description": "Benchmark for aurelia framework", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "aurelia-framework", - "issues": [694] - }, - "keywords": [ - "aurelia" - ], - "author": "Stefan Krause", - "license": "Apache-2.0", - "homepage": "https://github.com/krausest/js-framework-benchmark", - "scripts": { - "build-dev": "aurelia build --env dev", - "build-prod": "aurelia build --env prod" - }, - "dependencies": { - "aurelia-binding": "2.1.2", - "aurelia-bootstrapper": "2.3.0", - "aurelia-dependency-injection": "1.4.1", - "aurelia-framework": "1.3.0", - "aurelia-loader": "1.0.0", - "aurelia-loader-default": "1.0.4", - "aurelia-logging": "1.5.0", - "aurelia-logging-console": "1.0.0", - "aurelia-metadata": "1.0.4", - "aurelia-pal": "1.8.0", - "aurelia-pal-browser": "1.8.0", - "aurelia-path": "1.1.1", - "aurelia-task-queue": "1.3.1", - "aurelia-templating": "1.8.2", - "aurelia-templating-binding": "1.4.3", - "aurelia-templating-resources": "1.7.1", - "requirejs": "2.3.5", - "text": "github:requirejs/text#2.0.15" - }, - "devDependencies": { - "aurelia-cli": "0.33.1", - "aurelia-tools": "2.0.0", - "babel-eslint": "8.2.6", - "babel-plugin-syntax-flow": "6.18.0", - "babel-plugin-transform-decorators-legacy": "1.3.5", - "babel-plugin-transform-es2015-modules-amd": "6.24.1", - "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", - "babel-plugin-transform-flow-strip-types": "6.22.0", - "babel-polyfill": "6.26.0", - "babel-preset-es2015": "6.24.1", - "babel-preset-stage-1": "6.24.1", - "babel-register": "6.26.0", - "browser-sync": "2.24.6", - "connect-history-api-fallback": "1.5.0", - "debounce": "1.1.0", - "gulp": "4.0.0", - "gulp-babel": "7.0.1", - "gulp-changed-in-place": "2.3.0", - "gulp-eslint": "5.0.0", - "gulp-htmlmin": "4.0.0", - "gulp-notify": "3.2.0", - "gulp-plumber": "1.2.0", - "gulp-rename": "1.4.0", - "gulp-sourcemaps": "2.6.4", - "gulp-watch": "5.0.1", - "html-minifier": "3.5.19", - "minimatch": "3.0.4", - "through2": "2.0.3", - "uglify-js": "3.4.6", - "vinyl-fs": "3.0.3" - } -} diff --git a/frameworks/keyed/aurelia/src/app.html b/frameworks/keyed/aurelia/src/app.html deleted file mode 100755 index 7e81af75f..000000000 --- a/frameworks/keyed/aurelia/src/app.html +++ /dev/null @@ -1,47 +0,0 @@ - diff --git a/frameworks/keyed/aurelia/src/app.js b/frameworks/keyed/aurelia/src/app.js deleted file mode 100755 index ac2299012..000000000 --- a/frameworks/keyed/aurelia/src/app.js +++ /dev/null @@ -1,35 +0,0 @@ -import {Store} from './store'; - -export class App { - constructor() { - this.store = new Store(); - } - - run() { - this.store.run(); - } - add() { - this.store.add(); - } - remove(item) { - this.store.delete(item.id); - } - select(item) { - this.store.select(item.id); - } - update() { - this.store.update(); - } - - runLots() { - this.store.runLots(); - } - - clear() { - this.store.clear(); - } - - swapRows() { - this.store.swapRows(); - } -} diff --git a/frameworks/keyed/aurelia/src/aurelia-polyfills.js b/frameworks/keyed/aurelia/src/aurelia-polyfills.js deleted file mode 100644 index 648f5bbeb..000000000 --- a/frameworks/keyed/aurelia/src/aurelia-polyfills.js +++ /dev/null @@ -1,29 +0,0 @@ -// This replaces the aurelia-polyfills package. It includes only non-standard polyfills. -(function () { - var emptyMetadata = Object.freeze({}); - var metadataContainerKey = '__metadata__'; - - if (typeof Reflect.getOwnMetadata !== 'function') { - Reflect.getOwnMetadata = function (metadataKey, target, targetKey) { - if (target.hasOwnProperty(metadataContainerKey)) { - return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey]; - } - }; - } - - if (typeof Reflect.defineMetadata !== 'function') { - Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) { - var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {}; - var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {}); - targetContainer[metadataKey] = metadataValue; - }; - } - - if (typeof Reflect.metadata !== 'function') { - Reflect.metadata = function (metadataKey, metadataValue) { - return function (target, targetKey) { - Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey); - }; - }; - } -})(); diff --git a/frameworks/keyed/aurelia/src/main.js b/frameworks/keyed/aurelia/src/main.js deleted file mode 100755 index ede9d2d9c..000000000 --- a/frameworks/keyed/aurelia/src/main.js +++ /dev/null @@ -1,15 +0,0 @@ -import environment from './environment' - -export function configure(aurelia) { - aurelia.use - .defaultBindingLanguage() - .defaultResources(); - - if (environment.debug) { - aurelia.use.developmentLogging(); - } - - aurelia.start().then(() => { - aurelia.setRoot('app'); - }); -} \ No newline at end of file diff --git a/frameworks/keyed/aurelia/src/store.js b/frameworks/keyed/aurelia/src/store.js deleted file mode 100644 index 46364629b..000000000 --- a/frameworks/keyed/aurelia/src/store.js +++ /dev/null @@ -1,73 +0,0 @@ -function _random(max) { - return Math.round(Math.random()*1000)%max; -} - -export class Store { - constructor() { - this.data = []; - this.selected = undefined; - this.id = 1; - } - buildData(count = 1000) { - var adjectives = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy"]; - var colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"]; - var nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"]; - var data = []; - for (var i = 0; i < count; i++) - data.push({id: this.id++, label: adjectives[_random(adjectives.length)] + " " + colours[_random(colours.length)] + " " + nouns[_random(nouns.length)] }); - return data; - } - updateData(mod = 10) { - for (let i=0;i d.id==id); - this.data.splice(idx, 1); - } - run() { - // faster: 178 msecs - this.data = [] - setTimeout(() => {this.data = this.buildData();}); - // slower: 194 msecs - // this.data.splice(0, this.data.length, ...this.buildData()); - } - add() { - this.data = this.data.concat(this.buildData(1000)); - this.selected = undefined; - } - update() { - this.updateData(); - } - select(id) { - this.selected = id; - } - hideAll() { - this.backup = this.data; - this.data = []; - this.selected = undefined; - } - showAll() { - this.data = this.backup; - this.backup = null; - this.selected = undefined; - } - runLots() { - this.data = this.buildData(10000); - this.selected = undefined; - } - clear() { - this.data = []; - this.selected = undefined; - } - swapRows() { - if (this.data.length > 998) { - var temp = this.data[1]; - var temp2 = this.data[998]; - this.data.splice(1, 1, temp2); - this.data.splice(998, 1, temp); - } - } - -} diff --git a/frameworks/keyed/binding.scala/.gitignore b/frameworks/keyed/binding.scala/.gitignore deleted file mode 100644 index eb34e1881..000000000 --- a/frameworks/keyed/binding.scala/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -target/ -local.sbt \ No newline at end of file diff --git a/frameworks/keyed/binding.scala/build.sbt b/frameworks/keyed/binding.scala/build.sbt deleted file mode 100644 index 8a254804a..000000000 --- a/frameworks/keyed/binding.scala/build.sbt +++ /dev/null @@ -1,11 +0,0 @@ -enablePlugins(SbtWeb) - -lazy val js = project - -scalaJSProjects += js - -pipelineStages in Assets += scalaJSPipeline - -scalaVersion in Global := "2.11.8" - -scalacOptions in Global += "-optimise" diff --git a/frameworks/keyed/binding.scala/js/build.sbt b/frameworks/keyed/binding.scala/js/build.sbt deleted file mode 100644 index 8096e77cd..000000000 --- a/frameworks/keyed/binding.scala/js/build.sbt +++ /dev/null @@ -1,7 +0,0 @@ -enablePlugins(ScalaJSPlugin, ScalaJSWeb) - -libraryDependencies += "com.thoughtworks.binding" %%% "dom" % "10.0.1" - -addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full) - -persistLauncher in Compile := true diff --git a/frameworks/keyed/binding.scala/js/src/main/scala/com/thoughtworks/binding/benchmark/Main.scala b/frameworks/keyed/binding.scala/js/src/main/scala/com/thoughtworks/binding/benchmark/Main.scala deleted file mode 100644 index d1b619d7d..000000000 --- a/frameworks/keyed/binding.scala/js/src/main/scala/com/thoughtworks/binding/benchmark/Main.scala +++ /dev/null @@ -1,55 +0,0 @@ -package com.thoughtworks.binding -package benchmark - -import org.scalajs.dom._ - -/** - * @author 杨博 (Yang Bo) <pop.atry@gmail.com> - */ -object Main extends scalajs.js.JSApp { - - @dom def render(store: Store) =
-
-
-
-

Binding.scala v10.0.0

-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
-
- - { - for (row <- store.data) yield { - "danger" case _ => "" }}> - } - } -
{row.id.toString} store.select(row)}>{row.label.bind} store.delete(row)}>
- -
- - override def main(): Unit = { - dom.render(document.body, render(new Store)) - } - -} diff --git a/frameworks/keyed/binding.scala/js/src/main/scala/com/thoughtworks/binding/benchmark/Store.scala b/frameworks/keyed/binding.scala/js/src/main/scala/com/thoughtworks/binding/benchmark/Store.scala deleted file mode 100644 index 7190f46ea..000000000 --- a/frameworks/keyed/binding.scala/js/src/main/scala/com/thoughtworks/binding/benchmark/Store.scala +++ /dev/null @@ -1,155 +0,0 @@ -package com.thoughtworks.binding.benchmark - -import com.thoughtworks.binding.Binding.{Var, Vars} - -import scala.util.Random - -/** - * @author 杨博 (Yang Bo) <pop.atry@gmail.com> - */ -final class Store { - import Store.Row - - val data: Vars[Row] = Vars.empty - val selected: Var[Option[Row]] = Var(None) - var seed = 1 - - val adjectives = Array("pretty", - "large", - "big", - "small", - "tall", - "short", - "long", - "handsome", - "plain", - "quaint", - "clean", - "elegant", - "easy", - "angry", - "crazy", - "helpful", - "mushy", - "odd", - "unsightly", - "adorable", - "important", - "inexpensive", - "cheap", - "expensive", - "fancy") - - val colours = Array("red", - "yellow", - "blue", - "green", - "pink", - "brown", - "purple", - "brown", - "white", - "black", - "orange") - - val nouns = Array("table", - "chair", - "house", - "bbq", - "desk", - "car", - "pony", - "cookie", - "sandwich", - "burger", - "pizza", - "mouse", - "keyboard") - - @inline - private def newLabel() = { - raw"""${ - adjectives(Random.nextInt(adjectives.length)) - } ${ - colours(Random.nextInt(colours.length)) - } ${ - nouns(Random.nextInt(nouns.length)) - }""" - } - - @inline - private def newId() = { - val id = seed - seed += 1 - id - } - - private def buildData(count: Int = 1000) = { - (for (i <- 0 until count) yield { - new Row(newId(), Var(newLabel())) - })(collection.breakOut(scalajs.js.WrappedArray.canBuildFrom)) - } - - private def replace(count: Int = 1000) = { - val buffer = data.get - buffer.clear() - buffer ++= buildData(count) - } - - @inline - def run() = { - replace(1000) - } - - @inline - def runLots() = { - replace(10000) - } - - @inline - def add() = { - data.get ++= buildData() - } - - def update() = { - val buffer = data.get - val i = buffer.iterator - for (i <- 0 until buffer.length by 10) { - val label = buffer(i).label - label := label.get + " !!!" - } - } - - @inline - def clear() = { - data.get.clear() - } - - def swapRows() = { - val buffer = data.get - if (buffer.length > 998) { - val row1 = buffer(1) - val row998 = buffer(998) - buffer(998) = row1 - buffer(1) = row998 - } - } - - @inline - def delete(row: Row) = { - val buffer = data.get - buffer -= row - } - - @inline - def select(row: Row) = { - selected := Some(row) - } - -} - -object Store { - - final class Row(val id: Int, val label: Var[String]) - -} diff --git a/frameworks/keyed/binding.scala/package.json b/frameworks/keyed/binding.scala/package.json deleted file mode 100644 index 0ed3e5aaf..000000000 --- a/frameworks/keyed/binding.scala/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "js-framework-benchmark-binding.scala", - "version": "1.0.0", - "description": "Benchmark for Binding.scala", - "js-framework-benchmark": { - "frameworkVersion": "10.0.1", - "customURL": "/target/web/stage", - "issues": [694] - }, - "scripts": { - "build-prod": "sbt web-stage" - }, - "devDependencies": { - "sbt-bin": "0.1.2" - }, - "author": "杨博 (Yang Bo) " -} diff --git a/frameworks/keyed/binding.scala/project/build.properties b/frameworks/keyed/binding.scala/project/build.properties deleted file mode 100644 index 27e88aa11..000000000 --- a/frameworks/keyed/binding.scala/project/build.properties +++ /dev/null @@ -1 +0,0 @@ -sbt.version=0.13.13 diff --git a/frameworks/keyed/binding.scala/project/plugins.sbt b/frameworks/keyed/binding.scala/project/plugins.sbt deleted file mode 100644 index f0dcbc5cd..000000000 --- a/frameworks/keyed/binding.scala/project/plugins.sbt +++ /dev/null @@ -1,5 +0,0 @@ -addSbtPlugin("com.thoughtworks.sbt-best-practice" % "sbt-best-practice" % "latest.release") - -addSbtPlugin("com.vmunier" % "sbt-web-scalajs" % "1.0.1") - -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.13") diff --git a/frameworks/keyed/binding.scala/src/main/assets/index.html b/frameworks/keyed/binding.scala/src/main/assets/index.html deleted file mode 100644 index f2edf2b00..000000000 --- a/frameworks/keyed/binding.scala/src/main/assets/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Binding.scala v10.0.1 - - - - - - - diff --git a/frameworks/keyed/blazor-wasm/.gitignore b/frameworks/keyed/blazor-wasm/.gitignore deleted file mode 100644 index d0039e5eb..000000000 --- a/frameworks/keyed/blazor-wasm/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -dist/ -dotnet/ -obj/ -bin/ -.vs/ \ No newline at end of file diff --git a/frameworks/keyed/blazor-wasm/dotnet-install.cmd b/frameworks/keyed/blazor-wasm/dotnet-install.cmd deleted file mode 100644 index 997b5071b..000000000 --- a/frameworks/keyed/blazor-wasm/dotnet-install.cmd +++ /dev/null @@ -1 +0,0 @@ -powershell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -JSonFile src/global.json -InstallDir ./dotnet -NoPath" diff --git a/frameworks/keyed/blazor-wasm/dotnet-install.sh b/frameworks/keyed/blazor-wasm/dotnet-install.sh deleted file mode 100755 index f75457377..000000000 --- a/frameworks/keyed/blazor-wasm/dotnet-install.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --jsonfile ./src/global.json --install-dir ./dotnet --no-path \ No newline at end of file diff --git a/frameworks/keyed/blazor-wasm/package.json b/frameworks/keyed/blazor-wasm/package.json deleted file mode 100644 index 149cb8b1d..000000000 --- a/frameworks/keyed/blazor-wasm/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "js-framework-benchmark-blazor-wasm", - "version": "1.0.0", - "description": "Blazor WebAssembly demo", - "js-framework-benchmark": { - "frameworkVersion": "3.2.0-preview4.20210.8", - "customURL": "/dist/wwwroot/" - }, - "scripts": { - "postinstall": "run-script-os", - "postinstall:win32": "dotnet-install.cmd", - "postinstall:nix": "./dotnet-install.sh", - "build-dev": "run-script-os", - "build-dev:win32": "cross-env DOTNET_CLI_TELEMETRY_OPTOUT=0 ./dotnet/dotnet.exe build ./src/ -c Debug", - "build-dev:nix": "cross-env DOTNET_CLI_TELEMETRY_OPTOUT=0 ./dotnet/dotnet build ./src/ -c Debug", - "build-prod": "run-script-os", - "build-prod:win32": "cross-env DOTNET_CLI_TELEMETRY_OPTOUT=0 ./dotnet/dotnet.exe publish ./src/ -c Release -o ./dist", - "build-prod:nix": "cross-env DOTNET_CLI_TELEMETRY_OPTOUT=0 ./dotnet/dotnet publish ./src/ -c Release -o ./dist" - }, - "keywords": [ - "blazor", - "webassembly" - ], - "author": "Stefan Krause", - "license": "Apache-2.0", - "homepage": "https://github.com/krausest/js-framework-benchmark", - "repository": { - "type": "git", - "url": "https://github.com/krausest/js-framework-benchmark.git" - }, - "dependencies": {}, - "devDependencies": { - "cross-env": "^7.0.2", - "run-script-os": "1.1.1" - } -} diff --git a/frameworks/keyed/blazor-wasm/src/App.razor b/frameworks/keyed/blazor-wasm/src/App.razor deleted file mode 100644 index c6ed8cde1..000000000 --- a/frameworks/keyed/blazor-wasm/src/App.razor +++ /dev/null @@ -1,56 +0,0 @@ -@namespace blazor_wasm - -
-
-
-
-

Blazor-WASM-"keyed"

-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
-
- - - @foreach (var item in data) - { - - - - - - - } - -
@item.Id - - @item.Label - - - - - -
- -
- diff --git a/frameworks/keyed/blazor-wasm/src/App.razor.cs b/frameworks/keyed/blazor-wasm/src/App.razor.cs deleted file mode 100644 index 65e8db3c0..000000000 --- a/frameworks/keyed/blazor-wasm/src/App.razor.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; - -namespace blazor_wasm -{ - public partial class App - { - List data = new List(); - int selected; - int id = 1; - Random random = new Random(0); - - string[] adjectives = new string[] - { - "pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy" - }; - - string[] colours = new string[] - { - "red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange" - }; - - string[] nouns = new string[] - { - "table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard" - }; - - List BuildData(int count = 1000) - { - var result = new List(); - for (int i = 0; i < count; i++) - { - result.Add(new Data - { - Id = this.id++, - Label = adjectives[this.random.Next(adjectives.Length)] + " " + colours[this.random.Next(colours.Length)] + " " + nouns[this.random.Next(nouns.Length)] - }); - } - - return result; - } - - public void Select(Data item) - { - this.selected = item.Id; - } - - void Delete(Data item) - { - this.data.Remove(item); - } - - void Run() - { - this.data = this.BuildData(); - } - void Runlots() - { - this.data = this.BuildData(10000); - } - void Add() - { - this.data.AddRange(this.BuildData(1000)); - } - void Update() - { - for (var i = 0; i < this.data.Count; i += 10) - { - this.data[i].Label += " !!!"; - } - } - void Clear() - { - this.data = new List(); - this.selected = 0; - } - void SwapRows() - { - if (this.data.Count > 998) - { - var a = this.data[1]; - this.data[1] = this.data[998]; - this.data[998] = a; - } - } - } -} diff --git a/frameworks/keyed/blazor-wasm/src/Data.cs b/frameworks/keyed/blazor-wasm/src/Data.cs deleted file mode 100644 index 1871e4240..000000000 --- a/frameworks/keyed/blazor-wasm/src/Data.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace blazor_wasm -{ - public class Data - { - public int Id { get; set; } - public string Label { get; set; } - } -} \ No newline at end of file diff --git a/frameworks/keyed/blazor-wasm/src/Program.cs b/frameworks/keyed/blazor-wasm/src/Program.cs deleted file mode 100644 index ed8ea1c57..000000000 --- a/frameworks/keyed/blazor-wasm/src/Program.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Components.WebAssembly.Hosting; - -namespace blazor_wasm -{ - public class Program - { - public static async Task Main(string[] args) - { - var builder = WebAssemblyHostBuilder.CreateDefault(args); - builder.RootComponents.Add("app"); - - await builder.Build().RunAsync(); - } - } -} diff --git a/frameworks/keyed/blazor-wasm/src/Properties/launchSettings.json b/frameworks/keyed/blazor-wasm/src/Properties/launchSettings.json deleted file mode 100644 index 3d1b5c2f7..000000000 --- a/frameworks/keyed/blazor-wasm/src/Properties/launchSettings.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:33030/", - "sslPort": 44363 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "blazor-wasm": { - "commandName": "Project", - "launchBrowser": true, - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "applicationUrl": "https://localhost:5001;http://localhost:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} diff --git a/frameworks/keyed/blazor-wasm/src/_Imports.razor b/frameworks/keyed/blazor-wasm/src/_Imports.razor deleted file mode 100644 index 4a26e97c5..000000000 --- a/frameworks/keyed/blazor-wasm/src/_Imports.razor +++ /dev/null @@ -1,8 +0,0 @@ -@using System.Net.Http -@using System.Net.Http.Json -@using Microsoft.AspNetCore.Components.Forms -@using Microsoft.AspNetCore.Components.Routing -@using Microsoft.AspNetCore.Components.Web -@using Microsoft.JSInterop -@using blazor_wasm - diff --git a/frameworks/keyed/blazor-wasm/src/blazor-wasm.csproj b/frameworks/keyed/blazor-wasm/src/blazor-wasm.csproj deleted file mode 100644 index 735de5627..000000000 --- a/frameworks/keyed/blazor-wasm/src/blazor-wasm.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - netstandard2.1 - 3.0 - - - - - - - - - - diff --git a/frameworks/keyed/blazor-wasm/src/global.json b/frameworks/keyed/blazor-wasm/src/global.json deleted file mode 100644 index 1caecfb19..000000000 --- a/frameworks/keyed/blazor-wasm/src/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sdk": { - "version": "3.1.201" - } - } \ No newline at end of file diff --git a/frameworks/keyed/blazor-wasm/src/wwwroot/index.html b/frameworks/keyed/blazor-wasm/src/wwwroot/index.html deleted file mode 100644 index bfe275bab..000000000 --- a/frameworks/keyed/blazor-wasm/src/wwwroot/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - blazor-wasm - - - - - - Loading... - - - - diff --git a/frameworks/keyed/bobril/.vscode/settings.json b/frameworks/keyed/bobril/.vscode/settings.json deleted file mode 100644 index c7c1623bc..000000000 --- a/frameworks/keyed/bobril/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "typescript.tsdk": "./node_modules/typescript/lib" -} \ No newline at end of file diff --git a/frameworks/keyed/bobril/index.html b/frameworks/keyed/bobril/index.html deleted file mode 100644 index 1e6fb644d..000000000 --- a/frameworks/keyed/bobril/index.html +++ /dev/null @@ -1 +0,0 @@ -Bobril v8.0.1 \ No newline at end of file diff --git a/frameworks/keyed/bobril/package.json b/frameworks/keyed/bobril/package.json deleted file mode 100644 index dfbea019f..000000000 --- a/frameworks/keyed/bobril/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "js-framework-benchmark-bobril", - "version": "1.0.0", - "description": "Bobril demo", - "main": "src/app.js", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "bobril" - }, - "scripts": { - "build-dev": "bb", - "build-prod": "bb b -v dist" - }, - "keywords": [ - "bobril", - "bobril-build" - ], - "author": "Boris Letocha", - "license": "Apache-2.0", - "homepage": "https://github.com/krausest/js-framework-benchmark", - "repository": { - "type": "git", - "url": "https://github.com/krausest/js-framework-benchmark.git" - }, - "devDependencies": { - "bobril-build": "0.82.0", - "uglify-js": "^3.4.6" - }, - "dependencies": { - "bobril": "8.11.2" - }, - "bobril": { - "title": "Bobril v8.0.1", - "dir": ".", - "dependencies": "disable", - "head": "" - }, - "resolutions": { - "glob": "7.1.1", - "uglify-js": "2.8.7", - "supports-color": "3.2.3", - "readable-stream": "2.2.3", - "mkdirp": "0.5.1", - "rimraf": "2.5.4", - "minimist": "1.2.0", - "assert-plus": "0.2.0", - "once": "1.4.0", - "debug": "0.7.4", - "colors": "1.1.2", - "esprima": "2.7.3", - "fs-extra": "1.0.0", - "bobril": "8.11.2", - "request": "2.79.0" - } -} diff --git a/frameworks/keyed/bobril/src/app.ts b/frameworks/keyed/bobril/src/app.ts deleted file mode 100644 index 6c2232be8..000000000 --- a/frameworks/keyed/bobril/src/app.ts +++ /dev/null @@ -1,186 +0,0 @@ -import * as b from "bobril"; -import { Store } from "./store"; - -// For who ever will read this: in Bobril you normally don't use bootstrap or class names directly, you use b.styleDef instead. -b.asset("../../../../css/currentStyle.css"); - -function divWithClass(name: string, children: b.IBobrilChildren) { - return { tag: "div", className: name, children }; -} - -function tdWithClass(name: string, children: b.IBobrilChildren) { - return { tag: "td", className: name, children }; -} - -let store = new Store(); - -interface IButtonData { - children?: b.IBobrilChildren; - id: string; - action: () => void; -} - -interface IButtonCtx extends b.IBobrilCtx { - data: IButtonData; -} - -const Button = b.createVirtualComponent({ - render(ctx: IButtonCtx, me: b.IBobrilNode) { - const d = ctx.data; - me.tag = "button"; - me.className = "btn btn-primary btn-block"; - me.attrs = { id: d.id }; - me.children = d.children; - }, - onClick(ctx: IButtonCtx): boolean { - ctx.data.action(); - b.invalidate(); - return true; - } -}); - -interface IHeaderData {} - -interface IHeaderCtx extends b.IBobrilCtx { - data: IHeaderData; -} - -const Header = b.createComponent({ - shouldChange() { - return false; - }, - render(ctx: IHeaderCtx, me: b.IBobrilNode) { - const d = ctx.data; - me.className = "jumbotron"; - me.children = divWithClass("row", [ - divWithClass("col-md-6", { tag: "h1", children: "Bobril v8.0.1" }), - divWithClass("col-md-6", [ - divWithClass( - "col-sm-6 smallpad", - Button({ id: "run", action: () => store.run() }, "Create 1,000 rows") - ), - divWithClass( - "col-sm-6 smallpad", - Button( - { id: "runlots", action: () => store.runLots() }, - "Create 10,000 rows" - ) - ), - divWithClass( - "col-sm-6 smallpad", - Button({ id: "add", action: () => store.add() }, "Append 1,000 rows") - ), - divWithClass( - "col-sm-6 smallpad", - Button( - { id: "update", action: () => store.update() }, - "Update every 10th row" - ) - ), - divWithClass( - "col-sm-6 smallpad", - Button({ id: "clear", action: () => store.clear() }, "Clear") - ), - divWithClass( - "col-sm-6 smallpad", - Button( - { id: "swaprows", action: () => store.swapRows() }, - "Swap Rows" - ) - ) - ]) - ]); - } -}); - -const ClickSelect: b.IBobrilComponent = { - onClick(ctx: b.IBobrilCtx, event: b.IBobrilMouseEvent): boolean { - store.select(ctx.data); - b.invalidate(); - return true; - } -}; - -const ClickRemove: b.IBobrilComponent = { - onClick(ctx: b.IBobrilCtx, event: b.IBobrilMouseEvent): boolean { - store.delete(ctx.data); - b.invalidate(); - return true; - } -}; - -interface IRowData { - item: { id: number; label: string }; - selected: boolean; -} - -interface IRowCtx extends b.IBobrilCtx { - data: IRowData; -} - -const Row = b.createVirtualComponent({ - init(ctx: IRowCtx) {}, - shouldChange(ctx: IRowCtx, me: b.IBobrilNode): boolean { - return ( - ctx.data.item !== me.data.item || ctx.data.selected !== me.data.selected - ); - }, - render(ctx: IRowCtx, me: b.IBobrilNode) { - const d = ctx.data; - me.tag = "tr"; - me.className = d.selected ? "danger" : ""; - const id = d.item.id; - me.children = [ - tdWithClass("col-md-1", id), - tdWithClass("col-md-4", { - tag: "a", - data: id, - component: ClickSelect, - children: d.item.label - }), - tdWithClass("col-md-1", { - tag: "a", - data: id, - component: ClickRemove, - children: { - tag: "span", - className: "glyphicon glyphicon-remove", - attrs: { "aria-hidden": "true" } - } - }), - tdWithClass("col-md-6", "") - ]; - } -}); - -b.init(() => { - return { - tag: "div", - className: "container", - component: { - }, - children: [ - Header(), - { - tag: "table", - className: "table table-hover table-striped test-data", - children: { - tag: "tbody", - children: store.data.map(item => - b.withKey( - Row({ item, selected: item.id === store.selected }), - item.id - ) - ) - } - }, - { - tag: "span", - className: "preloadicon glyphicon glyphicon-remove", - attrs: { "aria-hidden": "true" } - } - ] - }; -}); - -b.syncUpdate(); diff --git a/frameworks/keyed/bobril/src/store.ts b/frameworks/keyed/bobril/src/store.ts deleted file mode 100644 index 29dfbc7e7..000000000 --- a/frameworks/keyed/bobril/src/store.ts +++ /dev/null @@ -1,77 +0,0 @@ -function _random(max) { - return Math.round(Math.random()*1000)%max; -} - -export class Store { - data: { id:number, label:string }[]; - backup: { id:number, label:string }[]; - selected: number; - id: number; - constructor() { - this.data = []; - this.selected = undefined; - this.id = 1; - } - buildData(count = 1000) { - var adjectives = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy"]; - var colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"]; - var nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"]; - var data = []; - for (var i = 0; i < count; i++) - data.push({id: this.id++, label: adjectives[_random(adjectives.length)] + " " + colours[_random(colours.length)] + " " + nouns[_random(nouns.length)] }); - return data; - } - updateData(mod = 10) { - for (let i=0;i d.id==id); - this.data = this.data.filter((e,i) => i!=idx); - return this; - } - deleteNext(id) { - const idx = this.data.findIndex(d => d.id==id); - this.data = this.data.filter((e,i) => i!=idx+1); - return this; - } - run() { - this.data = this.buildData(); - this.selected = undefined; - } - add() { - this.data = this.data.concat(this.buildData(1000)); - } - update() { - this.updateData(); - } - select(id:number) { - this.selected = id; - } - hideAll() { - this.backup = this.data; - this.data = []; - this.selected = undefined; - } - showAll() { - this.data = this.backup; - this.backup = null; - this.selected = undefined; - } - runLots() { - this.data = this.buildData(10000); - this.selected = undefined; - } - clear() { - this.data = []; - this.selected = undefined; - } - swapRows() { - if(this.data.length > 998) { - var a = this.data[1]; - this.data[1] = this.data[998]; - this.data[998] = a; - } - } -} diff --git a/frameworks/keyed/bobril/tsconfig.json b/frameworks/keyed/bobril/tsconfig.json deleted file mode 100644 index 3abd92aa3..000000000 --- a/frameworks/keyed/bobril/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "compilerOptions": { - "target": "es6", - "module": "commonjs", - "moduleResolution": "node", - "jsx": "react", - "reactNamespace": "b" - }, - "compileOnSave": false, - "files": [ - "node_modules/bobril/jsx.d.ts", - "src/app.ts", - "src/store.ts" - ] -} \ No newline at end of file diff --git a/frameworks/keyed/choo/index.html b/frameworks/keyed/choo/index.html deleted file mode 100755 index 26f8f63d9..000000000 --- a/frameworks/keyed/choo/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Choo v6.5.0 - - - -
- - - diff --git a/frameworks/keyed/choo/package.json b/frameworks/keyed/choo/package.json deleted file mode 100644 index 8fc470ae9..000000000 --- a/frameworks/keyed/choo/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "choo-v6.5.0", - "version": "1.0.0", - "description": "", - "main": "src/index.js", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "choo" - }, - "scripts": { - "build-dev": "browserify src/index.js > dist/index.js", - "build-prod": "rimraf dist && mkdirp dist && cross-env NODE_ENV=production browserify src/index.js -t envify -g yo-yoify -g unassertify -g es2020 -g uglifyify | uglifyjs > dist/index.js" - }, - "keywords": [ - "choo" - ], - "author": "Rahul Chanila", - "license": "MIT", - "dependencies": { - "browserify": "16.2.2", - "choo": "6.13.0", - "cross-env": "5.2.0", - "envify": "4.1.0", - "es2020": "1.1.9", - "mkdirp": "0.5.1", - "rimraf": "2.6.2", - "uglify-js": "3.4.6", - "uglifyify": "5.0.1", - "unassertify": "2.1.1", - "yo-yoify": "4.3.0" - } -} diff --git a/frameworks/keyed/choo/src/index.js b/frameworks/keyed/choo/src/index.js deleted file mode 100644 index 3dd4fdf7c..000000000 --- a/frameworks/keyed/choo/src/index.js +++ /dev/null @@ -1,80 +0,0 @@ -const choo = require('choo'); -const html = require('choo/html'); -const app = choo(); - -const rowsView = require('./rowsView'); -const store = require('./store'); -const utils = require('./utils'); - -app.use(store); - -function view(state, emit) { - return html` -
-
-
-
-

Choo v6.5.0

-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
-
- - - ${rowsView(state, emit)} - -
- -
- `; - - function run() { - emit('run'); - } - - function runLots() { - emit('runLots'); - } - - function add() { - emit('add'); - } - - function update() { - emit('update'); - } - - function clear() { - emit('clear'); - } - - function swapRows() { - emit('swapRows'); - } -} - -app.route('/', view); -app.route('/:chooversion', view); -app.route('/:chooversion/index.html', view); -app.mount('#main'); diff --git a/frameworks/keyed/choo/src/rowsView.js b/frameworks/keyed/choo/src/rowsView.js deleted file mode 100644 index e13916540..000000000 --- a/frameworks/keyed/choo/src/rowsView.js +++ /dev/null @@ -1,55 +0,0 @@ -const html = require('choo/html'); -const utils = require('./utils'); - -module.exports = function rowsView(state, emit) { - const data = state.data; - const selected = state.selected; - - return data.map(d => { - const id = d.id; - const label = d.label; - const className = classNameSelected(selected); - return row({ id, label, className }, emit); - }); -}; - -function row(state, emit) { - const id = state.id; - const label = state.label; - const className = state.className; - - const row = html` - - ${id} - - ${label} - - - - - - - - - `; - - row.isSameNode = target => target && target.id === id; - - return row; -} - -function del(id, emit) { - return e => { - emit('delete', { id: id }); - }; -} - -function click(id, emit) { - return e => { - emit('select', { id: id }); - }; -} - -function classNameSelected(selected) { - return id => (id === selected ? 'danger' : ''); -} diff --git a/frameworks/keyed/choo/src/store.js b/frameworks/keyed/choo/src/store.js deleted file mode 100644 index 65c6748a5..000000000 --- a/frameworks/keyed/choo/src/store.js +++ /dev/null @@ -1,57 +0,0 @@ -const buildData = require('./utils').buildData; - -module.exports = function(state, emitter) { - state.data = []; - state.selected = false; - - emitter.on('run', function() { - state.data = buildData(1000); - state.selected = undefined; - emitter.emit('render'); - }); - - emitter.on('add', function() { - state.data = state.data.slice().concat(buildData(1000)); - state.selected = undefined; - emitter.emit('render'); - }); - - emitter.on('runLots', function() { - state.data = state.data.slice().concat(buildData(10000)); - state.selected = undefined; - emitter.emit('render'); - }); - - emitter.on('clear', function() { - state.data = []; - state.selected = undefined; - emitter.emit('render'); - }); - - emitter.on('update', function() { - for (let i = 0; i < state.data.length; i += 10) { - state.data[i].label += ' !!!'; - } - emitter.emit('render'); - }); - - emitter.on('swapRows', function() { - if (state.data.length > 998) { - const a = state.data[1]; - state.data[1] = state.data[998]; - state.data[998] = a; - } - emitter.emit('render'); - }); - - emitter.on('select', function(params) { - state.selected = params.id; - emitter.emit('render'); - }); - - emitter.on('delete', function(params) { - const idx = state.data.findIndex(d => d.id == params.id); - state.data.splice(idx, 1); - emitter.emit('render'); - }); -}; diff --git a/frameworks/keyed/choo/src/utils.js b/frameworks/keyed/choo/src/utils.js deleted file mode 100644 index 7067ddd7b..000000000 --- a/frameworks/keyed/choo/src/utils.js +++ /dev/null @@ -1,25 +0,0 @@ -exports.buildData = buildData; - -// - -let id = 1; - -function _random(max) { - return Math.round(Math.random() * 1000) % max; -} - -const adjectives = ['pretty', 'large', 'big', 'small', 'tall', 'short', 'long', 'handsome', 'plain', 'quaint', 'clean', 'elegant', 'easy', 'angry', 'crazy', 'helpful', 'mushy', 'odd', 'unsightly', 'adorable', 'important', 'inexpensive', 'cheap', 'expensive', 'fancy']; -const colours = ['red', 'yellow', 'blue', 'green', 'pink', 'brown', 'purple', 'brown', 'white', 'black', 'orange']; -const nouns = ['table', 'chair', 'house', 'bbq', 'desk', 'car', 'pony', 'cookie', 'sandwich', 'burger', 'pizza', 'mouse', 'keyboard']; - -function buildData(count) { - count = count || 1000; - return new Array(count).fill('').map(() => { - return { - id: id++, - label: `${adjectives[_random(adjectives.length)]} ${colours[ - _random(colours.length) - ]} ${nouns[_random(nouns.length)]}` - }; - }); -} diff --git a/frameworks/keyed/crui/index.html b/frameworks/keyed/crui/index.html deleted file mode 100644 index a66855693..000000000 --- a/frameworks/keyed/crui/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - CRUI keyed - - - -
- - - diff --git a/frameworks/keyed/crui/package.json b/frameworks/keyed/crui/package.json deleted file mode 100644 index 2d5b27fa4..000000000 --- a/frameworks/keyed/crui/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "js-framework-benchmark-keyed-crui", - "version": "0.1.0", - "main": "dist/main.js", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "@crui/core", - "issues": [694] - }, - "scripts": { - "build-dev": "webpack --watch", - "build-prod": "webpack" - }, - "author": "Pelligra Salvatore", - "license": "Apache-2.0", - "homepage": "https://github.com/krausest/js-framework-benchmark", - "repository": { - "type": "git", - "url": "https://github.com/krausest/js-framework-benchmark.git" - }, - "dependencies": { - "@crui/core": "0.1.0-alpha.13", - "@crui/reactive": "0.1.0-alpha.13" - }, - "devDependencies": { - "@babel/core": "7.5.5", - "@babel/preset-env": "7.5.5", - "awesome-typescript-loader": "5.2.1", - "babel-core": "6.26.3", - "terser-webpack-plugin": "1.3.0", - "typescript": "3.5.3", - "webpack": "4.38.0", - "webpack-cli": "3.3.6" - } -} diff --git a/frameworks/keyed/crui/src/app.ts b/frameworks/keyed/crui/src/app.ts deleted file mode 100644 index 3ed3ed4c3..000000000 --- a/frameworks/keyed/crui/src/app.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { attribute, h, sc2 } from '@crui/core'; -import { Jumbotron } from './jumbotron'; -import { Store } from './store'; -import { Table } from './table'; -import { div, klass } from './utils'; - -const loading = h('span', sc2( - klass('preloadicon glyphicon glyphicon-remove'), - attribute('aria-hidden', 'true'), -)) - -export function App(store: Store) { - return div('container', [ - Jumbotron(store), - Table(store), - loading, - ]) -} \ No newline at end of file diff --git a/frameworks/keyed/crui/src/jumbotron.ts b/frameworks/keyed/crui/src/jumbotron.ts deleted file mode 100644 index c98234371..000000000 --- a/frameworks/keyed/crui/src/jumbotron.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Component, ctext, h, ht, onClick, props, sc } from '@crui/core'; -import { Store } from './store'; -import { div } from './utils'; - -export function Jumbotron(store: Store) { - return div('jumbotron', [ - row([ - col6(ht('h1', 'CRUI')), - col6(row([ - button('run', 'Create 1,000 rows', store.set1k), - button('runlots', 'Create 10,000 rows', store.set10k), - button('add', 'Append 1,000 rows', store.add1k), - button('update', 'Update every 10th row', store.updateEvery10th), - button('clear', 'Clear', store.clear), - button('swaprows', 'Swap Rows', store.swapRows), - ])) - ]) - ]) -} - -function row(cs: Component[]) { - return div('row', cs) -} - -function col6(c: Component) { - return div('col-md-6', [c]) -} - -type Handler = () => void -function button(id: string, text: string, click: Handler) { - return div('col-sm-6 smallpad', [ - h('button', sc([ - props({ id, className: 'btn btn-primary btn-block', type: 'button' }), - onClick(click), - ctext(text) - ])) - ]) -} \ No newline at end of file diff --git a/frameworks/keyed/crui/src/main.ts b/frameworks/keyed/crui/src/main.ts deleted file mode 100644 index b7ab8d985..000000000 --- a/frameworks/keyed/crui/src/main.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { mount } from '@crui/core/dom/browser'; -import { App } from './app' -import { Store } from './store' - -mount( - document.getElementById('main')!, - App(new Store), - {} -) \ No newline at end of file diff --git a/frameworks/keyed/crui/src/store.ts b/frameworks/keyed/crui/src/store.ts deleted file mode 100644 index ca9e7ce68..000000000 --- a/frameworks/keyed/crui/src/store.ts +++ /dev/null @@ -1,103 +0,0 @@ -import { StreamBox } from '@crui/reactive/rx/box/stream'; -import { DRW$B } from '@crui/reactive/rx/box/types'; -import { StreamList } from '@crui/reactive/rx/list/stream'; -import { DRW$L, R$L } from '@crui/reactive/rx/list/types'; - -export type Item = { - id: number, - label: DRW$B, - selected: DRW$B -} - -export class Store { - private data: DRW$L - private selected: Item|null - - constructor() { - this.data = new StreamList([]) - this.selected = null - } - - getData(): R$L { - return this.data - } - - select = (item: Item) => { - if (this.selected === item) - return - - if (this.selected !== null) - this.selected.selected.set(false) - - this.selected = item - item.selected.set(true) - } - - set1k = () => { - this.data.set(buildData(1_000)) - } - - set10k = () => { - this.data.set(buildData(10_000)) - } - - add1k = () => { - this.data.concat(buildData(1_000)) - } - - remove = (item: Item) => { - this.data.remove(item) - } - - updateEvery10th = () => { - const items = this.data.get() - for (let i = 0; i < items.length; i += 10) { - const label = items[i].label - label.set(label.get() + ' !!!') - } - } - - swapRows = () => { - if (this.data.get().length <= 998) - return - - const tmp = this.data.item(1)! - this.data.update(1, this.data.item(998)!) - this.data.update(998, tmp) - } - - clear = () => { - this.data.set([]) - } -} - -let idCounter = 1 -const adjectives = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy"]; -const colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"]; -const nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"]; - -function buildData(count: number) { - let data = new Array(count); - - for (let i = 0; i < count; i++) { - const adjective = pickRandom(adjectives) - const color = pickRandom(colours) - const noun = pickRandom(nouns) - - data[i] = { - id: idCounter++, - label: new StreamBox(`${adjective} ${color} ${noun}`), - selected: new StreamBox(false) - } - } - - return data; -} - -function pickRandom(xs: T[]): T { - return xs[random(xs.length)] -} - -function random (max: number) { - return Math.round(Math.random() * 1000) % max -} \ No newline at end of file diff --git a/frameworks/keyed/crui/src/table.ts b/frameworks/keyed/crui/src/table.ts deleted file mode 100644 index bb50844e6..000000000 --- a/frameworks/keyed/crui/src/table.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { attribute, child, children, Component, h, onClick, sc2, text } from '@crui/core'; -import { text$ } from '@crui/reactive/elems/text'; -import { map } from '@crui/reactive/rx/box/map'; -import { c$map } from '@crui/reactive/setups/map'; -import { $props } from '@crui/reactive/setups/props'; -import { Item, Store } from './store'; -import { klass } from './utils'; - -export function Table(store: Store) { - return h('table', sc2( - klass('table table-hover table-striped test-data'), - child(h('tbody', c$map( - store.getData(), - (item) => row(store, item) - ))) - )) -} - -const binIcon = h('span', sc2( - klass('glyphicon glyphicon-remove'), - attribute('aria-hidden', 'true') -)) - -function row(store: Store, item: Item) { - const className = map( - item.selected, - (selected) => selected ? 'danger' : '' - ) - return h('tr', sc2( - $props({ className }), - children([ - td('col-md-1', text(item.id.toString())), - td('col-md-4', a(text$(item.label), () => { - store.select(item) - })), - td('col-md-1', a(binIcon, () => { - store.remove(item) - })), - h('td', klass('col-md-6')) - ]) - )) -} - -function td(cls: string, c: Component<{}, any>) { - return h('td', sc2( - klass(cls), - child(c) - )) -} - -type Handler = () => void -function a(c: Component<{}, any>, click: Handler) { - return h('a', sc2( - onClick(click), - child(c) - )) -} \ No newline at end of file diff --git a/frameworks/keyed/crui/src/utils.ts b/frameworks/keyed/crui/src/utils.ts deleted file mode 100644 index 11378f49e..000000000 --- a/frameworks/keyed/crui/src/utils.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { children, Component, h, sc2 } from '@crui/core'; -import { props } from '@crui/core/setups/props'; - -export const klass = (className: string) => - props({ className }) - -export function div(cls: string, cs: Component[]) { - return h('div', sc2( - klass(cls), - children(cs) - )) -} \ No newline at end of file diff --git a/frameworks/keyed/crui/tsconfig.json b/frameworks/keyed/crui/tsconfig.json deleted file mode 100644 index 7bbf5c738..000000000 --- a/frameworks/keyed/crui/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": ".", - "paths": { - "*": [ - "types/*" - ] - }, - "target": "ES2016", - "module": "esNext", - "sourceMap": true, - "outDir": "./dist/", - "strict": true, - "strictNullChecks": true, - "alwaysStrict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "moduleResolution": "node", - "experimentalDecorators": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true - }, - "include": [ - "./src/*.ts", - ] -} diff --git a/frameworks/keyed/crui/webpack.config.js b/frameworks/keyed/crui/webpack.config.js deleted file mode 100644 index a0867c2ea..000000000 --- a/frameworks/keyed/crui/webpack.config.js +++ /dev/null @@ -1,75 +0,0 @@ -const path = require('path') -const webpack = require('webpack') -const TerserPlugin = require('terser-webpack-plugin') -const { CheckerPlugin } = require('awesome-typescript-loader') - -module.exports = { - mode: 'production', - entry: { - main: path.join(__dirname, 'src', 'main.ts'), - }, - output: { - path: path.join(__dirname, 'dist'), - filename: '[name].js' - }, - resolve: { - extensions: ['.ts', '.js'] - }, - module: { - rules: [{ - test: /\.ts$/, - loader: 'awesome-typescript-loader', - options: { - useBabel: true, - useCache: true, - }, - exclude: [/.test.ts/], - }] - }, - optimization: { - minimizer: [ - new TerserPlugin({ - terserOptions: { - parse: { - // we want terser to parse ecma 8 code. However, we don't want it - // to apply any minfication steps that turns valid ecma 5 code - // into invalid ecma 5 code. This is why the 'compress' and 'output' - // sections only apply transformations that are ecma 5 safe - // https://github.com/facebook/create-react-app/pull/4234 - ecma: 8, - }, - compress: { - ecma: 5, - warnings: false, - // Disabled because of an issue with Uglify breaking seemingly valid code: - // https://github.com/facebook/create-react-app/issues/2376 - // Pending further investigation: - // https://github.com/mishoo/UglifyJS2/issues/2011 - comparisons: false, - }, - mangle: { - safari10: true, - }, - output: { - ecma: 5, - comments: false, - // Turned on because emoji and regex is not minified properly using default - // https://github.com/facebook/create-react-app/issues/2488 - ascii_only: true, - }, - }, - // Use multi-process parallel running to improve the build speed - // Default number of concurrent runs: os.cpus().length - 1 - parallel: true, - // Enable file caching - cache: true, - }), - ] - }, - plugins: [ - new CheckerPlugin(), - new webpack.DefinePlugin({ - 'process.env': { NODE_ENV: JSON.stringify('production') } - }), - ], -} diff --git a/frameworks/keyed/datum/.babelrc b/frameworks/keyed/datum/.babelrc deleted file mode 100644 index 6df7eb362..000000000 --- a/frameworks/keyed/datum/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets" : [ "babel-preset-es2015"] -} \ No newline at end of file diff --git a/frameworks/keyed/datum/index.html b/frameworks/keyed/datum/index.html deleted file mode 100644 index b627e094c..000000000 --- a/frameworks/keyed/datum/index.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - Datum - - - -
-
-
-
-
-

Datum v0.12.2

-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
-
- - - - - - - - - -
- -
- -
-
- - - diff --git a/frameworks/keyed/datum/package.json b/frameworks/keyed/datum/package.json deleted file mode 100644 index 7b2e2eacc..000000000 --- a/frameworks/keyed/datum/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "js-framework-benchmark-datumjs", - "version": "1.0.0", - "description": "Benchmark for Datum v0.8", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "Datum", - "issues": [694] - }, - "scripts": { - "build-dev": "webpack -w -d -c webpack.config.js", - "build-prod": "webpack -p -c webpack.config.js" - }, - "contributors": [ - "Stefan Krause", - "Martin Rixham" - ], - "license": "Apache-2.0", - "devDependencies": { - "babel-core": "6.18.2", - "babel-loader": "6.2.8", - "babel-preset-es2015": "6.18.0", - "webpack": "1.13.3" - }, - "dependencies": { - "Datum": "0.12.2" - } -} diff --git a/frameworks/keyed/datum/src/Main.js b/frameworks/keyed/datum/src/Main.js deleted file mode 100644 index da0958eb8..000000000 --- a/frameworks/keyed/datum/src/Main.js +++ /dev/null @@ -1,101 +0,0 @@ -const Datum = require('Datum'); - -var HomeViewModel = function () { - - this.data = []; - - var selected = new Datum(); - - var id = 1; - - var self = this; - - var adjectives = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy"]; - var colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"]; - var nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"]; - - function getRandomNumber(max) { - return Math.round(Math.random() * 1000) % max; - } - - function buildData(count) { - var data = []; - for (var i = 0; i < count; i++) { - data.push(new ItemViewModel(id++, getRandomLabel())); - } - return data; - } - - function getRandomLabel() { - return adjectives[getRandomNumber(adjectives.length)] + " " + - colours[getRandomNumber(colours.length)] + " " + - nouns[getRandomNumber(nouns.length)]; - } - - this.run = new Datum.Click(function () { - this.data = buildData(1000); - selected(null); - }); - - this.runLots = new Datum.Click(function () { - this.data = buildData(10000); - selected(null); - }); - - this.add = new Datum.Click(function () { - this.data.push.apply(this.data, buildData(1000)); - }); - - this.update = new Datum.Click(function () { - for (var i = 0; i < this.data.length; i += 10) { - this.data[i].update(); - } - }); - - this.clear = new Datum.Click(function () { - this.data = []; - selected(null); - }); - - this.swapRows = new Datum.Click(function () { - if (this.data.length > 998) { - var a = this.data[1]; - var b = this.data.splice(998, 1, a)[0]; - this.data.splice(1, 1, b); - } - }); - - function ItemViewModel(id, itemLabel) { - - var label = new Datum(itemLabel); - - this.label = new Datum.Text(label); - - this.id = new Datum.Text(function() { - - return id; - }); - - this.update = function() { - label(label() + " !!!"); - }; - - this.del = new Datum.Click(function () { - var index = self.data.indexOf(this); - self.data.splice(index, 1); - }); - - this.select = new Datum.Binding({ - click: function() { - selected(this); - }, - classes: { - danger: function() { - return selected() == this; - } - } - }); - } -}; - -new Datum.BindingRoot(new HomeViewModel()); diff --git a/frameworks/keyed/datum/webpack.config.js b/frameworks/keyed/datum/webpack.config.js deleted file mode 100644 index 066cdf1ec..000000000 --- a/frameworks/keyed/datum/webpack.config.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -var cache = {}; -var loaders = [ - { - test: /\.js$/, - loader: 'babel-loader', - exclude: /node_modules/ - }, - { - test: /\.css$/, - loader: 'style-loader!css-loader' - } -]; -var extensions = [ - '', '.js', '.jsx', '.es6.js' -]; - -module.exports = [{ - cache: cache, - module: { - loaders: loaders - }, - entry: { - main: './src/Main.js', - }, - output: { - path: './dist', - filename: '[name].js' - }, - resolve: { - extensions: extensions, - root: [ - __dirname, - __dirname + '/src' - ], - alias: { - "Datum": __dirname+"/node_modules/Datum/target/Datum.js" - } - } -}]; diff --git a/frameworks/keyed/dojo/.dojorc b/frameworks/keyed/dojo/.dojorc deleted file mode 100644 index d7475edc7..000000000 --- a/frameworks/keyed/dojo/.dojorc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "build-app": { - "base": "/frameworks/keyed/dojo/output/dist/" - }, - "create-app": {} -} diff --git a/frameworks/keyed/dojo/.gitignore b/frameworks/keyed/dojo/.gitignore deleted file mode 100644 index c7f3174c5..000000000 --- a/frameworks/keyed/dojo/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -_build -/output diff --git a/frameworks/keyed/dojo/README.md b/frameworks/keyed/dojo/README.md deleted file mode 100644 index 407491bf9..000000000 --- a/frameworks/keyed/dojo/README.md +++ /dev/null @@ -1 +0,0 @@ -# dojo-v6.0.0-keyed diff --git a/frameworks/keyed/dojo/package.json b/frameworks/keyed/dojo/package.json deleted file mode 100644 index 3b43f6b9e..000000000 --- a/frameworks/keyed/dojo/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "dojo-keyed", - "version": "1.0.0", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "@dojo/framework", - "customURL": "/output/dist", - "issues": [694] - }, - "scripts": { - "build-prod": "./node_modules/.bin/dojo build" - }, - "dependencies": { - "@dojo/framework": "^6.0.0" - }, - "devDependencies": { - "@dojo/cli": "^6.0.0", - "@dojo/cli-build-app": "^6.0.0", - "typescript": "3.5.2" - } -} diff --git a/frameworks/keyed/dojo/src/App.ts b/frameworks/keyed/dojo/src/App.ts deleted file mode 100644 index b0ead98f9..000000000 --- a/frameworks/keyed/dojo/src/App.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { create, v, w } from '@dojo/framework/core/vdom'; -import Row from './Row'; -import Buttons from './Buttons'; -import store from './Store'; - -const factory = create({ store }); - -export default factory(function App({ middleware: { store }}) { - - const buttonConfigs = [ - { id: 'run', label: 'Create 1,000 rows', onClick: store.run }, - { id: 'runlots', label: 'Create 10,000 rows', onClick: store.runLots }, - { id: 'add', label: 'Append 1,000 rows', onClick: store.add }, - { id: 'update', label: 'Update every 10th row', onClick: store.update }, - { id: 'clear', label: 'Clear', onClick: store.clear }, - { id: 'swaprows', label: 'Swap Rows', onClick: store.swapRows } - ]; - - const rows = store.ids.map((id) => { - return w(Row, { - id, - key: id, - onSelect: store.select - }); - }); - - return v('div', { key: 'root', classes: [ 'container' ] }, [ - w(Buttons, { buttonConfigs }), - v('table', { classes: [ 'table', 'table-hover', 'table-striped', 'test-data' ] }, [ - v('tbody', rows) - ]), - v('span', { classes: [ 'preloadicon', 'glyphicon', 'glyphicon-remove' ] }) - ]); -}); diff --git a/frameworks/keyed/dojo/src/Button.ts b/frameworks/keyed/dojo/src/Button.ts deleted file mode 100644 index 6f4c875b7..000000000 --- a/frameworks/keyed/dojo/src/Button.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { create, w, v } from '@dojo/framework/core/vdom' - -export interface ButtonProperties { - id: string; - label: string; - onClick: () => void; -} - -const factory = create().properties(); - -export default factory(function Button({ properties }) { - const { id, label, onClick } = properties(); - - return v('div', { classes: [ 'col-sm-6', 'smallpad' ] }, [ - v('button', { - id, - classes: [ 'btn', 'btn-primary', 'btn-block' ], - onclick: onClick - }, [ label ]) - ]); -}); diff --git a/frameworks/keyed/dojo/src/Buttons.ts b/frameworks/keyed/dojo/src/Buttons.ts deleted file mode 100644 index ca9537982..000000000 --- a/frameworks/keyed/dojo/src/Buttons.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { create, w, v } from '@dojo/framework/core/vdom' -import Button from './Button'; - -export interface ButtonConfig { - id: string; - label: string; - onClick: () => void; -} - -export interface ButtonsProperties { - buttonConfigs: ButtonConfig[]; -} - -const factory = create().properties(); - -export default factory(function Buttons({ properties }) { - const { buttonConfigs } = properties(); - return v('div', { classes: [ 'jumbotron' ] }, [ - v('div', { classes: [ 'row' ] }, [ - v('div', { classes: [ 'col-md-6' ] }, [ - v('h1', ['Dojo v6.0.0']) - ]), - v('div', { classes: [ 'col-md-6' ] }, buttonConfigs.map(({ id, label, onClick }) => { - return w(Button, { key: id, id, label, onClick }); - })) - ]) - ]); -}); diff --git a/frameworks/keyed/dojo/src/Row.ts b/frameworks/keyed/dojo/src/Row.ts deleted file mode 100644 index 4090965e2..000000000 --- a/frameworks/keyed/dojo/src/Row.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { create, v } from '@dojo/framework/core/vdom'; -import store from './Store'; - -export interface RowProperties { - id: number; - onSelect: Function; -} - -const factory = create({ store }).properties(); - -export default factory(function Row({ properties, middleware: { store } }) { - const { id, onSelect } = properties(); - const item = store.item; - - if (!item) { - return null; - } - - return v('tr', { - key: id, - classes: [ store.selected === id && 'danger' ] - }, [ - v('td', { classes: [ 'col-md-1' ] }, [ `${id}` ]), - v('td', { classes: [ 'col-md-4' ] }, [ - v('a', { onclick: () => { - onSelect(id); - } }, [ item.label ]) - ]), - v('td', { classes: [ 'col-md-1' ] }, [ - v('a', { onclick: () => { - store.del(); - } }, [ - v('span', { - 'aria-hidden': true, - classes: [ 'glyphicon', 'glyphicon-remove' ] - }) - ]) - ]), - v('td', { classes: [ 'col-md-6' ] }) - ]); -}); diff --git a/frameworks/keyed/dojo/src/Store.ts b/frameworks/keyed/dojo/src/Store.ts deleted file mode 100644 index e66bf078e..000000000 --- a/frameworks/keyed/dojo/src/Store.ts +++ /dev/null @@ -1,185 +0,0 @@ -import { create, invalidator } from '@dojo/framework/core/vdom'; - -function random(max: number) { - return Math.round(Math.random() * 1000) % max; -} - -export interface Item { - id: number; - label: string; -} - -export interface Data { - [index: string]: Item; -} - -const adjectives = [ - 'pretty', - 'large', - 'big', - 'small', - 'tall', - 'short', - 'long', - 'handsome', - 'plain', - 'quaint', - 'clean', - 'elegant', - 'easy', - 'angry', - 'crazy', - 'helpful', - 'mushy', - 'odd', - 'unsightly', - 'adorable', - 'important', - 'inexpensive', - 'cheap', - 'expensive', - 'fancy' -]; - -const colours = [ - 'red', - 'yellow', - 'blue', - 'green', - 'pink', - 'brown', - 'purple', - 'brown', - 'white', - 'black', - 'orange' -]; - -const nouns = [ - 'table', - 'chair', - 'house', - 'bbq', - 'desk', - 'car', - 'pony', - 'cookie', - 'sandwich', - 'burger', - 'pizza', - 'mouse', - 'keyboard' -]; - -const factory = create({ invalidator }); - -let id = 1; -let data: Data = {}; -let ids = new Set(); -let selected: number | undefined; -let invalidatorMap = new Map(); -let appInvalidator: Function; - -function buildData(count: number = 1000): { data: Data; ids: Set } { - const data: Data = {}; - const ids = new Set(); - for (let i = 0; i < count; i++) { - const adjective = adjectives[random(adjectives.length)]; - const colour = colours[random(colours.length)]; - const noun = nouns[random(nouns.length)]; - const label = `${adjective} ${colour} ${noun}`; - data[id] = { id, label }; - ids.add(id); - id = id + 1; - } - return { data, ids }; -} - -export default factory(({ properties, middleware: { invalidator }}) => { - const { key: widgetKey = 'app' } = properties(); - if (widgetKey === 'app') { - appInvalidator = invalidator; - } else { - invalidatorMap.set(widgetKey, invalidator); - } - - function invalidate(id: string | number = 'app') { - if (id === 'app') { - appInvalidator(); - } else if (invalidatorMap.has(id)) { - invalidatorMap.get(id)!(); - } - } - - return { - get ids(): number[] { - return Array.from(ids); - }, - get item(): Item | undefined { - return data[widgetKey]; - }, - get selected(): number | undefined { - return selected; - }, - del: () => { - if (typeof widgetKey === 'number') { - ids.delete(widgetKey); - delete data[widgetKey]; - invalidate(widgetKey); - } - }, - run: () => { - const builtData = buildData(); - ids = builtData.ids; - data = builtData.data; - selected = undefined; - invalidate(); - invalidatorMap.clear(); - }, - add: () => { - const builtData = buildData(); - data = { ...data, ...builtData.data }; - ids = new Set([...ids, ...builtData.ids]); - invalidate(); - }, - update: () => { - const idArray = [ ...ids ]; - for (let i = 0; i < idArray.length; i += 10) { - const itemId = idArray[i]; - const item = data[itemId]; - data[itemId] = { ...item, label: `${item.label} !!!`}; - invalidate(itemId); - } - }, - select: (id: number) => { - selected && invalidate(selected); - invalidate(id); - selected = id; - }, - runLots: () => { - const builtData = buildData(10000); - ids = builtData.ids; - data = builtData.data; - selected = undefined; - invalidate(); - invalidatorMap.clear(); - }, - clear: () => { - data = {}; - ids.clear(); - selected = undefined; - invalidate(); - invalidatorMap.clear(); - }, - swapRows: () => { - const idArray = [ ...ids ]; - if (idArray.length > 998) { - const row = idArray[1]; - idArray[1] = idArray[998]; - idArray[998] = row; - } - ids = new Set(idArray); - invalidate(); - } - } -}); diff --git a/frameworks/keyed/dojo/src/index.html b/frameworks/keyed/dojo/src/index.html deleted file mode 100644 index c5c3f6f91..000000000 --- a/frameworks/keyed/dojo/src/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - dojo-keyed - - - - - diff --git a/frameworks/keyed/dojo/src/main.css b/frameworks/keyed/dojo/src/main.css deleted file mode 100644 index 214e8ff5b..000000000 --- a/frameworks/keyed/dojo/src/main.css +++ /dev/null @@ -1 +0,0 @@ -/* Put your styles and imports here */ diff --git a/frameworks/keyed/dojo/src/main.ts b/frameworks/keyed/dojo/src/main.ts deleted file mode 100644 index 0dd49e5af..000000000 --- a/frameworks/keyed/dojo/src/main.ts +++ /dev/null @@ -1,5 +0,0 @@ -import renderer, { w } from '@dojo/framework/core/vdom'; -import App from './App'; - -const r = renderer(() => w(App, {})); -r.mount(); diff --git a/frameworks/keyed/dojo/tsconfig.json b/frameworks/keyed/dojo/tsconfig.json deleted file mode 100644 index db539e568..000000000 --- a/frameworks/keyed/dojo/tsconfig.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "compilerOptions": { - "declaration": false, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "lib": [ - "dom", - "es5", - "es2015.promise", - "es2015.iterable", - "es2015.symbol", - "es2015.symbol.wellknown" - ], - "module": "umd", - "moduleResolution": "node", - "noImplicitAny": true, - "noImplicitThis": true, - "outDir": "_build/", - "removeComments": false, - "sourceMap": true, - "strictNullChecks": true, - "target": "es6" - }, - "include": [ - "./src/**/*.ts" - ] -} diff --git a/frameworks/keyed/domc/app.old.js b/frameworks/keyed/domc/app.old.js deleted file mode 100644 index 0bc4db4d4..000000000 --- a/frameworks/keyed/domc/app.old.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(){"use strict";const e=(e,t)=>{const n=`__${t}`;let i=e.target,o=`__${t}Data`;for(;null!==i;){const t=i[n];if(t)return void(i[o]?t(i[o]):t(e));i=i.parentNode}},t={};function n(n){t[n]||(document.addEventListener(n,t=>e(t,n)),t[n]=!0)}function i(){const{possible:e,n:t}=i;let n,o=t.toString(26).split(""),r="";for(;n=o.shift();)r+=e[parseInt(n,26)];return i.n++,r}i.possible="abcdefghijklmnopqrstuvwxyz",i.n=0;const o={};class r{constructor(){this.varCode=this.vdomCode=this.compareCode=this.refsCode=this.directiveSetupCode=this.directiveUpdateCode="",this.scopeVars={},this.component=null}compile(e){let t,n,i,o,r=!1,s="node",d=e;if(!((o=this.codegen(d,s))>0)){s="";do{if(!r&&(t=d.firstChild)){if(3===t.nodeType&&""===t.nodeValue.trim()){t.parentNode.removeChild(t);continue}r=!1,n=s,s+="_f",this.varCode+=`let ${s} = ${n||"node"}.firstChild;\n`,(o=this.codegen(t,s))>0&&(r=!0)}else if(t=d.nextSibling){if(3===t.nodeType&&""===t.nodeValue.trim()){t.parentNode.removeChild(t);continue}r=!1,n=s,s+="_n",this.varCode+=`let ${s} = ${n||"node"}.nextSibling;\n`,(o=this.codegen(t,s))>0&&(r=!0)}else s="n"===s[(i=s.length)-1]?s.slice(0,s.lastIndexOf("_f_n")):s.slice(0,i-2),t=d.parentNode,r=!0;if((d=t)===e)break}while(d)}}codegen(e,t){let r=e.nodeType,s=e.nodeName;if(8===r){const n=e.nodeValue.trim();return"#"===n[0]&&("#"===n[1]?this.directiveSetupCode+=`for(let i = 0; i < scope.${n.slice(2)}.length; i++) ${t}.parentNode.insertBefore(scope.${n.slice(2)}[i], ${t});\n${t}.parentNode.removeChild(${t});\n`:this.directiveSetupCode+=`${t}.parentNode.replaceChild(scope.${n.slice(1)}, ${t});\n`),0}if(3!==r){if(void 0!==e.attributes){let r=[];for(let s of e.attributes){let d=s.name,l=s.value;if("i"===d[0]&&"s"===d[1]){if(e.removeAttribute(d),"node"===t)this.component=o[l](e);else{const e=i();this.directiveSetupCode+=`let __${e} = utils["${l}"](${t})(scope);\n${t}.parentNode.replaceChild(__${e}, ${t});\n`,this.directiveUpdateCode+=` __${e}.update(scope);\n`}return 1}if("v"===d[0]&&"-"===d[1]){e.removeAttribute(d);const n=d.slice(2),o=i();return this.directiveSetupCode+=`let __${o} = utils.${n}(${t}, "${l}");\n`,this.directiveUpdateCode+=` __${o}(scope);\n`,1}if("o"===d[0]&&"n"===d[1]){const e=d.slice(2);n(e);const o=l,s=o.indexOf("(");let c,a;if(s>=0){c=o.slice(0,s);const e=o.slice(s+1,o.length-1);a=e.length>0?e.split(","):[]}else c=o,a=[];if(a.length>0){const n=i();this.refsCode+=`${t}.__${e} = scope.${c};\n`,this.vdomCode+=` vdom.${n} = ${a};\n`,this.compareCode+=` if (current.${n} !== vdom.${n}) ${t}.__${e}Data = vdom.${n};\n`}else this.refsCode+=`${t}.__${e} = scope.${c};\n`;r.push(d);for(let e,t,n=0;n=97&&e<=122&&(t.indexOf(".")>=0?this.scopeVars[t.slice(0,t.indexOf("."))]=!0:this.scopeVars[t]=!0)}else if(l.indexOf("{{")>=0){if("class"===d){const e=i();this.vdomCode+=` vdom.${e} = \`${l.replace(/{{/g,"${").replace(/}}/g,"}")}\`;\n`,this.compareCode+=` if (current.${e} !== vdom.${e}) ${t}.className = vdom.${e};\n`}else if("style"===d){let e=l.replace("{{","").replace("}}","").trim();this.directiveSetupCode+="let __style = node.style;\n",this.directiveUpdateCode+=` let scopeStyle = scope.${e};\n for(let key in scopeStyle) if(scopeStyle[key] !== __style[key]) __style[key] = scopeStyle[key];\n`}else{const e=i();this.vdomCode+=` vdom.${e} = \`${l.replace(/{{/g,"${").replace(/}}/g,"}")}\`;\n`,this.compareCode+=` if (current.${e} !== vdom.${e}) ${t}.setAttribute("${d}", vdom.${e});\n`}let e,n,o;for(;(e=l.indexOf("{{"))>=0;){n=l.indexOf("}}"),o=l.slice(e+2,n).split(/[\s\(\)]/g);for(let e,t,n=0;n=97&&e<=122&&(t.indexOf(".")>=0?this.scopeVars[t.slice(0,t.indexOf("."))]=!0:this.scopeVars[t]=!0);l=l.slice(n+1)}r.push(d)}}for(let t of r)e.removeAttribute(t)}}else{let n=e.nodeValue.trim();if(n.indexOf("{{")>=0){const o=i();let r,s,d;for(this.vdomCode+=` vdom.${o} = \`${n.replace(/{{/g,"${").replace(/}}/g,"}")}\`;\n`,this.compareCode+=` if (current.${o} !== vdom.${o}) ${t}.nodeValue = vdom.${o};\n`,e.nodeValue="";(r=n.indexOf("{{"))>=0;){s=n.indexOf("}}"),d=n.slice(r+2,s).split(/[\s\(\)]/g);for(let e,t,n=0;n=97&&e<=122&&(t.indexOf(".")>=0?this.scopeVars[t.slice(0,t.indexOf("."))]=!0:this.scopeVars[t]=!0);n=n.slice(s+1)}}}if(s.indexOf("-")>0){if("node"===t)this.component=o[s.toLowerCase()](e);else{const e=i();this.directiveSetupCode+=`let __${e} = utils["${s.toLowerCase()}"](${t})(scope);\n${t}.parentNode.replaceChild(__${e}, ${t});\n`,this.directiveUpdateCode+=` __${e}.update(scope);\n`}return 1}return 0}createFn(){if(this.component)return this.component;let e="";for(let t of Object.keys(this.scopeVars))e+=t+",";return Function("scope","node","utils","rehydrate","if (rehydrate !== true) node = node.cloneNode(true);\n"+this.varCode+"\n"+this.refsCode+"\n"+this.directiveSetupCode+"\n"+`let current = {};\nnode.update = function(scope) {\n${this.vdomCode.length>0?` const {${e}} = scope;\n\n const vdom = {};\n${this.vdomCode}\n${this.compareCode}\n current = vdom;\n`:""}\n${this.directiveUpdateCode}}\n`+"return node;")}}class s{constructor(e,t){this.dom=e,this.create=t}createInstance(e){const t=this.create(e,this.dom,o);return t.update(e),t}rehydrate(e){this.create(e,this.dom,o,!0),this.dom.update(e)}}function d(e){const t=new r;t.compile(e);const n=t.createFn();return new s(e,n)}d.customDirectives=o;const l=document.createElement("template");function c(e,t){var n=-1,i=e.length;if(i>0&&e[i-1]<=t)return i-1;for(;i-n>1;){var o=Math.floor((n+i)/2);e[o]>t?i=o:n=o}return n}d.component=function(e,t){let n,i,o;"string"==typeof t?n=t:(n=t.template,i=t.create,o=t.update),l.innerHTML=n.trim();let r=d(l.content.firstChild);d.customDirectives[e]=function(e){let t,n,s=1,d=void 0===i&&void 0===o,l=void 0===e.attributes||0===e.attributes.length,c=null===e.firstChild||1===e.childNodes.length&&3===e.firstChild.nodeType&&""===e.firstChild.nodeValue.trim();if(d&&l&&c&&(s=0),0===s)return Function("cNode","\n return function(scope) { return cNode.createInstance(scope) }\n ")(r);if(!l){let n="const vs = {};\n";for(let t of e.attributes)n+=`vs["${t.name}"] = scope["${t.value}"];\n`;t=Function("scope",n+"return vs;\n")}return c||(n=Array.from(e.childNodes)),e=>{let s,d,l=Object.assign({nodeRender:()=>{o&&Object.assign(l,o(l)),d(l)}},e);return t&&Object.assign(l,t(l)),l.children=n,i&&Object.assign(l,i(l)),l.node=s=r.createInstance(l),d=s.update,s.update=function(e){Object.assign(l,e,l),t&&Object.assign(l,t(l),l),o&&Object.assign(l,o(l)),d(l)},s}}},d.app=function(e){l.innerHTML=e.trim();let t=d(l.content.firstChild);return function(e){let n;return e.render=()=>n.update(e),n=t.createInstance(e)}},o.for=function(e,t="item of data"){const n=e.parentNode;n.textContent="";let i=[];const o=t.indexOf(" of "),r=t.slice(o+4),s=t.slice(0,o),l=d(e);return e=>{const t=Object.assign({},e),o=e[r];!function(e,t,n,i,o){if(0===n.length)return void(e.textContent="");if(0===t.length){let t;for(let o=0,r=n.length;o=0;s=r[s],o--)n[o]=s;return n}(g,a),x=[];let O=h;for(let e=l;e<=u;e++)x[e]=O,O=O.nextSibling;for(let t=0;t=a;t--)_[k]===t?(d=x[g[_[k]]],o(d,n[t]),k--):(-1===g[t]?S=i(n[t]):(S=x[g[t]],o(n[t])),e.insertBefore(S,d),d=S)}(n,i,o,e=>(t[s]=e,l.createInstance(t)),(e,n)=>{t[s]=n,e.update(t)}),i=o.slice(0)}};var a=1,f=function(e){for(var t=["pretty","large","big","small","tall","short","long","handsome","plain","quaint","clean","elegant","easy","angry","crazy","helpful","mushy","odd","unsightly","adorable","important","inexpensive","cheap","expensive","fancy"],n=["red","yellow","blue","green","pink","brown","purple","brown","white","black","orange"],i=["table","chair","house","bbq","desk","car","pony","cookie","sandwich","burger","pizza","mouse","keyboard"],o=[],r=0;r998){var t=e[1];e[1]=e[998],e[998]=t}h.update(p)},del:function(e){var t=e.id,n=p.data,i=n.findIndex(function(e){return e.id===t});n.splice(i,1),h.update(p)},select:function(e){p.selected=parseInt(e.id),h.update(p)},selected:0,data:[]},h=document.getElementById("main");d(h).rehydrate(p)}(); -//# sourceMappingURL=app.min.js.map diff --git a/frameworks/keyed/domc/index.html b/frameworks/keyed/domc/index.html deleted file mode 100644 index a243d772b..000000000 --- a/frameworks/keyed/domc/index.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - domc-keyed - - - - -
-
-
-
-

domc-keyed

-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
-
- - - - - - - - - -
{{item.id}} - {{item.label}} -
- - -
- - diff --git a/frameworks/keyed/domc/package.json b/frameworks/keyed/domc/package.json deleted file mode 100644 index d07ca07ec..000000000 --- a/frameworks/keyed/domc/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "js-framework-benchmark-domc", - "version": "1.0.0", - "description": "domc demo", - "main": "dist/app.min.js", - "scripts": { - "build-dev": "rollup -c -w", - "build-prod": "rollup -c" - }, - "js-framework-benchmark": { - "frameworkVersionFromPackage": "domc" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/krausest/js-framework-benchmark.git" - }, - "keywords": [ - "domc" - ], - "author": "Pavel Martynov", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/krausest/js-framework-benchmark/issues" - }, - "homepage": "https://github.com/krausest/js-framework-benchmark#readme", - "dependencies": { - "domc": "0.0.12" - }, - "devDependencies": { - "@babel/core": "7.4.5", - "@babel/plugin-external-helpers": "7.2.0", - "@babel/preset-env": "7.4.5", - "rollup": "1.16.6", - "rollup-plugin-babel": "4.3.3", - "rollup-plugin-node-resolve": "5.2.0", - "rollup-plugin-terser": "5.1.1", - "rollup-plugin-uglify": "6.0.2", - "uglify-es": "3.3.9" - } -} diff --git a/frameworks/keyed/domc/rollup.config.js b/frameworks/keyed/domc/rollup.config.js deleted file mode 100644 index 6de3665af..000000000 --- a/frameworks/keyed/domc/rollup.config.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -import * as path from 'path'; -import babel from 'rollup-plugin-babel'; -import resolve from 'rollup-plugin-node-resolve'; -import { terser } from "rollup-plugin-terser"; - -export default { - input: 'src/app.js', - output: { - file: 'dist/app.min.js', - format: 'iife', - name: 'app', - sourcemap: true, - }, - plugins: [ - resolve({ - module: true, - jsnext: true, - browser: true, - }), - babel({ - exclude: 'node_modules/**', - presets: [ - [ "@babel/preset-env", { - "targets": { - "browsers": ["last 1 chrome versions"] - } - }] - ], - plugins: [ - "@babel/plugin-external-helpers" - ], - runtimeHelpers: true, - babelrc: false, - }), - terser() - ], -} diff --git a/frameworks/keyed/domc/src/app.js b/frameworks/keyed/domc/src/app.js deleted file mode 100644 index 8e6ef0d6e..000000000 --- a/frameworks/keyed/domc/src/app.js +++ /dev/null @@ -1,74 +0,0 @@ - -import domc from 'domc' -import '../node_modules/domc/vFor.js' - -let did = 1 -const buildData = (count) => { - var adjectives = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy"]; - var colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"]; - var nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"]; - var data = []; - for (var i = 0; i < count; i++) { - data.push({ - id: did++, - label: adjectives[_random(adjectives.length)] + " " + colours[_random(colours.length)] + " " + nouns[_random(nouns.length)] - }); - } - return data; -} -const _random = (max) => { - return Math.round(Math.random() * 1000) % max; -} - -const scope = { - add: () => { - scope.data = scope.data.concat(buildData(1000)) - main.update(scope) - }, - run: () => { - scope.data = buildData(1000) - main.update(scope) - }, - runLots: () => { - scope.data = buildData(10000) - main.update(scope) - }, - clearData: () => { - scope.data = [] - main.update(scope) - }, - update: () => { - const data = scope.data - for (let i=0;i { - const data = scope.data - if(data.length > 998) { - var tmp = data[1]; - data[1] = data[998]; - data[998] = tmp; - } - - main.update(scope) - }, - del: item => { - const id = item.id - const data = scope.data - const idx = data.findIndex(d => d.id === id); - data.splice(idx, 1) - main.update(scope) - }, - select: item => { - scope.selected = parseInt(item.id) - main.update(scope) - }, - selected: 0, - data: [], -} - -const main = document.getElementById('main') -const app = domc(main) -app.rehydrate(scope) diff --git a/frameworks/keyed/domdiff/index.html b/frameworks/keyed/domdiff/index.html deleted file mode 100644 index be1529c7b..000000000 --- a/frameworks/keyed/domdiff/index.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - domdiff keyed - - - - -
-
-
-
-

domdiff keyed

-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
-
- - -
- -
- - diff --git a/frameworks/keyed/domdiff/package.json b/frameworks/keyed/domdiff/package.json deleted file mode 100644 index af0480fb7..000000000 --- a/frameworks/keyed/domdiff/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "js-framework-benchmark-domdiff", - "version": "1.0.0", - "description": "domdiff demo", - "main": "index.js", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "domdiff" - }, - "scripts": { - "build-dev": "rollup -c -w", - "build-prod": "rollup -c" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/krausest/js-framework-benchmark.git" - }, - "keywords": [ - "domdiff" - ], - "author": "Mathis Zeiher", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/krausest/js-framework-benchmark/issues" - }, - "homepage": "https://github.com/krausest/js-framework-benchmark#readme", - "dependencies": { - "domdiff": "2.2.2", - "js-framework-benchmark-utils": "0.2.5" - }, - "devDependencies": { - "rollup": "^2.0.6", - "rollup-plugin-node-resolve": "^5.2.0", - "rollup-plugin-terser": "^5.3.0" - } -} diff --git a/frameworks/keyed/domdiff/rollup.config.js b/frameworks/keyed/domdiff/rollup.config.js deleted file mode 100644 index e785c4ad9..000000000 --- a/frameworks/keyed/domdiff/rollup.config.js +++ /dev/null @@ -1,17 +0,0 @@ -import resolve from 'rollup-plugin-node-resolve'; -import {terser} from 'rollup-plugin-terser'; - -export default { - input: 'src/index.js', - plugins: [ - resolve(), - terser() - ], - context: 'null', - moduleContext: 'null', - output: { - file: 'dist/index.js', - format: 'iife', - name: 'app' - } -}; diff --git a/frameworks/keyed/domdiff/src/index.js b/frameworks/keyed/domdiff/src/index.js deleted file mode 100644 index 2d33ffcb7..000000000 --- a/frameworks/keyed/domdiff/src/index.js +++ /dev/null @@ -1,31 +0,0 @@ -import domdiff from 'domdiff'; -import {State} from 'js-framework-benchmark-utils'; -import {getRow} from './utils.js'; - -const tbody = document.querySelector('tbody'); -let rows = [].slice.call(tbody.children); -const state = State(({data, selected, select, remove}) => { - rows = domdiff( - tbody, - rows, - data.map(item => { - const {id, label} = item; - const info = getRow(data, select, remove, id, label); - const {row, selector, td} = info; - if (info.id !== id) - td.textContent = (row.id = (info.id = id)); - if (info.label !== label) - selector.textContent = (info.label = label); - const danger = id === selected; - if (info.danger !== danger) - row.classList.toggle('danger', (info.danger = danger)); - return row; - }) - ); -}); - -Object.keys(state).forEach(id => { - const button = document.querySelector(`#${id.toLowerCase()}`); - if (button) - button.addEventListener('click', () => state[id]()); -}); diff --git a/frameworks/keyed/domdiff/src/utils.js b/frameworks/keyed/domdiff/src/utils.js deleted file mode 100644 index 43fe3a402..000000000 --- a/frameworks/keyed/domdiff/src/utils.js +++ /dev/null @@ -1,39 +0,0 @@ -const template = document.createElement('template'); -template.innerHTML = ` - - - - - - - - -`.trim(); -const tr = template.content.firstChild; - -const createRow = (select, remove, id, label) => { - const row = tr.cloneNode(true); - const td = row.querySelector('td'); - td.textContent = (row.id = id); - - const [selector, remover] = row.querySelectorAll('a'); - selector.textContent = label; - selector.addEventListener('click', () => select(id)); - remover.addEventListener('click', () => remove(id)); - - return {danger: false, id, label, row, selector, td}; -}; - -const {create} = Object; -const rows = new WeakMap; - -const setCache = data => { - const cache = create(null); - rows.set(data, cache); - return cache; -}; - -export const getRow = (data, select, remove, id, label) => { - const cache = rows.get(data) || setCache(data); - return cache[id] || (cache[id] = createRow(select, remove, id, label)); -}; diff --git a/frameworks/keyed/dominator/.gitignore b/frameworks/keyed/dominator/.gitignore deleted file mode 100644 index 047278d56..000000000 --- a/frameworks/keyed/dominator/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -/target -/pkg -/wasm-pack.log -/yarn-error.log diff --git a/frameworks/keyed/dominator/Cargo.toml b/frameworks/keyed/dominator/Cargo.toml deleted file mode 100644 index e260c680c..000000000 --- a/frameworks/keyed/dominator/Cargo.toml +++ /dev/null @@ -1,29 +0,0 @@ -[package] -name = "js-framework-benchmark-dominator" -version = "1.0.0" -edition = "2018" - -[profile.release] -lto = true -panic = "abort" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -dominator = "0.5.0" -futures-signals = "0.3.6" -wasm-bindgen = "0.2.46" -js-sys = "0.3.23" - -[dependencies.web-sys] -version = "0.3.23" -features = [ - "Window", - "Document", - "Element", -] - -[dependencies.wasm-bindgen-futures] -version = "0.3.24" -features = ["futures_0_3"] diff --git a/frameworks/keyed/dominator/README.md b/frameworks/keyed/dominator/README.md deleted file mode 100644 index 059eac9cc..000000000 --- a/frameworks/keyed/dominator/README.md +++ /dev/null @@ -1,16 +0,0 @@ -Because of the heavy amount of Rust dependencies, this example is pre-compiled, so you don't need to compile anything. - -However, if you do want to compile it, you will need the following: - -* [Rust](https://www.rust-lang.org/tools/install) - -* [wasm-pack](https://rustwasm.github.io/wasm-pack/) - -After installing those, run these commands: - -``` -rustup toolchain install nightly -rustup override set nightly -npm install -npm run build-prod-force -``` diff --git a/frameworks/keyed/dominator/bundled-dist/1.js b/frameworks/keyed/dominator/bundled-dist/1.js deleted file mode 100644 index 41f74e726..000000000 --- a/frameworks/keyed/dominator/bundled-dist/1.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[1],[,function(n,t,e){"use strict";e.r(t);var r=e(2);function c(){return r.d()}e.d(t,"main_js",function(){return c}),e.d(t,"__wbindgen_object_clone_ref",function(){return w}),e.d(t,"__wbindgen_object_drop_ref",function(){return g}),e.d(t,"__wbindgen_cb_forget",function(){return h}),e.d(t,"__wbindgen_cb_drop",function(){return v}),e.d(t,"__wbg_removeevent_c1c53d84f99418b3",function(){return p}),e.d(t,"__wbg_addclass_98f6d75340c883ab",function(){return m}),e.d(t,"__wbg_appendchild_66446c0dfd404e41",function(){return y}),e.d(t,"__wbg_createelement_362b6383204303eb",function(){return E}),e.d(t,"__widl_instanceof_HTMLElement",function(){return L}),e.d(t,"__wbg_random_4eec15c1337c828c",function(){return x}),e.d(t,"__wbindgen_string_new",function(){return j}),e.d(t,"__wbg_settextcontent_41d94df0242539e0",function(){return C}),e.d(t,"__wbg_addevent_c565d8397d798f9b",function(){return M}),e.d(t,"__wbg_setattribute_38575b25fc9198f7",function(){return k}),e.d(t,"__wbg_newnoargs_8d1797b163dbc9fb",function(){return A}),e.d(t,"__wbg_call_836fa928f74337e5",function(){return T}),e.d(t,"__widl_instanceof_Window",function(){return W}),e.d(t,"__widl_f_document_Window",function(){return B}),e.d(t,"__widl_f_get_element_by_id_Document",function(){return D}),e.d(t,"__wbg_resolve_3e3c14963c939fcd",function(){return H}),e.d(t,"__wbg_then_1469c8cdb2c56f2f",function(){return J}),e.d(t,"__wbindgen_throw",function(){return F}),e.d(t,"__wbg_removeclass_d627271f8d4311f5",function(){return I}),e.d(t,"__wbg_getat_93cbb0856a23a2bc",function(){return N}),e.d(t,"__wbg_insertchildbefore_88866440aac35d8f",function(){return P}),e.d(t,"__wbg_removechild_b47675f15e0460fd",function(){return U}),e.d(t,"__wbg_replacechild_c03cdfc26975e8db",function(){return q}),e.d(t,"__wbindgen_closure_wrapper92",function(){return z}),e.d(t,"__wbindgen_closure_wrapper120",function(){return G});const u=new Array(32);function i(n){return u[n]}u.fill(void 0),u.push(void 0,null,!0,!1);let o=u.length;function _(n){o===u.length&&u.push(u.length+1);const t=o;return o=u[t],u[t]=n,t}function f(n){const t=i(n);return function(n){n<36||(u[n]=o,o=n)}(n),t}let d=new TextDecoder("utf-8"),a=null;function s(n,t){return d.decode((null!==a&&a.buffer===r.e.buffer||(a=new Uint8Array(r.e.buffer)),a).subarray(n,n+t))}function l(n){return null==n}let b=32;const w=function(n){return _(i(n))},g=function(n){f(n)},h=function(n){f(n)},v=function(n){const t=f(n).original;return 1==t.cnt--&&(t.a=0,!0)},p=function(n,t,e){var r,c,u;r=i(n),c=i(t),u=i(e),r.removeEventListener(c,u,!1)},m=function(n,t){var e,r;e=i(n),r=i(t),e.classList.add(r)},y=function(n,t){var e,r;e=i(n),r=i(t),e.appendChild(r)},E=function(n){return _((t=i(n),document.createElement(t)));var t},L=function(n){return i(n)instanceof HTMLElement},x=void 0===Math.random?function(){throw new Error("imported function or type does not exist")}:Math.random,j=function(n,t){return _(s(n,t))},C=function(n,t){var e,r;e=i(n),r=i(t),e.textContent=r},M=function(n,t,e){var r,c,u;r=i(n),c=i(t),u=i(e),r.addEventListener(c,u,{capture:!1,once:!1,passive:!0})},k=function(n,t,e){var r,c,u;r=i(n),c=i(t),u=i(e),r.setAttribute(c,u)},A=function(n,t){let e=s(n,t);return _(new Function(e))},T=function(n,t){try{return _(i(n).call(i(t)))}catch(n){!function(n){r.b(_(n))}(n)}},W=function(n){return i(n)instanceof Window},B=function(n){const t=i(n).document;return l(t)?0:_(t)},D=function(n,t,e){let r=s(t,e);const c=i(n).getElementById(r);return l(c)?0:_(c)},H=function(n){return _(Promise.resolve(i(n)))},J=function(n,t){return _(i(n).then(i(t)))},F=function(n,t){let e=s(n,t);throw new Error(e)},I=function(n,t){var e,r;e=i(n),r=i(t),e.classList.remove(r)},N=function(n,t){return _((e=i(n),r=t>>>0,e.childNodes[r]));var e,r},P=function(n,t,e){var r,c,u;r=i(n),c=i(t),u=i(e),r.insertBefore(c,u)},U=function(n,t){var e,r;e=i(n),r=i(t),e.removeChild(r)},q=function(n,t,e){var r,c,u;r=i(n),c=i(t),u=i(e),r.replaceChild(c,u)},z=function(n,t,e){const c=r.a.get(31),i=r.a.get(16),o=t,f=function(n){this.cnt++;let t=this.a;this.a=0;try{return c(t,o,function(n){if(1==b)throw new Error("out of js stack");return u[--b]=n,b}(n))}finally{0==--this.cnt?i(t,o):this.a=t,u[b++]=void 0}};f.a=n,f.cnt=1;let d=f.bind(f);return d.original=f,_(d)},G=function(n,t,e){const c=r.a.get(15),u=r.a.get(16),i=t,o=function(n){this.cnt++;let t=this.a;this.a=0;try{return c(t,i,_(n))}finally{0==--this.cnt?u(t,i):this.a=t}};o.a=n,o.cnt=1;let f=o.bind(o);return f.original=o,_(f)};r.c()},function(n,t,e){"use strict";var r=e.w[n.i];n.exports=r;e(1);r.f()}]]); \ No newline at end of file diff --git a/frameworks/keyed/dominator/bundled-dist/accca9b65c226d0a493c.module.wasm b/frameworks/keyed/dominator/bundled-dist/accca9b65c226d0a493c.module.wasm deleted file mode 100644 index 6164f5cd9..000000000 Binary files a/frameworks/keyed/dominator/bundled-dist/accca9b65c226d0a493c.module.wasm and /dev/null differ diff --git a/frameworks/keyed/dominator/bundled-dist/index.js b/frameworks/keyed/dominator/bundled-dist/index.js deleted file mode 100644 index 46e8102a1..000000000 --- a/frameworks/keyed/dominator/bundled-dist/index.js +++ /dev/null @@ -1 +0,0 @@ -!function(e){function n(n){for(var t,_,o=n[0],c=n[1],i=0,u=[];i - - - - Dominator - - - -
- - - diff --git a/frameworks/keyed/dominator/js/index.js b/frameworks/keyed/dominator/js/index.js deleted file mode 100644 index 9db81ab6f..000000000 --- a/frameworks/keyed/dominator/js/index.js +++ /dev/null @@ -1 +0,0 @@ -import("../pkg/index.js").catch(console.error); diff --git a/frameworks/keyed/dominator/package.json b/frameworks/keyed/dominator/package.json deleted file mode 100644 index 329079ea3..000000000 --- a/frameworks/keyed/dominator/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "js-framework-benchmark-dominator", - "version": "1.0.0", - "description": "Benchmark for dominator", - "license": "ISC", - "js-framework-benchmark": { - "frameworkVersion": "0.5.0" - }, - "scripts": { - "build-prod": "echo This is a no-op. && echo Due to heavy dependencies, the generated javascript is already provided. && echo If you really want to rebuild from source use: && echo npm run build-prod-force", - "build-prod-force": "rimraf bundled-dist pkg && webpack" - }, - "repository": { - "type": "git", - "url": "https://github.com/krausest/js-framework-benchmark.git" - }, - "devDependencies": { - "@wasm-tool/wasm-pack-plugin": "^0.4.2", - "rimraf": "^2.6.3", - "webpack": "^4.35.0", - "webpack-cli": "^3.3.5" - } -} diff --git a/frameworks/keyed/dominator/src/lib.rs b/frameworks/keyed/dominator/src/lib.rs deleted file mode 100644 index 8740f782e..000000000 --- a/frameworks/keyed/dominator/src/lib.rs +++ /dev/null @@ -1,291 +0,0 @@ -use wasm_bindgen::prelude::*; -use std::rc::Rc; -use std::sync::atomic::{AtomicUsize, Ordering}; -use js_sys::Math; -use web_sys::window; -use futures_signals::signal::Mutable; -use futures_signals::signal_vec::{MutableVec, SignalVecExt}; -use dominator::{Dom, html, clone, events}; - - -const ADJECTIVES_LEN: usize = 25; -const ADJECTIVES_LEN_F64: f64 = ADJECTIVES_LEN as f64; -const ADJECTIVES: [&str; ADJECTIVES_LEN] = [ - "pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", - "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", - "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy", -]; - -const COLOURS_LEN: usize = 11; -const COLOURS_LEN_F64: f64 = COLOURS_LEN as f64; -const COLOURS: [&str; COLOURS_LEN] = [ - "red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", - "orange", -]; - -const NOUNS_LEN: usize = 13; -const NOUNS_LEN_F64: f64 = NOUNS_LEN as f64; -const NOUNS: [&str; NOUNS_LEN] = [ - "table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", - "pizza", "mouse", "keyboard", -]; - -fn random(max: f64) -> usize { - ((Math::random() * 1000.0) % max) as usize -} - - -#[inline] -fn col_md_6(children: &mut [Dom]) -> Dom { - html!("div", { - .class("col-md-6") - .children(children) - }) -} - -#[inline] -fn row(children: &mut [Dom]) -> Dom { - html!("div", { - .class("row") - .children(children) - }) -} - -#[inline] -fn button(id: &str, title: &str, mut on_click: F) -> Dom where F: FnMut() + 'static { - html!("div", { - .class(["col-sm-6", "smallpad"]) - .children(&mut [ - html!("button", { - .class(["btn", "btn-primary", "btn-block"]) - .attribute("type", "button") - .attribute("id", id) - .text(title) - .event(move |_: events::Click| { - on_click(); - }) - }), - ]) - }) -} - - -struct Row { - id: usize, - label: Mutable, -} - -impl Row { - fn new() -> Rc { - static ID_COUNTER: AtomicUsize = AtomicUsize::new(1); - - let adjective = ADJECTIVES[random(ADJECTIVES_LEN_F64)]; - let colour = COLOURS[random(COLOURS_LEN_F64)]; - let noun = NOUNS[random(NOUNS_LEN_F64)]; - - Rc::new(Self { - id: ID_COUNTER.fetch_add(1, Ordering::SeqCst), - label: Mutable::new(format!("{} {} {}", adjective, colour, noun)), - }) - } - - fn render(row: Rc, state: Rc) -> Dom { - let id = row.id; - - html!("tr", { - .class_signal("danger", state.selected_row.signal_ref(move |selected| { - if let Some(selected) = selected { - *selected == id - - } else { - false - } - })) - - .children(&mut [ - html!("td", { - .class("col-md-1") - .text(&id.to_string()) - }), - - html!("td", { - .class("col-md-4") - .children(&mut [ - html!("a", { - .text_signal(row.label.signal_cloned()) - .event(clone!(state => move |_: events::Click| { - state.select_row(id); - })) - }), - ]) - }), - - html!("td", { - .class("col-md-1") - .children(&mut [ - html!("a", { - .children(&mut [ - html!("span", { - .class(["glyphicon", "glyphicon-remove"]) - .attribute("aria-hidden", "true") - }), - ]) - .event(move |_: events::Click| { - state.remove_row(id); - }) - }), - ]) - }), - - html!("td", { - .class("col-md-6") - }), - ]) - }) - } -} - - -struct State { - rows: MutableVec>, - selected_row: Mutable>, -} - -impl State { - fn new() -> Rc { - Rc::new(Self { - rows: MutableVec::new(), - selected_row: Mutable::new(None), - }) - } - - fn clear(&self) { - self.rows.lock_mut().clear(); - self.selected_row.set(None); - } - - fn append(&self, count: usize) { - let mut rows = self.rows.lock_mut(); - - for _ in 0..count { - rows.push_cloned(Row::new()); - } - } - - fn create(&self, count: usize) { - let new_rows = (0..count).map(|_| Row::new()).collect(); - self.rows.lock_mut().replace_cloned(new_rows); - } - - fn update(&self) { - for row in self.rows.lock_ref().iter().step_by(10) { - row.label.lock_mut().push_str(" !!!"); - } - } - - fn swap(&self) { - let mut rows = self.rows.lock_mut(); - - if rows.len() > 998 { - rows.move_from_to(1, 998); - rows.move_from_to(998 - 1, 1); - } - } - - fn select_row(&self, row_id: usize) { - self.selected_row.set(Some(row_id)); - } - - fn remove_row(&self, row_id: usize) { - self.rows.lock_mut().retain(|row| { - row.id != row_id - }); - } - - fn render_jumbotron(state: Rc) -> Dom { - html!("div", { - .class("jumbotron") - .children(&mut [ - row(&mut [ - col_md_6(&mut [ - html!("h1", { - .text("Dominator keyed") - }), - ]), - - col_md_6(&mut [ - row(&mut [ - button("run", "Create 1,000 rows", clone!(state => move || { - state.create(1_000); - })), - - button("runlots", "Create 10,000 rows", clone!(state => move || { - state.create(10_000); - })), - - button("add", "Append 1,000 rows", clone!(state => move || { - state.append(1_000); - })), - - button("update", "Update every 10th row", clone!(state => move || { - state.update(); - })), - - button("clear", "Clear", clone!(state => move || { - state.clear(); - })), - - button("swaprows", "Swap Rows", move || { - state.swap(); - }), - ]), - ]), - ]), - ]) - }) - } - - fn render_table(state: Rc) -> Dom { - html!("table", { - .class(["table", "table-hover", "table-striped", "test-data"]) - .children(&mut [ - html!("tbody", { - .children_signal_vec(state.rows.signal_vec_cloned().map(move |row| { - Row::render(row, state.clone()) - })) - }) - ]) - }) - } - - fn render(state: Rc) -> Dom { - html!("div", { - .class("container") - .children(&mut [ - State::render_jumbotron(state.clone()), - - State::render_table(state), - - html!("span", { - .class(["preloadicon", "glyphicon", "glyphicon-remove"]) - .attribute("aria-hidden", "true") - }), - ]) - }) - } -} - - -#[wasm_bindgen(start)] -pub fn main_js() { - let state = State::new(); - - let element = window() - .unwrap_throw() - .document() - .unwrap_throw() - .get_element_by_id("main") - .unwrap_throw(); - - dominator::append_dom(&element, State::render(state)); -} diff --git a/frameworks/keyed/dominator/webpack.config.js b/frameworks/keyed/dominator/webpack.config.js deleted file mode 100644 index 071e0846a..000000000 --- a/frameworks/keyed/dominator/webpack.config.js +++ /dev/null @@ -1,23 +0,0 @@ -const path = require("path"); -const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin"); - -const dist = path.resolve(__dirname, "bundled-dist"); - -module.exports = { - mode: "production", - stats: "errors-warnings", - entry: { - index: "./js/index.js" - }, - output: { - path: dist, - publicPath: "bundled-dist/", - filename: "[name].js" - }, - plugins: [ - new WasmPackPlugin({ - crateDirectory: __dirname, - extraArgs: "--out-name index" - }) - ] -}; diff --git a/frameworks/keyed/domvm/build.js b/frameworks/keyed/domvm/build.js deleted file mode 100644 index 3ab821fac..000000000 --- a/frameworks/keyed/domvm/build.js +++ /dev/null @@ -1,80 +0,0 @@ -const rollup = require('rollup').rollup; -const buble = require('rollup-plugin-buble'); -const terser = require('terser'); -const fs = require('fs'); - -rollup({ - input: 'src/main.es6.js', - plugins: [ - buble() - ] -}).then(bundle => { - return bundle.write({ - file: 'dist/bundle.js', - format: 'iife' - }) -}).then(() => { - // from docs (https://github.com/mishoo/UglifyJS2) - const compressDefaults = { - arguments: true, - booleans: true, - collapse_vars: true, - comparisons: true, - conditionals: true, - dead_code: true, - directives: true, - drop_console: false, - drop_debugger: true, - evaluate: true, - expression: false, - global_defs: {}, - hoist_funs: false, - hoist_props: true, - hoist_vars: false, - if_return: true, - inline: 3, - join_vars: true, - keep_fargs: true, - keep_fnames: false, - keep_infinity: false, - loops: true, - negate_iife: true, - passes: 1, - properties: true, - pure_funcs: null, - pure_getters: "strict", - reduce_funcs: true, - reduce_vars: true, - sequences: true, - side_effects: true, - switches: true, - toplevel: false, - top_retain: null, - typeofs: true, - unsafe: false, - unsafe_comps: false, - unsafe_Function: false, - unsafe_math: false, - unsafe_proto: false, - unsafe_regexp: false, - unsafe_undefined: false, - unused: true, - }; - - const opts = { - compress: Object.assign({}, compressDefaults, { - booleans: false, - inline: 0, - keep_fargs: false, - hoist_props: false, - loops: false, - reduce_funcs: false, - unsafe: true, - unsafe_math: true, - }), - }; - - const compiled = terser.minify(fs.readFileSync('dist/bundle.js', 'utf8'), opts).code; - - fs.writeFileSync('dist/bundle.min.js', compiled, 'utf8'); -}).catch(err => console.log(err.stack)); \ No newline at end of file diff --git a/frameworks/keyed/domvm/index.html b/frameworks/keyed/domvm/index.html deleted file mode 100644 index c5bb8b257..000000000 --- a/frameworks/keyed/domvm/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - domvm (keyed) - - - - - - diff --git a/frameworks/keyed/domvm/package.json b/frameworks/keyed/domvm/package.json deleted file mode 100644 index fab081909..000000000 --- a/frameworks/keyed/domvm/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "js-framework-benchmark-domvm-keyed", - "version": "3.4.12-keyed", - "description": "Benchmark for domvm framework (keyed)", - "js-framework-benchmark": { - "frameworkVersion": "3.4.12" - }, - "scripts": { - "build-dev": "node build.js", - "build-prod": "node build.js" - }, - "devDependencies": { - "rollup": "1.16.3", - "rollup-plugin-buble": "0.19.6", - "terser": "4.0.1" - }, - "dependencies": { - "domvm": "git://github.com/domvm/domvm.git#3.4.12" - } -} diff --git a/frameworks/keyed/domvm/src/main.es6.js b/frameworks/keyed/domvm/src/main.es6.js deleted file mode 100644 index 4eb1c53c7..000000000 --- a/frameworks/keyed/domvm/src/main.es6.js +++ /dev/null @@ -1,101 +0,0 @@ -import { - createView, - defineElement, - FIXED_BODY, - list, -} from '../node_modules/domvm/dist/pico/domvm.pico.es.js'; - -import { Store } from './store.es6'; - -// el for static dom structures -const el = (tag, arg1, arg2) => defineElement(tag, arg1, arg2, FIXED_BODY); - -const store = new Store(); - -// for hygenic event handlers -store.exec = (name, id) => { - store[name](id); - vm.redraw(); -}; - -const vm = createView(AppView, store).mount(document.body); - -function AppView(vm, store) { - return _ => ( - el("div", {id: "main"}, [ - el("div", {class: "container"}, [ - JumbotronTpl(store), - TableTpl(store), - el("span", {class: "preloadicon glyphicon glyphicon-remove", "aria-hidden": "true"}) - ]) - ]) - ); -} - -function JumbotronTpl(store) { - return ( - el("div", {class: "jumbotron"}, [ - el("div", {class: "row"}, [ - el("div", {class: "col-md-6"}, [ - el("h1", "domvm (keyed)") - ]), - el("div", {class: "col-md-6"}, [ - el("div", {class: "row"}, [ - ButtonTpl(store, "run", "Create 1,000 rows"), - ButtonTpl(store, "runLots", "Create 10,000 rows"), - ButtonTpl(store, "add", "Append 1,000 rows"), - ButtonTpl(store, "update", "Update every 10th row"), - ButtonTpl(store, "clear", "Clear"), - ButtonTpl(store, "swapRows", "Swap Rows"), - ]) - ]) - ]) - ]) - ); -} - -function ButtonTpl(store, action, text) { - return ( - el("div", {class: "col-sm-6 smallpad"}, [ - el("button", { - class: "btn btn-primary btn-block", - id: action.toLowerCase(), - type: "button", - onclick: [store.exec, action], - }, text) - ]) - ); -} - -function TableTpl(store) { - const key = item => item.id; - const diff = { - val: (item) => item.label + (item.id === store.selected), - eq: (o, n) => o === n, - }; - - return ( - el("table", {class: "table table-hover table-striped test-data"}, [ - el("tbody", list(store.data, diff, key).map(item => - RowTpl(item, store, key(item)) - )) - ]) - ); -} - -function RowTpl(item, store, key) { - return ( - el("tr", {class: item.id === store.selected ? 'danger' : null}, [ - el("td", {class: "col-md-1"}, item.id), - el("td", {class: "col-md-4"}, [ - el("a", {onclick: [store.exec, "select", item.id]}, item.label) - ]), - el("td", {class: "col-md-1"}, [ - el("a", {onclick: [store.exec, "delete", item.id]}, [ - el("span", {class: "glyphicon glyphicon-remove", "aria-hidden": "true"}) - ]) - ]), - el("td", {class: "col-md-6"}) - ]).k(key) - ); -} \ No newline at end of file diff --git a/frameworks/keyed/domvm/src/store.es6.js b/frameworks/keyed/domvm/src/store.es6.js deleted file mode 100644 index 59d6f99be..000000000 --- a/frameworks/keyed/domvm/src/store.es6.js +++ /dev/null @@ -1,86 +0,0 @@ -function _random(max) { - return Math.round(Math.random()*1000)%max; -} - -export function Store() { - this.data = []; - this.backup = null; - this.selected = null; - this.id = 1; -} - -Store.prototype = { - constructor: Store, - - buildData: function(count) { - count = count || 1000; - - var adjectives = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy"]; - var colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"]; - var nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"]; - var data = []; - for (var i = 0; i < count; i++) - data.push({id: this.id++, label: adjectives[_random(adjectives.length)] + " " + colours[_random(colours.length)] + " " + nouns[_random(nouns.length)] }); - return data; - }, - - updateData: function(mod) { - mod = mod || 10; - - for (let i=0;i d.id==id); - this.data = this.data.filter((e,i) => i!=idx); - return this; - }, - - run: function() { - this.data = this.buildData(); - this.selected = null; - }, - - add: function() { - this.data = this.data.concat(this.buildData(1000)); - }, - - update: function() { - this.updateData(); - }, - - select: function(id) { - this.selected = id; - }, - - hideAll: function() { - this.backup = this.data; - this.data = []; - }, - - showAll: function() { - this.data = this.backup; - this.backup = null; - }, - - runLots: function() { - this.data = this.buildData(10000); - this.selected = null; - }, - - clear: function() { - this.data = []; - this.selected = null; - }, - - swapRows: function() { - if(this.data.length > 998) { - var a = this.data[1]; - this.data[1] = this.data[998]; - this.data[998] = a; - } - }, -}; \ No newline at end of file diff --git a/frameworks/keyed/doz/index.html b/frameworks/keyed/doz/index.html deleted file mode 100644 index 2ad96158b..000000000 --- a/frameworks/keyed/doz/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - -Doz - -
- diff --git a/frameworks/keyed/doz/package.json b/frameworks/keyed/doz/package.json deleted file mode 100644 index 9e9b1fbcb..000000000 --- a/frameworks/keyed/doz/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "js-framework-benchmark-doz", - "version": "1.0.0", - "description": "Doz demo", - "main": "index.js", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "doz" - }, - "scripts": { - "build-dev": "webpack --watch --mode=development", - "build-prod": "webpack --mode=production" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/krausest/js-framework-benchmark.git" - }, - "keywords": [ - "doz" - ], - "author": "Fabio Ricali", - "license": "MIT", - "bugs": { - "url": "https://github.com/krausest/js-framework-benchmark/issues" - }, - "homepage": "https://github.com/krausest/js-framework-benchmark#readme", - "dependencies": { - "doz": "2.4.7" - }, - "devDependencies": { - "webpack": "4.41.4", - "webpack-cli": "3.3.10" - } -} diff --git a/frameworks/keyed/doz/src/index.js b/frameworks/keyed/doz/src/index.js deleted file mode 100644 index 7aa054808..000000000 --- a/frameworks/keyed/doz/src/index.js +++ /dev/null @@ -1,142 +0,0 @@ -import Doz from 'doz' - -const adjectives = [ - 'pretty', 'large', 'big', 'small', 'tall', 'short', 'long', 'handsome', 'plain', 'quaint', 'clean', 'elegant', 'easy', 'angry', 'crazy', 'helpful', 'mushy', 'odd', 'unsightly', 'adorable', 'important', 'inexpensive', 'cheap', 'expensive', 'fancy']; -const colours = ['red', 'yellow', 'blue', 'green', 'pink', 'brown', 'purple', 'brown', 'white', 'black', 'orange']; -const nouns = ['table', 'chair', 'house', 'bbq', 'desk', 'car', 'pony', 'cookie', 'sandwich', 'burger', 'pizza', 'mouse', 'keyboard']; - -let did = 1; -let selected = -1; - -const actions = { - add() { - this.getStore('records').data = this.getStore('records').data.concat(buildData(1000)); - }, - - run() { - this.getStore('records').data = buildData(1000); - }, - - runLots() { - this.getStore('records').data = buildData(10000); - }, - - clear() { - this.getStore('records').data = []; - }, - - del(id) { - const data = this.getStore('records').data; - const idx = data.findIndex(d => d.id === id); - data.splice(idx, 1); - }, - - select(id) { - const data = this.getStore('records').data; - if (selected > -1) { - data[selected].selected = false; - } - selected = data.findIndex(d => d.id === id); - data[selected].selected = true; - }, - - swapRows() { - this.mainComponent.prepareCommit(); - const data = this.getStore('records').data; - if (data.length > 998) { - const tmp = data[1]; - data[1] = data[998]; - data[998] = tmp; - } - this.mainComponent.commit(); - }, - - update() { - this.mainComponent.prepareCommit(); - const data = this.getStore('records').data; - for (let i = 0; i < data.length; i += 10) { - data[i].label += ' !!!'; - } - this.mainComponent.commit(); - } -}; - -const buildData = count => { - const data = []; - for (let i = 0; i < count; i++) { - data.push({ - id: did++, - label: `${adjectives[_random(adjectives.length)]} ${colours[_random(colours.length)]} ${nouns[_random(nouns.length)]}`, - selected: false, - }); - } - return data; -}; - -const _random = max => { - return Math.round(Math.random() * 1000) % max; -}; - -new Doz({ - store: 'records', - actions, - root: '#container', - props: { - data: [] - }, - template(h) { - return h` -
-
-
-
-

Doz

-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
-
- - - ${this.props.data.map( - item => h` - - - - - - ` - )} - -
${item.id} - ${item.label} - - - - -
- -
-` - }, -}); \ No newline at end of file diff --git a/frameworks/keyed/dyo/.babelrc b/frameworks/keyed/dyo/.babelrc deleted file mode 100755 index 18c6bd6e7..000000000 --- a/frameworks/keyed/dyo/.babelrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - presets: [ "es2015", "react"], - "plugins": [ - ["transform-react-jsx", { - "pragma": "h" - }] - ] -} diff --git a/frameworks/keyed/dyo/index.html b/frameworks/keyed/dyo/index.html deleted file mode 100755 index 1053bca2c..000000000 --- a/frameworks/keyed/dyo/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Dyo - - - -
- - - diff --git a/frameworks/keyed/dyo/package.json b/frameworks/keyed/dyo/package.json deleted file mode 100644 index 3a0b4b4ed..000000000 --- a/frameworks/keyed/dyo/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "js-framework-benchmark-dyo", - "version": "1.0.0", - "description": "Dyo demo", - "main": "index.js", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "dyo" - }, - "scripts": { - "build-dev": "webpack -w -d", - "build-prod": "webpack -p" - }, - "keywords": [ - "dyo", - "webpack" - ], - "author": "Sultan Tarimo", - "license": "Apache-2.0", - "homepage": "https://github.com/krausest/js-framework-benchmark", - "repository": { - "type": "git", - "url": "https://github.com/krausest/js-framework-benchmark.git" - }, - "devDependencies": { - "babel-core": "6.26.3", - "babel-loader": "7.1.5", - "babel-preset-es2015": "6.24.1", - "babel-preset-react": "6.24.1", - "jsx-loader": "0.13.2", - "webpack": "4.16.3", - "webpack-cli": "^3.1.0" - }, - "dependencies": { - "dyo": "1.0.0" - } -} diff --git a/frameworks/keyed/dyo/src/main.js b/frameworks/keyed/dyo/src/main.js deleted file mode 100644 index 05c237ffd..000000000 --- a/frameworks/keyed/dyo/src/main.js +++ /dev/null @@ -1,129 +0,0 @@ -import {h, memo, render, useReducer} from 'dyo' - -const A = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", -"angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy"] -const C = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"] -const N = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"] - -const random = (max) => { - return Math.round(Math.random() * 1000) % max -} - -const create = (id, data, length) => { - for (var i = 0; i < length; i++) { - data.push({id: id++, label: `${A[random(A.length)]} ${C[random(C.length)]} ${N[random(N.length)]}`}) - } - return {id, data, selected: -1} -} - -const run = ({id}) => { - return create(id, [], 1000) -} - -const alot = ({id}) => { - return create(id, [], 10000) -} - -const add = ({id, data}) => { - return create(id, data, 1000) -} - -const update = ({id, data, selected}) => { - for (var i = 0; i < data.length; i += 10) { - data[i].label += ' !!!' - } - return {id, data, selected} -} - -const clear = (state) => { - return {id: state.id, data: [], selected: -1} -} - -const init = (state) => { - return {id: 1, data: [], selected: -1} -} - -const swap = ({id, data, selected}) => { - if (data.length > 998) { - const temp = data[1] - data[1] = data[998] - data[998] = temp - } - return {id, data, selected} -} - -const remove = ({id, data, selected}, payload) => { - return {id: id, data: data.filter(({id}) => id !== payload), selected} -} - -const select = ({id, data, selected}, payload) => { - return {id, data, selected: payload} -} - -const reducer = (state, {type, payload}) => { - switch (type) { - case 'run': return run(state) - case 'alot': return alot(state) - case 'add': return add(state) - case 'update': return update(state) - case 'clear': return clear(state) - case 'swap': return swap(state) - case 'remove': return remove(state, payload) - case 'select': return select(state, payload) - } -} - -const Jumbo = memo(({dispatch}) => ( - h('div', {className: 'jumbotron'}, - h('div', {className: 'row'}, - h('div', {className: 'col-md-6'}, h('h1', {}, 'Dyo')), - h('div', {className: 'col-md-6'}, - h('div', {className: 'row'}, - h('div', {className: 'col-sm-6 smallpad'}, - h('button', {className: 'btn btn-primary btn-block', type: 'button', id: 'run', onClick: e => dispatch({type: 'run'})}, 'Create 1,000 rows') - ), - h('div', {className: 'col-sm-6 smallpad'}, - h('button', {className: 'btn btn-primary btn-block', type: 'button', id: 'runlots', onClick: e => dispatch({type: 'alot'})}, 'Create 10,000 rows') - ), - h('div', {className: 'col-sm-6 smallpad'}, - h('button', {className: 'btn btn-primary btn-block', type: 'button', id: 'add', onClick: e => dispatch({type: 'add'})}, 'Append 1,000 rows') - ), - h('div', {className: 'col-sm-6 smallpad'}, - h('button', {className: 'btn btn-primary btn-block', type: 'button', id: 'update', onClick: e => dispatch({type: 'update'})}, 'Update every 10th row') - ), - h('div', {className: 'col-sm-6 smallpad'}, - h('button', {className: 'btn btn-primary btn-block', type: 'button', id: 'clear', onClick: e => dispatch({type: 'clear'})}, 'Clear') - ), - h('div', {className: 'col-sm-6 smallpad'}, - h('button', {className: 'btn btn-primary btn-block', type: 'button', id: 'swaprows', onClick: e => dispatch({type: 'swap'})}, 'Swap Rows') - ) - ) - ) - ) - ) -), (prev, next) => true) - -const Row = memo(({dispatch, id, label, selected}) => ( - h('tr', {className: selected ? 'danger' : ''}, - h('td', {className: 'col-md-1'}, id), - h('td', {className: 'col-md-4'}, h('a', {onClick: e => dispatch({type: 'select', payload: id})}, label)), - h('td', {className: 'col-md-1'}, h('a', {onClick: e => dispatch({type: 'remove', payload: id})}, - h('span', {className: 'glyphicon glyphicon-remove', 'aria-hidden': 'true'})) - ), - h('td', {className: 'col-md-6'}) - ) -), (prev, next) => prev.label === next.label && prev.selected === next.selected) - -const Main = (props) => { - const [{data, selected}, dispatch] = useReducer(reducer, init) - - return h('div', {className: 'container'}, - h(Jumbo, {dispatch}), - h('table', {className: 'table table-hover table-striped test-data'}, - h('tbody', {}, data.map(({id, label}) => h(Row, {dispatch, id, label, key: id, selected: id === selected}))) - ), - h('span', {className: 'preloadicon glyphicon glyphicon-remove', 'aria-hidden': 'true'}) - ) -} - -render(h(Main), '#main') diff --git a/frameworks/keyed/dyo/webpack.config.js b/frameworks/keyed/dyo/webpack.config.js deleted file mode 100755 index 90efec001..000000000 --- a/frameworks/keyed/dyo/webpack.config.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; -require("babel-plugin-syntax-jsx") -var path = require('path') -var webpack = require('webpack') -var cache = {}; -var loaders = [ - { - test: /\.jsx$/, - loader: 'babel-loader' - }, - { - test: /\.es6\.js$/, - loader: 'babel-loader' - }, - { - test: /\.css$/, - loader: 'style-loader!css-loader' - } -]; -var extensions = [ - '.js', '.jsx', '.es6.js' -]; - -module.exports = [{ - cache: cache, - module: { - rules: loaders - }, - entry: { - main: './src/main.js', - }, - output: { - path: path.resolve(__dirname, "dist"), - filename: '[name].js' - }, - resolve: { - extensions: extensions, - modules: [ - __dirname, - path.resolve(__dirname, "src"), - "node_modules" - ] - }, - plugins: [ - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': '"production"' - }) - ] -}]; diff --git a/frameworks/keyed/elm/.gitignore b/frameworks/keyed/elm/.gitignore deleted file mode 100644 index ed8225884..000000000 --- a/frameworks/keyed/elm/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# elm-package generated files -elm-stuff/ - -# elm-repl generated files -repl-temp-* - diff --git a/frameworks/keyed/elm/elm.json b/frameworks/keyed/elm/elm.json deleted file mode 100644 index 59ca55525..000000000 --- a/frameworks/keyed/elm/elm.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "type": "application", - "source-directories": [ - "src" - ], - "elm-version": "0.19.0", - "dependencies": { - "direct": { - "elm/browser": "1.0.0", - "elm/core": "1.0.0", - "elm/html": "1.0.0", - "elm/json": "1.0.0", - "elm/random": "1.0.0", - "elm/url": "1.0.0" - }, - "indirect": { - "elm/time": "1.0.0", - "elm/virtual-dom": "1.0.0" - } - }, - "test-dependencies": { - "direct": {}, - "indirect": {} - } -} \ No newline at end of file diff --git a/frameworks/keyed/elm/index.html b/frameworks/keyed/elm/index.html deleted file mode 100644 index e0d2fc195..000000000 --- a/frameworks/keyed/elm/index.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Elm v0.19.0 - - - -
- - - - diff --git a/frameworks/keyed/elm/package.json b/frameworks/keyed/elm/package.json deleted file mode 100644 index 13e482527..000000000 --- a/frameworks/keyed/elm/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "js-framework-benchmark-elm", - "version": "1.0.0", - "description": "Elm demo", - "main": "index.js", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "elm" - }, - "scripts": { - "build-prod": "elm make src/Main.elm --optimize --output=dist/main.js && uglifyjs dist/main.js --compress 'pure_funcs=\"F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9\",pure_getters=true,keep_fargs=false,unsafe_comps=true,unsafe=true,passes=2' --output=dist/main.js && uglifyjs dist/main.js --mangle --output=dist/main.js" - }, - "keywords": [ - "elm" - ], - "author": "Eduard Kyvenko ", - "license": "ISC", - "homepage": "https://github.com/krausest/js-framework-benchmark", - "repository": { - "type": "git", - "url": "https://github.com/krausest/js-framework-benchmark.git" - }, - "devDependencies": { - "elm": "0.19.0-bugfix2", - "uglify-js": "3.4.8" - } -} diff --git a/frameworks/keyed/elm/src/Main.elm b/frameworks/keyed/elm/src/Main.elm deleted file mode 100644 index 7d15adb1b..000000000 --- a/frameworks/keyed/elm/src/Main.elm +++ /dev/null @@ -1,366 +0,0 @@ -module Main exposing (main) - -import Array exposing (Array) -import Browser -import Html exposing (Attribute, Html, a, button, div, h1, span, table, td, text, tr) -import Html.Attributes exposing (attribute, class, classList, href, id, type_) -import Html.Events exposing (onClick) -import Html.Keyed -import Html.Lazy exposing (lazy, lazy2) -import Random exposing (Generator, Seed) -import String - - -main : Program Int Model Msg -main = - Browser.element - { view = view - , update = update - , init = init - , subscriptions = subscriptions - } - - -adjectives : Generator String -adjectives = - Random.uniform - "pretty" - [ "large" - , "big" - , "small" - , "tall" - , "short" - , "long" - , "handsome" - , "plain" - , "quaint" - , "clean" - , "elegant" - , "easy" - , "angry" - , "crazy" - , "helpful" - , "mushy" - , "odd" - , "unsightly" - , "adorable" - , "important" - , "inexpensive" - , "cheap" - , "expensive" - , "fancy" - ] - - -colours : Generator String -colours = - Random.uniform - "red" - [ "yellow" - , "blue" - , "green" - , "pink" - , "brown" - , "purple" - , "brown" - , "white" - , "black" - , "orange" - ] - - -nouns : Generator String -nouns = - Random.uniform - "table" - [ "chair" - , "house" - , "bbq" - , "desk" - , "car" - , "pony" - , "cookie" - , "sandwich" - , "burger" - , "pizza" - , "mouse" - , "keyboard" - ] - - -buttons : List ( String, String, Msg ) -buttons = - [ ( "run", "Create 1,000 rows", Create 1000 ) - , ( "runlots", "Create 10,000 rows", Create 10000 ) - , ( "add", "Append 1,000 rows", AppendOneThousand ) - , ( "update", "Update every 10th row", UpdateEveryTenth ) - , ( "clear", "Clear", Clear ) - , ( "swaprows", "Swap Rows", Swap ) - ] - - -tbody : List (Attribute msg) -> List ( String, Html msg ) -> Html msg -tbody attrs children = - Html.Keyed.node "tbody" attrs children - - -btnPrimaryBlock : ( String, String, Msg ) -> Html Msg -btnPrimaryBlock ( buttonId, labelText, msg ) = - div - [ class "col-sm-6 smallpad" ] - [ button - [ type_ "button" - , class "btn btn-primary btn-block" - , id buttonId - , onClick msg - , attribute "ref" "text" - ] - [ text labelText ] - ] - - -viewKeyedRow : Int -> Row -> ( String, Html Msg ) -viewKeyedRow selectedId row = - ( String.fromInt row.id, lazy2 viewRow (selectedId == row.id) row ) - - -viewRow : Bool -> Row -> Html Msg -viewRow isSelected { id, label } = - tr - [ classList [ ( "danger", isSelected ) ] ] - [ td colMd1 - [ text (String.fromInt id) ] - , td colMd4 - [ a [ onClick (Select id) ] [ text label ] ] - , td colMd1 - [ a [ onClick (Remove id) ] removeIcon ] - , spacer - ] - - -removeIcon : List (Html msg) -removeIcon = - [ span - [ class "glyphicon glyphicon-remove" - , attribute "aria-hidden" "true" - ] - [] - ] - - -colMd1 : List (Attribute msg) -colMd1 = - [ class "col-md-1" ] - - -colMd4 : List (Attribute msg) -colMd4 = - [ class "col-md-4" ] - - -spacer : Html msg -spacer = - td [ class "col-md-6" ] [] - - -view : Model -> Html Msg -view model = - div containerClasses - [ jumbotron - , table tableClasses - [ tbody [] - (Array.foldr (viewRowHelp model.selectedId) [] model.rows) - ] - , footer - ] - - -containerClasses : List (Attribute msg) -containerClasses = - [ class "container" ] - - -tableClasses : List (Attribute msg) -tableClasses = - [ class "table table-hover table-striped test-data" ] - - -footer : Html msg -footer = - span - [ class "preloadicon glyphicon glyphicon-remove" - , attribute "aria-hidden" "true" - ] - [] - - -jumbotron : Html Msg -jumbotron = - div - [ class "jumbotron" ] - [ div - [ class "row" ] - [ div - [ class "col-md-6" ] - [ h1 [] [ text "Elm 0.19.0 (keyed)" ] ] - , div - [ class "col-md-6" ] - (List.map btnPrimaryBlock buttons) - ] - ] - - -viewRowHelp : Int -> Row -> List ( String, Html Msg ) -> List ( String, Html Msg ) -viewRowHelp selectedId row elems = - viewKeyedRow selectedId row :: elems - - -appendRandomEntries : Int -> Int -> ( Array Row, Seed ) -> ( Array Row, Seed ) -appendRandomEntries amount lastId pair = - if amount == 0 then - pair - - else - let - ( array, seed ) = - pair - - ( label, newSeed ) = - Random.step generator seed - - id = - lastId + 1 - - newArray = - Array.push - { id = id - , label = label - } - array - in - appendRandomEntries (amount - 1) id ( newArray, newSeed ) - - -type Msg - = Create Int - | AppendOneThousand - | UpdateEveryTenth - | Clear - | Swap - | Remove Int - | Select Int - - -update : Msg -> Model -> ( Model, Cmd Msg ) -update msg model = - case msg of - Create amount -> - let - ( newRows, seed ) = - appendRandomEntries amount model.lastId ( Array.empty, model.seed ) - in - ( { model - | rows = newRows - , seed = seed - , lastId = model.lastId + amount - } - , Cmd.none - ) - - AppendOneThousand -> - let - amount = - 1000 - - ( newRows, seed ) = - appendRandomEntries amount model.lastId ( model.rows, model.seed ) - in - ( { model - | rows = newRows - , seed = seed - , lastId = model.lastId + amount - } - , Cmd.none - ) - - UpdateEveryTenth -> - ( { model | rows = updateEveryTenth 0 model.rows }, Cmd.none ) - - Clear -> - ( { model | rows = Array.empty }, Cmd.none ) - - Swap -> - let - rows = - model.rows - in - if Array.length rows > 998 then - case ( Array.get 1 rows, Array.get 998 rows ) of - ( Just from, Just to ) -> - ( { model - | rows = - rows - |> Array.set 1 to - |> Array.set 998 from - } - , Cmd.none - ) - - ( _, _ ) -> - ( model, Cmd.none ) - - else - ( model, Cmd.none ) - - Remove id -> - ( { model | rows = Array.filter (\r -> r.id /= id) model.rows }, Cmd.none ) - - Select id -> - ( { model | selectedId = id }, Cmd.none ) - - -updateEveryTenth : Int -> Array Row -> Array Row -updateEveryTenth index rows = - case Array.get index rows of - Just row -> - rows - |> Array.set index { row | label = row.label ++ " !!!" } - |> updateEveryTenth (index + 10) - - Nothing -> - rows - - -type alias Model = - { seed : Seed - , rows : Array Row - , lastId : Int - , selectedId : Int - } - - -type alias Row = - { id : Int - , label : String - } - - -init : Int -> ( Model, Cmd Msg ) -init systemTime = - ( { seed = Random.initialSeed systemTime - , rows = Array.empty - , lastId = 0 - , selectedId = 0 - } - , Cmd.none - ) - - -generator : Generator String -generator = - Random.map3 (\a c n -> a ++ " " ++ c ++ " " ++ n) adjectives colours nouns - - -subscriptions : Model -> Sub Msg -subscriptions model = - Sub.none diff --git a/frameworks/keyed/ember/.bowerrc b/frameworks/keyed/ember/.bowerrc deleted file mode 100644 index 959e1696e..000000000 --- a/frameworks/keyed/ember/.bowerrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "directory": "bower_components", - "analytics": false -} diff --git a/frameworks/keyed/ember/.editorconfig b/frameworks/keyed/ember/.editorconfig deleted file mode 100644 index 219985c22..000000000 --- a/frameworks/keyed/ember/.editorconfig +++ /dev/null @@ -1,20 +0,0 @@ -# EditorConfig helps developers define and maintain consistent -# coding styles between different editors and IDEs -# editorconfig.org - -root = true - - -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -indent_style = space -indent_size = 2 - -[*.hbs] -insert_final_newline = false - -[*.{diff,md}] -trim_trailing_whitespace = false diff --git a/frameworks/keyed/ember/.ember-cli b/frameworks/keyed/ember/.ember-cli deleted file mode 100644 index ee64cfed2..000000000 --- a/frameworks/keyed/ember/.ember-cli +++ /dev/null @@ -1,9 +0,0 @@ -{ - /** - Ember CLI sends analytics information by default. The data is completely - anonymous, but there are times when you might want to disable this behavior. - - Setting `disableAnalytics` to true will prevent any data from being sent. - */ - "disableAnalytics": false -} diff --git a/frameworks/keyed/ember/.eslintignore b/frameworks/keyed/ember/.eslintignore deleted file mode 100644 index 72df37307..000000000 --- a/frameworks/keyed/ember/.eslintignore +++ /dev/null @@ -1,20 +0,0 @@ -# unconventional js -/blueprints/*/files/ -/vendor/ - -# compiled output -/dist/ -/tmp/ - -# dependencies -/bower_components/ -/node_modules/ - -# misc -/coverage/ -!.* - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/package.json.ember-try diff --git a/frameworks/keyed/ember/.eslintrc.js b/frameworks/keyed/ember/.eslintrc.js deleted file mode 100644 index fa6ccaefa..000000000 --- a/frameworks/keyed/ember/.eslintrc.js +++ /dev/null @@ -1,46 +0,0 @@ -module.exports = { - root: true, - parser: 'babel-eslint', - parserOptions: { - ecmaVersion: 2018, - sourceType: 'module', - ecmaFeatures: { - legacyDecorators: true - } - }, - plugins: [ - 'ember' - ], - extends: [ - 'eslint:recommended', - 'plugin:ember/recommended' - ], - env: { - browser: true - }, - rules: { - 'ember/no-jquery': 'error' - }, - overrides: [ - // node files - { - files: [ - '.eslintrc.js', - '.template-lintrc.js', - 'ember-cli-build.js', - 'testem.js', - 'blueprints/*/index.js', - 'config/**/*.js', - 'lib/*/index.js', - 'server/**/*.js' - ], - parserOptions: { - sourceType: 'script' - }, - env: { - browser: false, - node: true - } - } - ] -}; diff --git a/frameworks/keyed/ember/.gitignore b/frameworks/keyed/ember/.gitignore deleted file mode 100644 index c40a1b2ab..000000000 --- a/frameworks/keyed/ember/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. - -# compiled output -/dist/ -/tmp/ - -# dependencies -/bower_components/ -/node_modules/ - -# misc -/.env* -/.pnp* -/.sass-cache -/connect.lock -/coverage/ -/libpeerconnection.log -/npm-debug.log* -/testem.log -/yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/package.json.ember-try diff --git a/frameworks/keyed/ember/.template-lintrc.js b/frameworks/keyed/ember/.template-lintrc.js deleted file mode 100644 index f38737001..000000000 --- a/frameworks/keyed/ember/.template-lintrc.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = { - extends: 'octane' -}; diff --git a/frameworks/keyed/ember/.travis.yml b/frameworks/keyed/ember/.travis.yml deleted file mode 100644 index 7e5bbf6ec..000000000 --- a/frameworks/keyed/ember/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -language: node_js -node_js: - - "6" - -sudo: false -dist: trusty - -addons: - chrome: stable - -cache: - yarn: true - -env: - global: - # See https://git.io/vdao3 for details. - - JOBS=1 - -before_install: - - curl -o- -L https://yarnpkg.com/install.sh | bash - - export PATH=$HOME/.yarn/bin:$PATH - -install: - - yarn install --non-interactive -branches: - only: - - master - -script: - - npm run lint:hbs - - npm run lint:js - - npm test diff --git a/frameworks/keyed/ember/.watchmanconfig b/frameworks/keyed/ember/.watchmanconfig deleted file mode 100644 index e7834e3e4..000000000 --- a/frameworks/keyed/ember/.watchmanconfig +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ignore_dirs": ["tmp", "dist"] -} diff --git a/frameworks/keyed/ember/HOW_TO_UPDATE.txt b/frameworks/keyed/ember/HOW_TO_UPDATE.txt deleted file mode 100644 index c650acdc8..000000000 --- a/frameworks/keyed/ember/HOW_TO_UPDATE.txt +++ /dev/null @@ -1,2 +0,0 @@ -Check https://github.com/ember-cli/ember-cli/releases and see the release notes. -Just using ncu will not be sufficient. diff --git a/frameworks/keyed/ember/README.md b/frameworks/keyed/ember/README.md deleted file mode 100644 index e741b07cb..000000000 --- a/frameworks/keyed/ember/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# ember-temp - -This README outlines the details of collaborating on this Ember application. -A short introduction of this app could easily go here. - -## Prerequisites - -You will need the following things properly installed on your computer. - -* [Git](https://git-scm.com/) -* [Node.js](https://nodejs.org/) -* [Yarn](https://yarnpkg.com/) -* [Ember CLI](https://ember-cli.com/) -* [Google Chrome](https://google.com/chrome/) - -## Installation - -* `git clone ` this repository -* `cd ember-temp` -* `yarn install` - -## Running / Development - -* `ember serve` -* Visit your app at [http://localhost:4200](http://localhost:4200). -* Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests). - -### Code Generators - -Make use of the many generators for code, try `ember help generate` for more details - -### Running Tests - -* `ember test` -* `ember test --server` - -### Linting - -* `yarn lint:hbs` -* `yarn lint:js` -* `yarn lint:js --fix` - -### Building - -* `ember build` (development) -* `ember build --environment production` (production) - -### Deploying - -Specify what it takes to deploy your app. - -## Further Reading / Useful Links - -* [ember.js](https://emberjs.com/) -* [ember-cli](https://ember-cli.com/) -* Development Browser Extensions - * [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi) - * [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/) diff --git a/frameworks/keyed/ember/app/app.js b/frameworks/keyed/ember/app/app.js deleted file mode 100644 index d8e2088b6..000000000 --- a/frameworks/keyed/ember/app/app.js +++ /dev/null @@ -1,12 +0,0 @@ -import Application from '@ember/application'; -import Resolver from 'ember-resolver'; -import loadInitializers from 'ember-load-initializers'; -import config from './config/environment'; - -export default class App extends Application { - modulePrefix = config.modulePrefix; - podModulePrefix = config.podModulePrefix; - Resolver = Resolver; -} - -loadInitializers(App, config.modulePrefix); diff --git a/frameworks/keyed/ember/app/components/my-table.js b/frameworks/keyed/ember/app/components/my-table.js deleted file mode 100755 index 412a38341..000000000 --- a/frameworks/keyed/ember/app/components/my-table.js +++ /dev/null @@ -1,67 +0,0 @@ -import Component from '@glimmer/component'; -import { action } from '@ember/object'; -import { tracked } from '@glimmer/tracking'; - -import { - run, runLots, add, update, swapRows, deleteRow, -} from 'ember-temp/utils/benchmark-helpers'; - -export default class MyTable extends Component { - @tracked - id = 1; - @tracked - data = []; - @tracked - selected = undefined; - - @action create() { - const result = run(this.id); - - this.id = result.id; - this.data = result.data; - this.selected = undefined; - } - - @action add() { - this.data = add(this.id, this.data) - } - - @action update() { - update(this.data); - } - - @action runLots() { - const result = runLots(this.id); - - this.data = result.data; - this.id = result.id; - this.selected = undefined; - } - - @action clear() { - this.data = []; - this.selected = undefined; - } - - @action swapRows() { - this.data = swapRows(this.data); - } - - @action remove(id) { - const selected = this.data.find(({selected}) => selected === true); - if (selected) { - selected.selected = false; - } - this.data = deleteRow(this.data, id); - this.selected = undefined; - } - - @action select(id) { - this.selected = id; - const selected = this.data.find(({selected}) => selected === true); - if (selected) { - selected.selected = false; - } - this.data.find((item)=>item.id === id).selected = true; - } -} diff --git a/frameworks/keyed/ember/app/components/table-row/template.hbs b/frameworks/keyed/ember/app/components/table-row/template.hbs deleted file mode 100644 index 4c9f8d562..000000000 --- a/frameworks/keyed/ember/app/components/table-row/template.hbs +++ /dev/null @@ -1,7 +0,0 @@ -{{!-- template-lint-disable --}} - - {{@item.id}} - {{@item.label}} - - - \ No newline at end of file diff --git a/frameworks/keyed/ember/app/controllers/.gitkeep b/frameworks/keyed/ember/app/controllers/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/frameworks/keyed/ember/app/helpers/.gitkeep b/frameworks/keyed/ember/app/helpers/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/frameworks/keyed/ember/app/helpers/eq.js b/frameworks/keyed/ember/app/helpers/eq.js deleted file mode 100755 index 7ef3b140c..000000000 --- a/frameworks/keyed/ember/app/helpers/eq.js +++ /dev/null @@ -1,5 +0,0 @@ -import { helper } from '@ember/component/helper'; - -export default helper(function(params) { - return params[0] === params[1]; -}); diff --git a/frameworks/keyed/ember/app/index.html b/frameworks/keyed/ember/app/index.html deleted file mode 100644 index 01afb6cee..000000000 --- a/frameworks/keyed/ember/app/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - Ember v3.17 - - - {{content-for "head"}} - - - - - - {{content-for "head-footer"}} - - - {{content-for "body"}} - - - - - {{content-for "body-footer"}} - - diff --git a/frameworks/keyed/ember/app/router.js b/frameworks/keyed/ember/app/router.js deleted file mode 100644 index 43885df3f..000000000 --- a/frameworks/keyed/ember/app/router.js +++ /dev/null @@ -1,12 +0,0 @@ -import EmberRouter from '@ember/routing/router'; -import config from './config/environment'; - -export default class Router extends EmberRouter { - location = config.locationType; - rootURL = config.rootURL; -} - -Router.map(function() { - this.route('index', { path: '/' }); - this.route('index', { path: '/index.html' }); -}); diff --git a/frameworks/keyed/ember/app/routes/.gitkeep b/frameworks/keyed/ember/app/routes/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/frameworks/keyed/ember/app/styles/app.css b/frameworks/keyed/ember/app/styles/app.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/frameworks/keyed/ember/app/templates/components/bs-button.hbs b/frameworks/keyed/ember/app/templates/components/bs-button.hbs deleted file mode 100644 index 068fffdaf..000000000 --- a/frameworks/keyed/ember/app/templates/components/bs-button.hbs +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/frameworks/keyed/ember/app/templates/components/my-table.hbs b/frameworks/keyed/ember/app/templates/components/my-table.hbs deleted file mode 100755 index 0b3903b16..000000000 --- a/frameworks/keyed/ember/app/templates/components/my-table.hbs +++ /dev/null @@ -1,55 +0,0 @@ -
-
-
-

Ember v3.17

-
-
-
-
- - Create 1,000 rows - -
-
- - Create 10,000 rows - -
-
- - Append 1,000 rows - -
-
- - Update every 10th row - -
-
- - Clear - -
-
- - Swap Rows - -
-
-
-
-
- - -{{#if this.data.length}} - - - {{#each this.data key="id" as |item|}} - - {{/each}} - -
-{{/if}} - - - \ No newline at end of file diff --git a/frameworks/keyed/ember/app/templates/index.hbs b/frameworks/keyed/ember/app/templates/index.hbs deleted file mode 100755 index abff955b0..000000000 --- a/frameworks/keyed/ember/app/templates/index.hbs +++ /dev/null @@ -1,3 +0,0 @@ -
- -
diff --git a/frameworks/keyed/ember/app/utils/benchmark-helpers.js b/frameworks/keyed/ember/app/utils/benchmark-helpers.js deleted file mode 100644 index 34b48bac1..000000000 --- a/frameworks/keyed/ember/app/utils/benchmark-helpers.js +++ /dev/null @@ -1,89 +0,0 @@ -import { tracked } from '@glimmer/tracking'; - -class TodoItem { - @tracked label; - @tracked selected; - @tracked id - constructor({label,selected, id}) { - this.label = label; - this.selected = selected; - this.id = id; - } -} - -const _random = (max) => { - return Math.round(Math.random() * 1000) % max; -} - -const updateData = (data, mod = 10) => { - for (let i = 0; i < data.length; i += mod) { - data[i].label = data[i].label + ' !!!' ; - } - return data; -} - -export const buildData = (id, count = 1000) => { - var adjectives = [ - "pretty", "large", "big", "small", "tall", - "short", "long", "handsome", "plain", "quaint", - "clean", "elegant", "easy", "angry", "crazy", - "helpful", "mushy", "odd", "unsightly", "adorable", - "important", "inexpensive", "cheap", "expensive", "fancy"]; - - var colours = [ - "red", "yellow", "blue", "green", "pink", "brown", "purple", - "brown", "white", "black", "orange"]; - - var nouns = [ - "table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", - "sandwich", "burger", "pizza", "mouse", "keyboard"]; - - var data = []; - - for (var i = 0; i < count; i++) - data.push(new TodoItem({ - id: id++, - selected: false, - label: adjectives[_random(adjectives.length)] - + " " - + colours[_random(colours.length)] - + " " - + nouns[_random(nouns.length)] - })); - - return {data, id}; -} - -export const add = (id, data) => { - const newData = buildData(id, 1000); - return [ ...data, ...newData.data]; -} - -export const run = (id) => { - return buildData(id); -} - -export const runLots = (id) => { - return buildData(id, 10000); -} - -export const update = (data) => { - return updateData(data); -} - -export const swapRows = (data) => { - const newData = [...data]; - if (newData.length > 998) { - let temp = newData[1]; - newData[1] = newData[998]; - newData[998] = temp; - } - return newData; -} - -export const deleteRow = (data, id) => { - return data.filter(d => { - return d.id !== id - }); -} - diff --git a/frameworks/keyed/ember/config/environment.js b/frameworks/keyed/ember/config/environment.js deleted file mode 100644 index 691e0cac2..000000000 --- a/frameworks/keyed/ember/config/environment.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict'; - -module.exports = function(environment) { - let ENV = { - - 'ember-resolver': { - features: { - // EMBER_RESOLVER_MODULE_UNIFICATION: true, - // EMBER_GLIMMER_ANGLE_BRACKET_INVOCATION: true, - }, - }, - modulePrefix: 'ember-temp', - environment, - rootURL: '/frameworks/keyed/ember/dist/', - locationType: 'auto', - EmberENV: { - FEATURES: { - // Here you can enable experimental features on an ember canary build - // e.g. 'with-controller': true - // 'ember-glimmer-angle-bracket-invocation': true, - // EMBER_GLIMMER_ANGLE_BRACKET_INVOCATION: true, - // e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true - }, - EXTEND_PROTOTYPES: { - // Prevent Ember Data from overriding Date.parse. - Date: false - } - }, - - APP: { - // Here you can pass flags/options to your application instance - // when it is created - } - }; - - if (environment === 'development') { - // ENV.APP.LOG_RESOLVER = true; - // ENV.APP.LOG_ACTIVE_GENERATION = true; - // ENV.APP.LOG_TRANSITIONS = true; - // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; - // ENV.APP.LOG_VIEW_LOOKUPS = true; - } - - if (environment === 'test') { - ENV.rootURL = '/'; - - // Testem prefers this... - ENV.locationType = 'none'; - - // keep test console output quieter - ENV.APP.LOG_ACTIVE_GENERATION = false; - ENV.APP.LOG_VIEW_LOOKUPS = false; - - ENV.APP.rootElement = '#ember-testing'; - ENV.APP.autoboot = false; - } - - if (environment === 'production') { - // here you can enable a production-specific feature - } - - return ENV; -}; diff --git a/frameworks/keyed/ember/config/optional-features.json b/frameworks/keyed/ember/config/optional-features.json deleted file mode 100644 index b26286e2e..000000000 --- a/frameworks/keyed/ember/config/optional-features.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "application-template-wrapper": false, - "default-async-observers": true, - "jquery-integration": false, - "template-only-glimmer-components": true -} diff --git a/frameworks/keyed/ember/config/targets.js b/frameworks/keyed/ember/config/targets.js deleted file mode 100644 index ddd4c5964..000000000 --- a/frameworks/keyed/ember/config/targets.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -const browsers = [ - 'last 1 Chrome versions', - 'last 1 Firefox versions', - 'last 1 Safari versions' -]; - -module.exports = { - browsers -}; diff --git a/frameworks/keyed/ember/ember-cli-build.js b/frameworks/keyed/ember/ember-cli-build.js deleted file mode 100644 index 9eace015d..000000000 --- a/frameworks/keyed/ember/ember-cli-build.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -const EmberApp = require('ember-cli/lib/broccoli/ember-app'); -const { Webpack } = require('@embroider/webpack'); -module.exports = function(defaults) { - let app = new EmberApp(defaults, { - hinting: false - // Add options here - }); - - // Use `app.import` to add additional libraries to the generated - // output files. - // - // If you need to use different assets in different - // environments, specify an object as the first parameter. That - // object's keys should be the environment name and the values - // should be the asset to use in that environment. - // - // If the library that you are including contains AMD or ES6 - // modules that you would like to import into your application - // please specify an object with the list of modules as keys - // along with the exports of each module as its value. - - return require('@embroider/compat').compatBuild(app, Webpack, { - staticAddonTestSupportTrees: true, - staticAddonTrees: true, - staticHelpers: true, - staticComponents: true, - packagerOptions: { - webpackConfig: { - mode: 'production' - } - } - }); -}; diff --git a/frameworks/keyed/ember/package.json b/frameworks/keyed/ember/package.json deleted file mode 100644 index d1212033d..000000000 --- a/frameworks/keyed/ember/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "ember-temp", - "version": "0.0.0", - "private": true, - "description": "Small description for ember-temp goes here", - "repository": "", - "license": "MIT", - "author": "", - "directories": { - "doc": "doc", - "test": "tests" - }, - "js-framework-benchmark": { - "frameworkVersionFromPackage": "ember-source", - "customURL": "/dist" - }, - "scripts": { - "ember": "node_modules/.bin/ember", - "ember-cli-update": "node_modules/.bin/ember-cli-update", - "build": "ember build", - "build-dev": "ember build --environment=production", - "build-prod": "ember build --environment=production", - "lint:hbs": "ember-template-lint .", - "lint:js": "eslint .", - "start": "ember serve", - "test": "ember test" - }, - "devDependencies": { - "@ember/optional-features": "^1.1.0", - "@embroider/compat": "^0.11.0", - "@embroider/core": "^0.11.0", - "@embroider/webpack": "^0.11.0", - "@glimmer/component": "^1.0.0", - "babel-eslint": "^10.0.3", - "broccoli-asset-rev": "3.0.0", - "ember-auto-import": "^1.5.3", - "ember-cli": "~3.15.2", - "ember-cli-babel": "^7.13.0", - "ember-cli-dependency-checker": "3.2.0", - "ember-cli-eslint": "5.1.0", - "ember-cli-htmlbars": "^4.2.0", - "ember-cli-inject-live-reload": "2.0.1", - "ember-cli-sri": "2.1.1", - "ember-cli-template-lint": "^1.0.0-beta.3", - "ember-cli-template-trimmer": "0.0.6", - "ember-cli-uglify": "3.0.0", - "ember-cli-update": "0.34.10", - "ember-hbs-minifier": "0.4.0", - "ember-load-initializers": "^2.1.1", - "ember-qunit": "^4.6.0", - "ember-resolver": "^7.0.0", - "ember-source": "3.17.0-beta.1", - "eslint-plugin-ember": "^7.7.1", - "loader.js": "4.7.0", - "qunit-dom": "^0.9.2" - }, - "engines": { - "node": "6.* || 8.* || >= 10.*" - }, - "ember": { - "edition": "octane" - } -} diff --git a/frameworks/keyed/ember/public/crossdomain.xml b/frameworks/keyed/ember/public/crossdomain.xml deleted file mode 100644 index 0c16a7a07..000000000 --- a/frameworks/keyed/ember/public/crossdomain.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - diff --git a/frameworks/keyed/ember/public/robots.txt b/frameworks/keyed/ember/public/robots.txt deleted file mode 100644 index f5916452e..000000000 --- a/frameworks/keyed/ember/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# http://www.robotstxt.org -User-agent: * -Disallow: diff --git a/frameworks/keyed/ember/testem.js b/frameworks/keyed/ember/testem.js deleted file mode 100644 index 367f5659c..000000000 --- a/frameworks/keyed/ember/testem.js +++ /dev/null @@ -1,24 +0,0 @@ -module.exports = { - test_page: 'tests/index.html?hidepassed', - disable_watching: true, - launch_in_ci: [ - 'Chrome' - ], - launch_in_dev: [ - 'Chrome' - ], - browser_args: { - Chrome: { - ci: [ - // --no-sandbox is needed when running Chrome inside a container - process.env.CI ? '--no-sandbox' : null, - '--headless', - '--disable-dev-shm-usage', - '--disable-software-rasterizer', - '--mute-audio', - '--remote-debugging-port=0', - '--window-size=1440,900' - ].filter(Boolean) - } - } -}; diff --git a/frameworks/keyed/ember/tests/helpers/destroy-app.js b/frameworks/keyed/ember/tests/helpers/destroy-app.js deleted file mode 100644 index e7f983bd1..000000000 --- a/frameworks/keyed/ember/tests/helpers/destroy-app.js +++ /dev/null @@ -1,5 +0,0 @@ -import { run } from '@ember/runloop'; - -export default function destroyApp(application) { - run(application, 'destroy'); -} diff --git a/frameworks/keyed/ember/tests/helpers/module-for-acceptance.js b/frameworks/keyed/ember/tests/helpers/module-for-acceptance.js deleted file mode 100644 index 90a93bac2..000000000 --- a/frameworks/keyed/ember/tests/helpers/module-for-acceptance.js +++ /dev/null @@ -1,21 +0,0 @@ -import { module } from 'qunit'; -import { resolve } from 'rsvp'; -import startApp from '../helpers/start-app'; -import destroyApp from '../helpers/destroy-app'; - -export default function(name, options = {}) { - module(name, { - beforeEach() { - this.application = startApp(); - - if (options.beforeEach) { - return options.beforeEach.apply(this, arguments); - } - }, - - afterEach() { - let afterEach = options.afterEach && options.afterEach.apply(this, arguments); - return resolve(afterEach).then(() => destroyApp(this.application)); - } - }); -} diff --git a/frameworks/keyed/ember/tests/helpers/resolver.js b/frameworks/keyed/ember/tests/helpers/resolver.js deleted file mode 100644 index b208d38d0..000000000 --- a/frameworks/keyed/ember/tests/helpers/resolver.js +++ /dev/null @@ -1,11 +0,0 @@ -import Resolver from '../../resolver'; -import config from '../../config/environment'; - -const resolver = Resolver.create(); - -resolver.namespace = { - modulePrefix: config.modulePrefix, - podModulePrefix: config.podModulePrefix -}; - -export default resolver; diff --git a/frameworks/keyed/ember/tests/helpers/start-app.js b/frameworks/keyed/ember/tests/helpers/start-app.js deleted file mode 100644 index 99d35dcf4..000000000 --- a/frameworks/keyed/ember/tests/helpers/start-app.js +++ /dev/null @@ -1,17 +0,0 @@ -import Application from '../../app'; -import config from '../../config/environment'; -import { merge } from '@ember/polyfills'; -import { run } from '@ember/runloop'; - -export default function startApp(attrs) { - let attributes = merge({}, config.APP); - attributes.autoboot = true; - attributes = merge(attributes, attrs); // use defaults, but you can override; - - return run(() => { - let application = Application.create(attributes); - application.setupForTesting(); - application.injectTestHelpers(); - return application; - }); -} diff --git a/frameworks/keyed/ember/tests/index.html b/frameworks/keyed/ember/tests/index.html deleted file mode 100644 index 69bed1099..000000000 --- a/frameworks/keyed/ember/tests/index.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - EmberTemp Tests - - - - {{content-for "head"}} - {{content-for "test-head"}} - - - - - - {{content-for "head-footer"}} - {{content-for "test-head-footer"}} - - - {{content-for "body"}} - {{content-for "test-body"}} - - - - - - - - {{content-for "body-footer"}} - {{content-for "test-body-footer"}} - - diff --git a/frameworks/keyed/ember/tests/integration/.gitkeep b/frameworks/keyed/ember/tests/integration/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/frameworks/keyed/ember/tests/integration/components/performant-each/component-test.js b/frameworks/keyed/ember/tests/integration/components/performant-each/component-test.js deleted file mode 100644 index 6dd8ae5d2..000000000 --- a/frameworks/keyed/ember/tests/integration/components/performant-each/component-test.js +++ /dev/null @@ -1,26 +0,0 @@ -import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; -import { render } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; - -module('Integration | Component | performant-each', function(hooks) { - setupRenderingTest(hooks); - - test('it renders', async function(assert) { - // Set any properties with this.set('myProperty', 'value'); - // Handle any actions with this.set('myAction', function(val) { ... }); - - await render(hbs``); - - assert.equal(this.element.textContent.trim(), ''); - - // Template block usage: - await render(hbs` - - template block text - - `); - - assert.equal(this.element.textContent.trim(), 'template block text'); - }); -}); diff --git a/frameworks/keyed/ember/tests/integration/components/table-row/component-test.js b/frameworks/keyed/ember/tests/integration/components/table-row/component-test.js deleted file mode 100644 index 18a855ae3..000000000 --- a/frameworks/keyed/ember/tests/integration/components/table-row/component-test.js +++ /dev/null @@ -1,26 +0,0 @@ -import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; -import { render } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; - -module('Integration | Component | table-row', function(hooks) { - setupRenderingTest(hooks); - - test('it renders', async function(assert) { - // Set any properties with this.set('myProperty', 'value'); - // Handle any actions with this.set('myAction', function(val) { ... }); - - await render(hbs`{{table-row}}`); - - assert.equal(this.element.textContent.trim(), ''); - - // Template block usage: - await render(hbs` - {{#table-row}} - template block text - {{/table-row}} - `); - - assert.equal(this.element.textContent.trim(), 'template block text'); - }); -}); diff --git a/frameworks/keyed/ember/tests/test-helper.js b/frameworks/keyed/ember/tests/test-helper.js deleted file mode 100644 index 0382a848d..000000000 --- a/frameworks/keyed/ember/tests/test-helper.js +++ /dev/null @@ -1,8 +0,0 @@ -import Application from '../app'; -import config from '../config/environment'; -import { setApplication } from '@ember/test-helpers'; -import { start } from 'ember-qunit'; - -setApplication(Application.create(config.APP)); - -start(); diff --git a/frameworks/keyed/ember/tests/unit/.gitkeep b/frameworks/keyed/ember/tests/unit/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/frameworks/keyed/ember/vendor/.gitkeep b/frameworks/keyed/ember/vendor/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/frameworks/keyed/endorphin/index.html b/frameworks/keyed/endorphin/index.html deleted file mode 100644 index c25833026..000000000 --- a/frameworks/keyed/endorphin/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - Endorphin - - - -
-
- - - diff --git a/frameworks/keyed/endorphin/package.json b/frameworks/keyed/endorphin/package.json deleted file mode 100644 index ea4e6866e..000000000 --- a/frameworks/keyed/endorphin/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "js-framework-benchmark-endorphin", - "version": "1.0.0", - "description": "Boilerplate for endorphin", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "endorphin" - }, - "main": "index.js", - "scripts": { - "build-dev": "rollup -c -w", - "build-prod": "rollup -c --environment production", - "watch": "rollup -wc" - }, - "keywords": [], - "author": "Sergey Chikuyonok", - "license": "ISC", - "devDependencies": { - "@endorphinjs/rollup-plugin-endorphin": "0.3.0", - "chokidar": "3.0.0", - "endorphin": "0.5.2", - "rollup": "1.12.4", - "rollup-plugin-buble": "0.19.6", - "rollup-plugin-commonjs": "10.0.0", - "rollup-plugin-node-resolve": "5.0.0", - "rollup-plugin-uglify": "6.0.2", - "rollup-plugin-terser": "5.0.0" - }, - "dependencies": {} -} diff --git a/frameworks/keyed/endorphin/rollup.config.js b/frameworks/keyed/endorphin/rollup.config.js deleted file mode 100644 index 8328d7cc6..000000000 --- a/frameworks/keyed/endorphin/rollup.config.js +++ /dev/null @@ -1,19 +0,0 @@ -import resolve from 'rollup-plugin-node-resolve'; -import commonjs from 'rollup-plugin-commonjs'; -import { terser } from 'rollup-plugin-terser'; -import endorphin from '@endorphinjs/rollup-plugin-endorphin'; - -export default { - input: './src/app.js', - plugins: [ - resolve(), - commonjs(), - endorphin(), - process.env.production && terser() - ], - output: [{ - format: 'iife', - file: './dist/main.js', - sourcemap: true - }] -}; diff --git a/frameworks/keyed/endorphin/src/app-ui/app-ui.html b/frameworks/keyed/endorphin/src/app-ui/app-ui.html deleted file mode 100644 index 294754059..000000000 --- a/frameworks/keyed/endorphin/src/app-ui/app-ui.html +++ /dev/null @@ -1,52 +0,0 @@ - - - diff --git a/frameworks/keyed/endorphin/src/app-ui/app-ui.js b/frameworks/keyed/endorphin/src/app-ui/app-ui.js deleted file mode 100644 index 76fac9634..000000000 --- a/frameworks/keyed/endorphin/src/app-ui/app-ui.js +++ /dev/null @@ -1,71 +0,0 @@ -const A = ['pretty', 'large', 'big', 'small', 'tall', 'short', 'long', 'handsome', 'plain', 'quaint', 'clean', - 'elegant', 'easy', 'angry', 'crazy', 'helpful', 'mushy', 'odd', 'unsightly', 'adorable', 'important', 'inexpensive', - 'cheap', 'expensive', 'fancy']; -const C = ['red', 'yellow', 'blue', 'green', 'pink', 'brown', 'purple', 'brown', 'white', 'black', 'orange']; -const N = ['table', 'chair', 'house', 'bbq', 'desk', 'car', 'pony', 'cookie', 'sandwich', 'burger', 'pizza', 'mouse', - 'keyboard']; - -function random(max) { - return Math.floor(Math.random() * 1000) % max; -} - -let nextId = 1; - -function buildData(count) { - const data = new Array(count); - for (let i = 0; i < count; i++) { - data[i] = { - id: nextId++, - label: `${A[random(A.length)]} ${C[random(C.length)]} ${N[random(N.length)]}`, - }; - } - return data; -} - -export function state() { - return { rows: [], selected: null }; -} - -export function onAdd({ state, setState }) { - setState({ rows: state.rows.concat(buildData(1000)) }); -} - -export function onClear({ setState }) { - setState({ rows: [], selected: null }); -} - -export function onPartialUpdate({ state, setState }) { - const rows = state.rows.slice(); - - for (let i = 0; i < rows.length; i += 10) { - rows[i].label += ' !!!'; - } - - setState({ rows }); -} - -export function onRemove(item, { state, setState }) { - const { rows } = state; - const ix = rows.indexOf(item); - setState({ - rows: [...rows.slice(0, ix), ...rows.slice(ix + 1)] - }); -} - -export function onRun({ setState }) { - setState({ rows: buildData(1000), selected: null }); -} - -export function onRunLots({ setState }) { - setState({ rows: buildData(10000), selected: null }); -} - -export function onSwapRows({ state, setState }) { - const rows = state.rows.slice(); - - if (rows.length > 998) { - [rows[1], rows[998]] = [rows[998], rows[1]]; - - setState({ rows }); - } -} diff --git a/frameworks/keyed/endorphin/src/app.js b/frameworks/keyed/endorphin/src/app.js deleted file mode 100644 index 72a9331b5..000000000 --- a/frameworks/keyed/endorphin/src/app.js +++ /dev/null @@ -1,4 +0,0 @@ -import endorphin from 'endorphin'; -import * as AppUI from './app-ui/app-ui.html'; - -endorphin('endorphin-app', AppUI, { target: document.getElementById('main') }); diff --git a/frameworks/keyed/etch/.babelrc b/frameworks/keyed/etch/.babelrc deleted file mode 100644 index 55a896652..000000000 --- a/frameworks/keyed/etch/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - presets: [ "es2015", "react"], - plugins: [] -} \ No newline at end of file diff --git a/frameworks/keyed/etch/index.html b/frameworks/keyed/etch/index.html deleted file mode 100644 index bf9175d3a..000000000 --- a/frameworks/keyed/etch/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - etch v0.12.5 keyed - - - -
- - - diff --git a/frameworks/keyed/etch/package.json b/frameworks/keyed/etch/package.json deleted file mode 100644 index c46aa688f..000000000 --- a/frameworks/keyed/etch/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "js-framework-benchmark-etch-keyed", - "version": "1.0.0", - "description": "Etch keyed demo", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "etch" - }, - "scripts": { - "build-dev": "webpack -w -d", - "build-prod": "webpack -p" - }, - "devDependencies": { - "babel-core": "6.26.3", - "babel-loader": "7.1.5", - "babel-preset-es2015": "6.24.1", - "babel-preset-react": "6.24.1", - "jsx-loader": "0.13.2", - "webpack": "4.16.3", - "webpack-cli": "^3.1.0" - }, - "dependencies": { - "etch": "0.14.0" - } -} diff --git a/frameworks/keyed/etch/src/Main.jsx b/frameworks/keyed/etch/src/Main.jsx deleted file mode 100644 index 4da615a1f..000000000 --- a/frameworks/keyed/etch/src/Main.jsx +++ /dev/null @@ -1,105 +0,0 @@ -'use strict'; -/** @jsx etch.dom */ - -var etch = require('etch'); -const {Row} = require('./Row'); -const {Store} = require('./Store'); - -export class Main { - constructor(props, children) { - this.props = props; - this.children = children; - - this.store = new Store(); - - this.select = this.select.bind(this); - this.delete = this.delete.bind(this); - this.add = this.add.bind(this); - this.run = this.run.bind(this); - this.updateRows = this.updateRows.bind(this); - this.runLots = this.runLots.bind(this); - this.clear = this.clear.bind(this); - this.swapRows = this.swapRows.bind(this); - - etch.initialize(this); - } - - update (props, children) { - return etch.update(this); - } - - run() { - this.store.run(); - this.update(); - } - add() { - this.store.add(); - this.update(); - } - updateRows() { - this.store.update(); - this.update(); - } - select(id) { - this.store.select(id); - this.update(); - } - delete(id) { - this.store.delete(id); - this.update(); - } - runLots() { - this.store.runLots(); - this.update(); - } - clear() { - this.store.clear(); - this.update(); - } - swapRows() { - this.store.swapRows(); - this.update(); - } - render () { - let rows = this.store.data.map((d,i) => { - return - }); - return (
-
-
-
-

etch v0.12.5 (keyed)

-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
-
- - - {rows} - -
- -
); - } -} diff --git a/frameworks/keyed/etch/src/Row.jsx b/frameworks/keyed/etch/src/Row.jsx deleted file mode 100644 index a6abebe2d..000000000 --- a/frameworks/keyed/etch/src/Row.jsx +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; -/** @jsx etch.dom */ - -var etch = require('etch'); - -export class Row { - constructor(props, children) { - this.props = props; - this.children = children; - - this.onDelete = this.onDelete.bind(this); - this.onClick = this.onClick.bind(this); - - etch.initialize(this); - } - - update(nextProps, children) { - if (nextProps.data === this.props.data && nextProps.styleClass === this.props.styleClass) { - return Promise.resolve(); - } - this.props = Object.assign({}, this.props, nextProps); - this.children = children; - return etch.update(this); - } - - onDelete() { - this.props.onDelete(this.props.data.id); - } - onClick() { - this.props.onClick(this.props.data.id); - } - - render() { - let {styleClass, onClick, onDelete, data} = this.props; - return ( - {data.id} - - {data.label} - - - - ); - } -} diff --git a/frameworks/keyed/etch/src/Store.es6.js b/frameworks/keyed/etch/src/Store.es6.js deleted file mode 100644 index 2a39c87b7..000000000 --- a/frameworks/keyed/etch/src/Store.es6.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -function _random(max) { - return Math.round(Math.random()*1000)%max; -} - -export class Store { - constructor() { - this.data = []; - this.selected = undefined; - this.id = 1; - } - buildData(count = 1000) { - var adjectives = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy"]; - var colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"]; - var nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"]; - var data = []; - for (var i = 0; i < count; i++) - data.push({id: this.id++, label: adjectives[_random(adjectives.length)] + " " + colours[_random(colours.length)] + " " + nouns[_random(nouns.length)] }); - return data; - } - updateData(mod = 10) { - for (let i=0;i d.id==id); - this.data.splice(idx, 1); - } - run() { - this.data = this.buildData(); - this.selected = undefined; - } - add() { - this.data = this.data.concat(this.buildData(1000)); - } - update() { - this.updateData(); - } - select(id) { - this.selected = id; - } - runLots() { - this.data = this.buildData(10000); - this.selected = undefined; - } - clear() { - this.data = []; - this.selected = undefined; - } - swapRows() { - if(this.data.length > 998) { - var a = this.data[1]; - this.data[1] = this.data[998]; - this.data[998] = a; - } - } -} \ No newline at end of file diff --git a/frameworks/keyed/etch/src/main.es6.js b/frameworks/keyed/etch/src/main.es6.js deleted file mode 100644 index f373c7358..000000000 --- a/frameworks/keyed/etch/src/main.es6.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -let {Main} = require('./Main'); -let component = new Main({}); -document.getElementById('main').appendChild(component.element); diff --git a/frameworks/keyed/etch/webpack.config.js b/frameworks/keyed/etch/webpack.config.js deleted file mode 100644 index a311907ab..000000000 --- a/frameworks/keyed/etch/webpack.config.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; -require("babel-plugin-syntax-jsx") -var path = require('path') -var webpack = require('webpack') -var cache = {}; -var loaders = [ - { - test: /\.jsx$/, - loader: 'babel-loader' - }, - { - test: /(\.es6)?\.js$/, - loader: 'babel-loader' - }, - { - test: /\.css$/, - loader: 'style-loader!css-loader' - } -]; -var extensions = [ - '.js', '.jsx', '.es6.js' -]; - -module.exports = [{ - cache: cache, - module: { - rules: loaders - }, - entry: { - main: './src/main.es6.js', - }, - output: { - path: path.resolve(__dirname, "dist"), - filename: '[name].js' - }, - resolve: { - extensions: extensions, - modules: [ - __dirname, - path.resolve(__dirname, "src"), - "node_modules" - ] - }, - plugins: [ - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': '"production"' - }) - ] -}]; diff --git a/frameworks/keyed/faster-dom/index.html b/frameworks/keyed/faster-dom/index.html deleted file mode 100644 index c9ea63c2b..000000000 --- a/frameworks/keyed/faster-dom/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - FasterDom-"keyed" - - - -
-
- - - diff --git a/frameworks/keyed/faster-dom/package.json b/frameworks/keyed/faster-dom/package.json deleted file mode 100644 index 5ebc35592..000000000 --- a/frameworks/keyed/faster-dom/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "js-framework-benchmark-faster-dom", - "main": "index.js", - "description": "Benchmark for faster-dom.js framework", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "faster-dom" - }, - "scripts": { - "build-dev": "webpack -w -d", - "build-prod": "webpack -p" - }, - "keywords": [ - "faster-dom", - "webpack" - ], - "author": "Stefan Krause", - "license": "Apache-2.0", - "homepage": "https://github.com/krausest/js-framework-benchmark", - "repository": { - "type": "git", - "url": "https://github.com/krausest/js-framework-benchmark.git" - }, - "devDependencies": { - "babel-core": "6.24.1", - "babel-loader": "7.0.0", - "babel-preset-es2015": "6.24.1", - "webpack": "4.29.2", - "webpack-cli": "3.2.3" - }, - "dependencies": { - "faster-dom": "0.0.43-alpha", - "terser-webpack-plugin": "^1.2.3" - } -} diff --git a/frameworks/keyed/faster-dom/src/Main.js b/frameworks/keyed/faster-dom/src/Main.js deleted file mode 100644 index 3d9d7a9ec..000000000 --- a/frameworks/keyed/faster-dom/src/Main.js +++ /dev/null @@ -1,290 +0,0 @@ -import { Component, bootstrap, createComponent, fdFor, fdObject, fdValue } from 'faster-dom' - -import { Store } from './Store'; - -function createTr(item, selectedId, onSelect, onRemove) { - return createComponent(TrComponent, item, selectedId, onSelect, onRemove) -} - -class TrComponent extends Component { - constructor(item, selectedItem, onSelect, onRemove) { - super(); - this.selectedItemObs = selectedItem; - const selectedObs = fdValue(this.selectedItemObs.value === item ? true : false) - - this.selectedSub = (newItem) => { - selectedObs.value = newItem === item ? true : false - } - this.selectedItemObs.addSubscriber(this.selectedSub) - this.reactive = { - selected: selectedObs - } - this.fdObjects = { - trClasses: new fdObject({ - 'danger': this.reactive.selected - }), - } - this.onSelectClick = () => { - onSelect(item); - } - this.onRemoveClick = () => { - onRemove(item); - } - this.template = { - tag: "tr", - classList: this.fdObjects.trClasses, - children: [ - { - tag: "td", - classList: 'col-md-1', - textValue: item.id, - }, - { - tag: "td", - classList: 'col-md-4', - children: [ - { - tag: "a", - attrs: { - 'data-action': 'select', - }, - listeners: { - click: this.onSelectClick - }, - textValue: item.label, - } - ] - }, - { - tag: "td", - classList: 'col-md-1', - children: [ - { - tag: 'a', - children: [ - { - tag: 'span', - classList: 'remove glyphicon glyphicon-remove', - listeners: { - click: this.onRemoveClick - }, - attrs: { - 'aria-hidden': 'true' - } - } - ] - } - ] - }, - { - tag: "td", - classList: 'col-md-6' - } - ] - } - } - - onDestroy() { - this.selectedItemObs.removeSubscriber(this.selectedSub); - } -} - -function createMainContainer() { - return createComponent(MainContainer); -} - -class MainContainer extends Component { - constructor() { - super(); - this.store = new Store(); - this.onRunClick = () => { - this.store.setData(); - } - this.onRunLotsClick = () => { - this.store.setData(10000); - } - this.onAppendClick = () => { - this.store.append(); - } - this.onClear = () => { - this.store.clear(); - } - this.onUpdateClick = () => { - this.store.update(); - } - this.onSwapClick = () => { - this.store.swapData(); - } - this.template = { - tag: "div", - classList: 'container', - children: [ - { - tag: "div", - classList: "jumbotron", - children: [ - { - tag: "div", - classList: 'row', - children: [ - { - tag: "div", - classList: "col-md-6", - children: [ - { - tag: "h1", - textValue: 'FastDom-"keyed"' - } - ] - }, - { - tag: "div", - classList: 'col-md-6', - children: [ - { - tag: "div", - classList: 'row', - children: [ - { - tag: "div", - classList: 'col-sm-6 smallpad', - children: [ - { - tag: "button", - classList: 'btn btn-primary btn-block', - attrs: { - id: "run" - }, - textValue: "Create 1,000 rows", - listeners: { - click: this.onRunClick, - } - } - ] - }, - { - tag: "div", - classList: 'col-sm-6 smallpad', - children: [ - { - tag: "button", - attrs: { - id: "runlots" - }, - classList: 'btn btn-primary btn-block', - textValue: "Create 10,000 rows", - listeners: { - click: this.onRunLotsClick, - } - } - ] - }, - { - tag: "div", - classList: 'col-sm-6 smallpad', - children: [ - { - tag: "button", - attrs: { - id: "add" - }, - classList: 'btn btn-primary btn-block', - textValue: "Append 1,000 rows", - listeners: { - click: this.onAppendClick, - } - } - ] - }, - { - tag: "div", - classList: 'col-sm-6 smallpad', - children: [ - { - tag: "button", - attrs: { - id: "update" - }, - classList: 'btn btn-primary btn-block', - textValue: "Update every 10th row", - listeners: { - click: this.onUpdateClick, - } - } - ] - }, - { - tag: "div", - classList: 'col-sm-6 smallpad', - children: [ - { - tag: "button", - attrs: { - id: "clear" - }, - classList: 'btn btn-primary btn-block', - textValue: "Clear", - listeners: { - click: this.onClear, - } - } - ] - }, - { - tag: "div", - classList: 'col-sm-6 smallpad', - children: [ - { - tag: "button", - attrs: { - id: "swaprows" - }, - classList: 'btn btn-primary btn-block', - textValue: "Swap Rows", - listeners: { - click: this.onSwapClick, - } - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - tag: "table", - attrs: { - id: "table" - }, - classList: 'table table-hover table-striped test-data', - children: [ - { - tag: "tbody", - children: [ - fdFor(this.store.data, createTr, [ - (e) => e, - () => this.store.selectedItem, - () => this.store.select, - () => this.store.remove, - ], (item) => item.id) - ] - } - ] - }, - { - tag: "span", - attrs: { - 'aria-hidden': true, - }, - classList: 'preloadicon glyphicon glyphicon-remove' - } - ] - } - } -} - -bootstrap('#main', createMainContainer) \ No newline at end of file diff --git a/frameworks/keyed/faster-dom/src/Store.js b/frameworks/keyed/faster-dom/src/Store.js deleted file mode 100644 index a1ec1f1e8..000000000 --- a/frameworks/keyed/faster-dom/src/Store.js +++ /dev/null @@ -1,124 +0,0 @@ -import { fdValue } from 'faster-dom' - -let id = 1; - -const rand = Math.random - -function buildData(count) { - const adjectives = [ - "pretty", - "large", - "big", - "small", - "tall", - "short", - "long", - "handsome", - "plain", - "quaint", - "clean", - "elegant", - "easy", - "angry", - "crazy", - "helpful", - "mushy", - "odd", - "unsightly", - "adorable", - "important", - "inexpensive", - "cheap", - "expensive", - "fancy", - ] - - const colours = [ - "red", - "yellow", - "blue", - "green", - "pink", - "brown", - "purple", - "brown", - "white", - "black", - "orange", - ] - - const nouns = [ - "table", - "chair", - "house", - "bbq", - "desk", - "car", - "pony", - "cookie", - "sandwich", - "burger", - "pizza", - "mouse", - "keyboard", - ] - - const arr = []; - for(let i = 0; i> 0]} ${colours[ - rand() * 1000 % colours.length >> 0]} ${nouns[ - rand() * 1000 % nouns.length >> 0]}`) - }) - } - return arr; -} - -export class Store { - constructor() { - this.data = fdValue([]); - this.selectedItem = fdValue(null) - this.select = (item) => { - this.selectedItem.value = item; - } - this.remove = (item) => { - const removeIndex = this.data.value.indexOf(item) - this.data.value.splice(removeIndex, 1) - this.data.value = [...this.data.value] - } - } - - setData(count = 1000) { - this.data.value = buildData(count); - } - - append(count = 1000) { - this.data.value = this.data.value.concat(buildData(count)) - } - - clear() { - this.data.value = []; - } - - update() { - const length = this.data.value.length - for (let i = 0; i < length; i += 10) { - const item = this.data.value[i] - item.label.value = `${item.label.value} !!!` - } - } - - swapData() { - const arr = this.data.value - if (arr.length <= 998) { - return - } - - const temp = arr[1] - arr[1] = arr[998] - arr[998] = temp - this.data.value = [...arr] - } -} \ No newline at end of file diff --git a/frameworks/keyed/faster-dom/webpack.config.js b/frameworks/keyed/faster-dom/webpack.config.js deleted file mode 100644 index 71d67b623..000000000 --- a/frameworks/keyed/faster-dom/webpack.config.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict'; -const path = require('path') -const TerserPlugin = require('terser-webpack-plugin'); - -const extensions = [ - '.js', '.jsx', '.es6.js' -]; - -module.exports = [{ - mode: 'production', - module: { - rules: [ - { - test: /\.js$/, - loader: 'babel-loader' - }, - { - test: /\.css$/, - loader: 'style-loader!css-loader' - } - ] - }, - entry: { - main: './src/Main.js', - }, - output: { - path: path.resolve(__dirname, "dist"), - filename: '[name].js' - }, - optimization: { - minimizer: [ - new TerserPlugin({ - terserOptions: { - parse: { - // we want terser to parse ecma 8 code. However, we don't want it - // to apply any minfication steps that turns valid ecma 5 code - // into invalid ecma 5 code. This is why the 'compress' and 'output' - // sections only apply transformations that are ecma 5 safe - // https://github.com/facebook/create-react-app/pull/4234 - ecma: 8, - }, - compress: { - ecma: 5, - warnings: false, - // Disabled because of an issue with Uglify breaking seemingly valid code: - // https://github.com/facebook/create-react-app/issues/2376 - // Pending further investigation: - // https://github.com/mishoo/UglifyJS2/issues/2011 - comparisons: false, - }, - mangle: { - safari10: true, - }, - output: { - ecma: 5, - comments: false, - // Turned on because emoji and regex is not minified properly using default - // https://github.com/facebook/create-react-app/issues/2488 - ascii_only: true, - }, - }, - // Use multi-process parallel running to improve the build speed - // Default number of concurrent runs: os.cpus().length - 1 - parallel: true, - // Enable file caching - cache: true, - }), - ] - }, - resolve: { - extensions: extensions, - modules: [ - __dirname, - path.resolve(__dirname, "src"), - "node_modules" - ], - alias: { - } - } -}]; \ No newline at end of file diff --git a/frameworks/keyed/fidan/app.tsx b/frameworks/keyed/fidan/app.tsx deleted file mode 100644 index 6a3c7fca0..000000000 --- a/frameworks/keyed/fidan/app.tsx +++ /dev/null @@ -1,184 +0,0 @@ -"use strict"; -import { value, beforeCompute, FidanArray } from "@fidanjs/runtime"; - -import { buildData, BenchmarkDataRow } from "./data"; -import { jsxArrayMap } from "@fidanjs/jsx"; - -const dataArray = value([]) as FidanArray; -const selectedTr = value(null); - -beforeCompute( - null, - (current, prev) => { - if (prev) prev.className = ""; - if (current) current.className = "danger"; - }, - [selectedTr] -); - -const run = () => { - const data = buildData(1000); - dataArray(data); -}; - -const runLots = () => { - selectedTr(null); - const data = buildData(10000); - dataArray(data); -}; - -const add = () => { - selectedTr(null); - const currentData = dataArray(); - const newData = buildData(1000); - currentData.push.apply(currentData, newData); -}; - -const cleardata = () => { - selectedTr(null); - dataArray([]); -}; - -const select = e => { - selectedTr(e.target.parentNode.parentNode); -}; - -const del = e => { - const id = parseInt(e.target.getAttribute("data-id")); - const data = dataArray(); - const idx = data.findIndex(item => item.id() == id); - data.splice(idx, 1); -}; - -const update = () => { - const data = dataArray(); - for (let i = 0; i < data.length; i += 10) { - data[i].label(data[i].label() + " !!!"); - } -}; - -const swaprows = () => { - const data = dataArray(); - const x = 1, - y = 998; - const sp1 = data.splice(x, 1, data[y])[0]; - data.splice(y, 1, sp1); - // dataArray().splice(y, 1, dataArray().splice(x, 1, dataArray()[y])[0]); -}; - -const itemView = (dataItem: BenchmarkDataRow) => { - return ( - - {dataItem.id} - - {dataItem.label} - - - - - - - - ); -}; - -const mainView = (( -
-
-
-
-

fidan

-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
-
- - -
-
-) as any) as HTMLElement; - -mainView.addEventListener("click", (e: any) => { - if (e.target.matches(".lbl")) { - select(e); - } else if (e.target.matches(".remove")) { - del(e); - } -}); - -document.getElementById("main").appendChild(mainView); diff --git a/frameworks/keyed/fidan/data.ts b/frameworks/keyed/fidan/data.ts deleted file mode 100644 index 8f2636f8c..000000000 --- a/frameworks/keyed/fidan/data.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { value, FidanValue } from "@fidanjs/runtime"; - -export interface BenchmarkDataRow { - id: FidanValue; - label: FidanValue; -} - -let did = 1; -function _random(max) { - return Math.round(Math.random() * 1000) % max; -} - -export const buildData = count => { - var adjectives = [ - "pretty", - "large", - "big", - "small", - "tall", - "short", - "long", - "handsome", - "plain", - "quaint", - "clean", - "elegant", - "easy", - "angry", - "crazy", - "helpful", - "mushy", - "odd", - "unsightly", - "adorable", - "important", - "inexpensive", - "cheap", - "expensive", - "fancy" - ]; - var colours = [ - "red", - "yellow", - "blue", - "green", - "pink", - "brown", - "purple", - "brown", - "white", - "black", - "orange" - ]; - var nouns = [ - "table", - "chair", - "house", - "bbq", - "desk", - "car", - "pony", - "cookie", - "sandwich", - "burger", - "pizza", - "mouse", - "keyboard" - ]; - var data = []; - for (var i = 0; i < count; i++) { - data.push({ - id: value(did++), - label: value( - adjectives[_random(adjectives.length)] + - " " + - colours[_random(colours.length)] + - " " + - nouns[_random(nouns.length)] - ) - }); - } - return data; -}; diff --git a/frameworks/keyed/fidan/index.html b/frameworks/keyed/fidan/index.html deleted file mode 100644 index 10b1a92f3..000000000 --- a/frameworks/keyed/fidan/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - fidan - - - -
- - - diff --git a/frameworks/keyed/fidan/package.json b/frameworks/keyed/fidan/package.json deleted file mode 100644 index 0d050d378..000000000 --- a/frameworks/keyed/fidan/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "js-framework-benchmark-fidan", - "version": "1.0.0", - "description": "fidan demo", - "main": "app.js", - "scripts": { - "build-dev": "webpack -d", - "build-prod": "webpack -p", - "start": "ws", - "yalc-link": "yalc link @fidanjs/runtime" - }, - "js-framework-benchmark": { - "frameworkVersionFromPackage": "@fidanjs/runtime", - "issues": [694] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/krausest/js-framework-benchmark.git" - }, - "keywords": [ - "fidanjs" - ], - "author": "Ismail Codar", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/krausest/js-framework-benchmark/issues" - }, - "homepage": "https://github.com/krausest/js-framework-benchmark#readme", - "dependencies": { - "@fidanjs/jsx": "0.0.8", - "@fidanjs/runtime": "0.0.23" - }, - "devDependencies": { - "@babel/preset-env": "7.4.4", - "@babel/preset-typescript": "7.3.3", - "babel-loader": "8.0.6", - "webpack": "4.31.0", - "webpack-cli": "3.3.2" - } -} diff --git a/frameworks/keyed/fidan/webpack.config.js b/frameworks/keyed/fidan/webpack.config.js deleted file mode 100644 index c73d1831b..000000000 --- a/frameworks/keyed/fidan/webpack.config.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = { - entry: "./app.tsx", - output: { - filename: "app.min.js" - }, - resolve: { - extensions: [".ts", ".tsx"] - }, - module: { - rules: [ - { - test: /\.tsx?$/, - loader: "babel-loader", - options: { - presets: ["@babel/preset-typescript", "@babel/preset-env"], - plugins: ["@fidanjs/fidan-jsx"] - } - } - ] - } -}; diff --git a/frameworks/keyed/fntags/.gitignore b/frameworks/keyed/fntags/.gitignore deleted file mode 100644 index ae3a6d4d9..000000000 --- a/frameworks/keyed/fntags/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -fntags.js -node_modules \ No newline at end of file diff --git a/frameworks/keyed/fntags/build.js b/frameworks/keyed/fntags/build.js deleted file mode 100644 index 65a2039ee..000000000 --- a/frameworks/keyed/fntags/build.js +++ /dev/null @@ -1,20 +0,0 @@ -const fs = require( 'fs-extra' ) -const terser = require( 'terser' ) - -if( fs.existsSync( 'dist' ) ) fs.removeSync( 'dist' ) -fs.mkdirSync( 'dist' ) - -const minify = ( file ) => { - let content = fs.readFileSync( file, 'utf8' ) - if( process.argv[ 2 ] === 'dev' ) { - return content - } else { - const code = terser.minify( content ).code - if( !code ) throw new Error( `failed to minify ${file}` ).stack - return code - } -} - -fs.writeFileSync( 'dist/fntags.js', minify( 'node_modules/fntags/src/fntags.js' ) ) - -fs.writeFileSync( 'dist/Main.js', minify( 'src/Main.js' ).replace( '../node_modules/fntags/src/fntags.js', './fntags.js' ) ) \ No newline at end of file diff --git a/frameworks/keyed/fntags/index.html b/frameworks/keyed/fntags/index.html deleted file mode 100644 index fa9fa083d..000000000 --- a/frameworks/keyed/fntags/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - fntags-keyed - - - - - - \ No newline at end of file diff --git a/frameworks/keyed/fntags/package.json b/frameworks/keyed/fntags/package.json deleted file mode 100644 index 67616af70..000000000 --- a/frameworks/keyed/fntags/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "js-framework-benchmark-fntags", - "version": "0.0.1", - "description": "fntags demo", - "main": "index.js", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "fntags" - }, - "scripts": { - "build-dev": "node build.js dev", - "build-prod": "node build.js" - }, - "author": "Robert Kempton", - "dependencies": { - "fntags": "0.1.7" - }, - "devDependencies": { - "fs-extra": "8.1.0", - "terser": "4.3.8" - } -} diff --git a/frameworks/keyed/fntags/src/Main.js b/frameworks/keyed/fntags/src/Main.js deleted file mode 100644 index 9bd9ef885..000000000 --- a/frameworks/keyed/fntags/src/Main.js +++ /dev/null @@ -1,125 +0,0 @@ -import { findElement, fnapp, fnbind, fnstate, h, resetState } from '../node_modules/fntags/src/fntags.js' - -let data = fnstate( { current: [] } ) - -function random( max ) { return Math.round( Math.random() * 1000 ) % max } - -const A = [ 'pretty', 'large', 'big', 'small', 'tall', 'short', 'long', 'handsome', 'plain', 'quaint', 'clean', - 'elegant', 'easy', 'angry', 'crazy', 'helpful', 'mushy', 'odd', 'unsightly', 'adorable', 'important', 'inexpensive', - 'cheap', 'expensive', 'fancy' ] -const C = [ 'red', 'yellow', 'blue', 'green', 'pink', 'brown', 'purple', 'brown', 'white', 'black', 'orange' ] -const N = [ 'table', 'chair', 'house', 'bbq', 'desk', 'car', 'pony', 'cookie', 'sandwich', 'burger', 'pizza', 'mouse', - 'keyboard' ] - -let nextId = 1 -function buildData( count ) { - const newData = new Array( count ) - for( let i = 0; i < count; i++ ) { - newData[ i ] = fnstate( { - id: nextId++, - label: `${A[ random( A.length ) ]} ${C[ random( C.length ) ]} ${N[ random( N.length ) ]}` - } ) - } - return newData -} - -const Button = ( id, title, onclick ) => - h( 'div', { class: 'col-sm-6 smallpad' }, - h( 'button', { id, type: 'button', class: 'btn btn-primary btn-block', onclick: onclick }, title ) - ) - -let selectedId= 0 -const row = ( item ) => { - let label = h( 'a', { - onclick: () => { - let currentSelection = data.current.find( i => i && i.id == selectedId ) - if( currentSelection ) findElement( currentSelection ).className = '' - findElement( item ).className = 'danger' - selectedId = item.id - } - }, item.label ) - let id = h( 'td', { class: 'col-md-1' }, item.id ) - let tr = h( 'tr', { id: item.id.toString(), class: selectedId === item.id ? 'danger' : '' }, - id, - h( 'td', { class: 'col-md-4' }, label ), - h( 'td', { - class: 'col-md-1', - onclick: ( e ) => { - e.preventDefault() - tr.replaceWith( '' ) - resetState( item ) - data.current[ data.current.findIndex( i => i && i.id === item.id ) ] = null - tr = null - } - }, - h( 'a', - h( 'span', { class: 'glyphicon glyphicon-remove', 'aria-hidden': 'true' } ) - ) - ), - h( 'td', { class: 'col-md-6' } ) - ) - return fnbind( - item, - tr, - () => { - label.innerText = item.label - id.innerText = item.id - } - ) -} - -const dataTable = h( 'tbody' ) -fnapp( document.body, - h( 'div', { class: 'container' }, - h( 'div', { class: 'jumbotron' }, - h( 'div', { class: 'row' }, - h( 'div', { class: 'col-md-6' }, - h( 'h1', 'fntags keyed' ) - ), - h( 'div', { class: 'col-md-6' }, - h( 'div', { class: 'row' }, - Button( 'run', 'Create 1,000 rows', () => data.current = buildData( 1000 ) ), - Button( 'runlots', 'Create 10,000 rows', () => data.current = buildData( 10000 ) ), - Button( 'add', 'Append 1,000 rows', () => { - let newData = buildData( 1000 ) - data.current.push( ...data.current.concat( newData ) ) - dataTable.append( ...newData.map( row ) ) - } ), - Button( 'update', 'Update every 10th row', () => { - for( let i = 0; i < data.current.length; i += 10 ) { - data.current[ i ].label += ' !!!' - } - } ), - Button( 'clear', 'Clear', () => data.current = [] ), - Button( 'swaprows', 'Swap Rows', ( ) => { - const theData = data.current - if( theData.length > 998 ) { - - let rowa = findElement( theData[ 1 ], el => el.getAttribute( 'id' ) == theData[ 1 ].id ) - let rowb = findElement( theData[ 998 ], el => el.getAttribute( 'id' ) == theData[ 998 ].id ) - - const a = theData[ 1 ] - theData[ 1 ] = theData[ 998 ] - theData[ 998 ] = a - let sib = rowa.nextSibling - let parent = rowa.parentNode - parent.insertBefore( rowa, rowb ) - parent.insertBefore( rowb, sib ) - - } - } ) - ) - ) - ) - ) - ), - h( 'table', { class: 'table table-hover table-striped test-data' }, - fnbind( data, dataTable, ( el, st ) => { - while( el.firstChild ) { - el.removeChild( el.firstChild ) - } - el.append( ...st.current.filter( r => r ).map( row ) ) - } ) - ), - h( 'span', { class: 'preloadicon glyphicon glyphicon-remove', 'aria-hidden': 'true' } ) -) \ No newline at end of file diff --git a/frameworks/keyed/ganic/.babelrc b/frameworks/keyed/ganic/.babelrc deleted file mode 100644 index 91f8895b9..000000000 --- a/frameworks/keyed/ganic/.babelrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "presets": [ - ["@babel/preset-env", { - "useBuiltIns": false - }] - ], - "plugins": [ - [ - "@babel/plugin-transform-react-jsx", - { - "pragma": "Ganic.createElement", - "pragmaFrag": "Ganic.Fragment", - "throwIfNamespace": false - } - ], - [ - "@babel/plugin-transform-runtime", - { - "regenerator": true - } - ] - ], - "parserOpts": {} -} \ No newline at end of file diff --git a/frameworks/keyed/ganic/index.html b/frameworks/keyed/ganic/index.html deleted file mode 100644 index ac2225615..000000000 --- a/frameworks/keyed/ganic/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Ganic - - - -
- - - diff --git a/frameworks/keyed/ganic/package.json b/frameworks/keyed/ganic/package.json deleted file mode 100644 index 50ac6eab0..000000000 --- a/frameworks/keyed/ganic/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "js-framework-benchmark-ganic", - "version": "1.0.0", - "description": "Benchmark for ganic library", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "ganic" - }, - "scripts": { - "build-dev": "webpack --watch", - "build-prod": "webpack" - }, - "author": "Rango Yuan", - "license": "Apache-2.0", - "homepage": "https://github.com/krausest/js-framework-benchmark", - "repository": { - "type": "git", - "url": "https://github.com/krausest/js-framework-benchmark.git" - }, - "dependencies": { - "ganic": "2.1.2", - "ganic-dom": "2.1.7", - "ganic-usex": "2.1.4" - }, - "devDependencies": { - "@babel/core": "7.7.4", - "@babel/plugin-transform-react-jsx": "7.7.4", - "@babel/plugin-transform-runtime": "7.6.2", - "@babel/preset-env": "7.7.4", - "@babel/runtime": "7.7.4", - "babel-loader": "8.0.6", - "terser-webpack-plugin": "1.3.0", - "webpack": "4.34.0", - "webpack-cli": "3.3.4" - } -} diff --git a/frameworks/keyed/ganic/src/Benchmark.js b/frameworks/keyed/ganic/src/Benchmark.js deleted file mode 100644 index dcd9931cc..000000000 --- a/frameworks/keyed/ganic/src/Benchmark.js +++ /dev/null @@ -1,60 +0,0 @@ -/* eslint-disable no-unused-vars */ -import Ganic from 'ganic'; -import { useCallback } from "ganic-usex"; -import useStore from './useStore'; - -const GlyphIcon = ; - -const Row = ({ selected, item, dispatch }) => { - const select = useCallback(() => dispatch({ type: 'SELECT', id: item.id })), - remove = useCallback(() => dispatch({ type: 'REMOVE', id: item.id })); - - return ( - {item.id} - {item.label} - {GlyphIcon} - - ); -}; - -const Button = ({ id, cb, title }) => ( -
- -
-); - -const Jumbotron = ({ dispatch }) => ( -
-
-
-

Ganic keyed

-
-
-
-
-
-
-
-); - -const Benchmark = () => { - const [state, dispatch] = useStore(); - - return (
- - - {state.data.map(item => ( - - ))} -
- -
); -} - -export default Benchmark; diff --git a/frameworks/keyed/ganic/src/buildData.js b/frameworks/keyed/ganic/src/buildData.js deleted file mode 100644 index 3649bdeff..000000000 --- a/frameworks/keyed/ganic/src/buildData.js +++ /dev/null @@ -1,23 +0,0 @@ -const random = max => Math.round(Math.random() * 1000) % max; - -const A = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", - "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", - "cheap", "expensive", "fancy"]; -const C = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"]; -const N = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", - "keyboard"]; - -let nextId = 1; - -const buildData = count => { - const data = new Array(count); - for (let i = 0; i < count; i++) { - data[i] = { - id: nextId++, - label: `${A[random(A.length)]} ${C[random(C.length)]} ${N[random(N.length)]}`, - }; - } - return data; -} - -export default buildData; diff --git a/frameworks/keyed/ganic/src/main.js b/frameworks/keyed/ganic/src/main.js deleted file mode 100644 index e1231ba2c..000000000 --- a/frameworks/keyed/ganic/src/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import Ganic from 'ganic'; -import GanicDOM from 'ganic-dom'; -import Benchmark from './Benchmark'; - -GanicDOM.render(, document.getElementById('main')); diff --git a/frameworks/keyed/ganic/src/useStore.js b/frameworks/keyed/ganic/src/useStore.js deleted file mode 100644 index ead2c5f90..000000000 --- a/frameworks/keyed/ganic/src/useStore.js +++ /dev/null @@ -1,44 +0,0 @@ -/* eslint-disable no-unused-vars */ -import { useCallback, useInitialState } from 'ganic-usex'; -import buildData from './buildData'; - -// todo: move useReducer to ganic-usex -const useReducer = (reducer, initState) => { - const [state, setState] = useInitialState(initState); - const dispatch = useCallback(action => setState(s => reducer(s, action))); - return [state, dispatch]; -} - -const listReducer = (state, action) => { - const { data, selected } = state; - switch (action.type) { - case 'RUN': - return { data: buildData(1000), selected: 0 }; - case 'RUN_LOTS': - return { data: buildData(10000), selected: 0 }; - case 'ADD': - return { data: data.concat(buildData(1000)), selected }; - case 'UPDATE': - const newData = data.slice(0); - for (let i = 0; i < newData.length; i += 10) { - const r = newData[i]; - newData[i] = { id: r.id, label: r.label + " !!!" }; - } - return { data: newData, selected }; - case 'CLEAR': - return { data: [], selected: 0 }; - case 'SWAP_ROWS': - return { data: [data[0], data[998], ...data.slice(2, 998), data[1], data[999]], selected }; - case 'REMOVE': - const idx = data.findIndex((d) => d.id === action.id); - return { data: [...data.slice(0, idx), ...data.slice(idx + 1)], selected }; - case 'SELECT': - return { data, selected: action.id }; - } - return state; -} - -const initState = { data: [], selected: 0 }; -const useStore = () => useReducer(listReducer, initState); - -export default useStore; diff --git a/frameworks/keyed/ganic/webpack.config.js b/frameworks/keyed/ganic/webpack.config.js deleted file mode 100644 index 249746ec7..000000000 --- a/frameworks/keyed/ganic/webpack.config.js +++ /dev/null @@ -1,61 +0,0 @@ -const path = require('path'); -const webpack = require('webpack'); -const TerserPlugin = require('terser-webpack-plugin'); - -module.exports = { - mode: 'production', - // mode: 'development', - entry: { - main: path.join(__dirname, 'src', 'main.js'), - }, - output: { - path: path.join(__dirname, 'dist'), - filename: '[name].js' - }, - resolve: { - extensions: ['.js', '.jsx'] - }, - module: { - rules: [{ - test: /\.jsx?$/, - exclude: /node_modules/, - use: [ - { - loader: 'babel-loader', - } - ] - }] - }, - optimization: { - minimizer: [ - new TerserPlugin({ - terserOptions: { - parse: { - ecma: 8, - }, - compress: { - ecma: 5, - warnings: false, - comparisons: false, - }, - mangle: { - safari10: true, - }, - output: { - ecma: 5, - comments: false, - ascii_only: true, - }, - }, - parallel: true, - cache: true, - }), - ] - }, - plugins: [ - new webpack.DefinePlugin({ - 'process.env': { NODE_ENV: JSON.stringify('production') } - // 'process.env': { NODE_ENV: JSON.stringify('development') } - }), - ], -}; diff --git a/frameworks/keyed/glasgow/.babelrc b/frameworks/keyed/glasgow/.babelrc deleted file mode 100644 index 773e66fd4..000000000 --- a/frameworks/keyed/glasgow/.babelrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "plugins": [ - "transform-react-jsx", - ] -} diff --git a/frameworks/keyed/glasgow/index.html b/frameworks/keyed/glasgow/index.html deleted file mode 100644 index c3f20ca73..000000000 --- a/frameworks/keyed/glasgow/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Glasgow - - - -
- - - diff --git a/frameworks/keyed/glasgow/package.json b/frameworks/keyed/glasgow/package.json deleted file mode 100644 index 47519a43f..000000000 --- a/frameworks/keyed/glasgow/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "js-framework-benchmark-glasgow", - "version": "1.0.0", - "description": "Benchmark for glasgow framework", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "glasgow" - }, - "scripts": { - "build-dev": "rollup -c", - "build-prod": "rollup -c --environment production" - }, - "keywords": [ - "ractive" - ], - "author": "Stefan Krause", - "license": "Apache-2.0", - "homepage": "https://github.com/krausest/js-framework-benchmark", - "repository": { - "type": "git", - "url": "https://github.com/krausest/js-framework-benchmark.git" - }, - "devDependencies": { - "babel-core": "6.26.3", - "babel-loader": "7.1.5", - "babel-preset-stage-0": "6.24.1", - "rollup": "^0.63.4", - "rollup-plugin-alias": "^1.4.0", - "rollup-plugin-babel": "^3.0.7", - "rollup-plugin-commonjs": "^9.1.4", - "rollup-plugin-node-resolve": "^3.3.0", - "rollup-plugin-replace": "^2.0.0", - "babel-plugin-transform-react-jsx": "^6.24.1" - }, - "dependencies": { - "glasgow": "0.2.7" - } -} diff --git a/frameworks/keyed/glasgow/readme.md b/frameworks/keyed/glasgow/readme.md deleted file mode 100644 index 7472e6db7..000000000 --- a/frameworks/keyed/glasgow/readme.md +++ /dev/null @@ -1,2 +0,0 @@ -# Glasgow Keyed -Bundle is done using Rollup. diff --git a/frameworks/keyed/glasgow/rollup.config.js b/frameworks/keyed/glasgow/rollup.config.js deleted file mode 100644 index d5f67b318..000000000 --- a/frameworks/keyed/glasgow/rollup.config.js +++ /dev/null @@ -1,42 +0,0 @@ -const commonjsPlugin = require('rollup-plugin-commonjs'); -const nodeResolvePlugin = require('rollup-plugin-node-resolve'); -const babelPlugin = require('rollup-plugin-babel'); -const path = require('path'); -const replace = require('rollup-plugin-replace'); -const alias = require('rollup-plugin-alias'); - -const isProduction = process.env.production; - -const extensions = ['.mjs', '.js', '.jsx']; - -// see below for details on the options -const plugins = [ - nodeResolvePlugin({ - preferBuiltins: false, - extensions: extensions - }), - replace({ - 'process.env.NODE_ENV': isProduction ? JSON.stringify('production') : JSON.stringify('development'), - sourcemap: false - }), - babelPlugin({ - exclude: 'node_modules/**', - sourceMaps: false - }), - commonjsPlugin({ - sourceMap: false, - extensions: extensions - }), -]; - - -export default { - input: path.join(__dirname, 'src/main.es6.js'), - output: { - name: 'glasgow', - format: 'iife', - file: path.join(__dirname, 'dist', 'main.js'), - sourcemap: false - }, - plugins: plugins -} diff --git a/frameworks/keyed/glasgow/src/controller.jsx b/frameworks/keyed/glasgow/src/controller.jsx deleted file mode 100644 index dcd7fb423..000000000 --- a/frameworks/keyed/glasgow/src/controller.jsx +++ /dev/null @@ -1,118 +0,0 @@ -'use strict'; - -/** @jsx glasgow */ - -import { Store } from './store.es6' -import glasgow from 'glasgow' - -function selectRow(props) { - props.store.select(props.id); -} - -function deleteRow(props) { - props.store.delete(props.id); -} - -function Row({ d, id, styleClass }) { - return ( - - {''+id} - - {d.label} - - - - - - - - ) -} - -function createRows(store) { - const rows = []; - const data = store.data; - const selected = store.selected; - - for (let i = 0; i < data.length; i++) { - const d = data[i]; - const id = d.id; - - rows.push( - - ); - } - - return {rows}; -} - -function bind(obj,name) { - let func = obj[name]; - return function(...args) { - return func.apply(obj, args); - } -} - -export function Controller(props) { - - return
-
-
-
-

Glasgow - keyed

-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
-
- - {createRows(store)} -
-
-} - - -const store = new Store(); -glasgow.setDebug(0); -glasgow.mount(document.getElementById("main"), ); - diff --git a/frameworks/keyed/glasgow/src/main.es6.js b/frameworks/keyed/glasgow/src/main.es6.js deleted file mode 100644 index 9a538bb4f..000000000 --- a/frameworks/keyed/glasgow/src/main.es6.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -import './controller'; diff --git a/frameworks/keyed/glasgow/src/store.es6.js b/frameworks/keyed/glasgow/src/store.es6.js deleted file mode 100644 index f7e05e1fb..000000000 --- a/frameworks/keyed/glasgow/src/store.es6.js +++ /dev/null @@ -1,142 +0,0 @@ -'use strict'; - -function random(max) { - return Math.round(Math.random() * 1000) % max; -} - -let rowId = 1; -const adjectives = [ - "pretty", - "large", - "big", - "small", - "tall", - "short", - "long", - "handsome", - "plain", - "quaint", - "clean", - "elegant", - "easy", - "angry", - "crazy", - "helpful", - "mushy", - "odd", - "unsightly", - "adorable", - "important", - "inexpensive", - "cheap", - "expensive", - "fancy" -]; -const colours = [ - "red", - "yellow", - "blue", - "green", - "pink", - "brown", - "purple", - "brown", - "white", - "black", - "orange" -]; -const nouns = [ - "table", - "chair", - "house", - "bbq", - "desk", - "car", - "pony", - "cookie", - "sandwich", - "burger", - "pizza", - "mouse", - "keyboard" -]; - -function buildData(count, result) { - for (let i = 0; i < count; i++) { - result.push({ - id: rowId++, - label: adjectives[random(adjectives.length)] + - " " + - colours[random(colours.length)] + - " " + - nouns[random(nouns.length)] - }); - } -} - -export class Store { - constructor() { - this.data = []; - this.selected = undefined; - this.id = 1; - } - - updateData() { - let data = this.data; - - for (let i = 0; i < data.length; i += 10) { - const dataItem = data[i]; - - data[i] = { - id: dataItem.id, - label: dataItem.label + " !!!" - }; - } - } - - delete(id) { - const data = this.data; - const idx = data.findIndex((d) => d.id === id); - - data.splice(idx, 1); - } - - run() { - this.data = []; - this.add(); - this.selected = undefined; - } - - add() { - buildData(1000, this.data); - } - - update() { - this.updateData(); - } - - select(id) { - this.selected = id; - } - - runLots() { - const newData = []; - buildData(10000, newData); - this.data = newData; - this.selected = undefined; - } - - clear() { - this.data = []; - this.selected = undefined; - } - - swapRows() { - let data = this.data; - if (data.length > 998) { - const a = data[1]; - data[1] = data[998]; - data[998] = a; - } - } -} diff --git a/frameworks/keyed/glasgow/webpack.config.js b/frameworks/keyed/glasgow/webpack.config.js deleted file mode 100644 index 935f371b6..000000000 --- a/frameworks/keyed/glasgow/webpack.config.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; -require("babel-plugin-syntax-jsx") -var path = require('path') - -var cache = {}; -var loaders = [ - { - test: /\.jsx$/, - loader: 'babel-loader' - }, - { - test: /\.es6\.js$/, - loader: 'babel-loader' - }, - { - test: /\.css$/, - loader: 'style-loader!css-loader' - } -]; -var extensions = [ - '.js', '.jsx', '.es6.js', '.msx' -]; - -module.exports = [{ - cache: cache, - module: { - loaders: loaders - }, - entry: { - main: './src/main', - }, - output: { - path: path.resolve(__dirname, "dist"), - filename: '[name].js', - sourceMapFilename: "[file].map", - }, - resolve: { - modules: [ - __dirname, - path.resolve(__dirname, "src"), - "node_modules" - ], - extensions: extensions - } -}]; diff --git a/frameworks/keyed/glimmer/.editorconfig b/frameworks/keyed/glimmer/.editorconfig deleted file mode 100644 index 219985c22..000000000 --- a/frameworks/keyed/glimmer/.editorconfig +++ /dev/null @@ -1,20 +0,0 @@ -# EditorConfig helps developers define and maintain consistent -# coding styles between different editors and IDEs -# editorconfig.org - -root = true - - -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -indent_style = space -indent_size = 2 - -[*.hbs] -insert_final_newline = false - -[*.{diff,md}] -trim_trailing_whitespace = false diff --git a/frameworks/keyed/glimmer/.ember-cli b/frameworks/keyed/glimmer/.ember-cli deleted file mode 100644 index bc83a0cf6..000000000 --- a/frameworks/keyed/glimmer/.ember-cli +++ /dev/null @@ -1,3 +0,0 @@ -{ - "blueprint": "@glimmer/blueprint" -} diff --git a/frameworks/keyed/glimmer/.gitignore b/frameworks/keyed/glimmer/.gitignore deleted file mode 100644 index cdd5f9eea..000000000 --- a/frameworks/keyed/glimmer/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -tmp/* -dist diff --git a/frameworks/keyed/glimmer/.template-lintrc.js b/frameworks/keyed/glimmer/.template-lintrc.js deleted file mode 100644 index b45e96ffd..000000000 --- a/frameworks/keyed/glimmer/.template-lintrc.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = { - extends: 'recommended' -}; diff --git a/frameworks/keyed/glimmer/.watchmanconfig b/frameworks/keyed/glimmer/.watchmanconfig deleted file mode 100644 index e7834e3e4..000000000 --- a/frameworks/keyed/glimmer/.watchmanconfig +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ignore_dirs": ["tmp", "dist"] -} diff --git a/frameworks/keyed/glimmer/README.md b/frameworks/keyed/glimmer/README.md deleted file mode 100644 index 0291fb835..000000000 --- a/frameworks/keyed/glimmer/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# glimmer - -This README outlines the details of collaborating on this Glimmer application. -A short introduction of this app could easily go here. - -## Prerequisites - -You will need the following things properly installed on your computer. - -* [Git](https://git-scm.com/) -* [Node.js](https://nodejs.org/) (with NPM) -* [Yarn](https://yarnpkg.com/en/) -* [Ember CLI](https://ember-cli.com/) - -## Installation - -* `git clone ` this repository -* `cd glimmer` -* `yarn` - -## Running / Development - -* `ember serve` -* Visit your app at [http://localhost:4200](http://localhost:4200). - -### Building - -* `ember build` (development) -* `ember build --environment production` (production) - -## Further Reading / Useful Links - -* [glimmerjs](http://github.com/tildeio/glimmer/) -* [ember-cli](https://ember-cli.com/) diff --git a/frameworks/keyed/glimmer/config/environment.js b/frameworks/keyed/glimmer/config/environment.js deleted file mode 100644 index f164ca218..000000000 --- a/frameworks/keyed/glimmer/config/environment.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = function(environment) { - let ENV = { - modulePrefix: 'glimmer', - environment - }; - - return ENV; -}; diff --git a/frameworks/keyed/glimmer/config/module-map.d.ts b/frameworks/keyed/glimmer/config/module-map.d.ts deleted file mode 100644 index b01e2cb55..000000000 --- a/frameworks/keyed/glimmer/config/module-map.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This is just a placeholder file to keep TypeScript aware editors happy. At build time, - * it will be replaced with a complete map of resolvable module paths => rolled up contents. - */ - -export interface Dict { - [index: string]: T; -} - -declare let map: Dict; -export default map; diff --git a/frameworks/keyed/glimmer/config/resolver-configuration.d.ts b/frameworks/keyed/glimmer/config/resolver-configuration.d.ts deleted file mode 100644 index a96597e0f..000000000 --- a/frameworks/keyed/glimmer/config/resolver-configuration.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * This is just a placeholder file to keep TypeScript aware editors happy. At build time, - * it will be replaced with a resolver configuration composed from your application's - * `config/environment.js` (and supplemented with default settings as possible). - */ - -import { ResolverConfiguration } from '@glimmer/resolver'; -declare var _default: ResolverConfiguration; -export default _default; diff --git a/frameworks/keyed/glimmer/config/targets.js b/frameworks/keyed/glimmer/config/targets.js deleted file mode 100644 index d4535c674..000000000 --- a/frameworks/keyed/glimmer/config/targets.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -let browsers = [ - 'last 1 Chrome versions', - 'last 1 Firefox versions', - 'last 1 Safari versions', -]; - -module.exports = { browsers }; diff --git a/frameworks/keyed/glimmer/ember-cli-build.js b/frameworks/keyed/glimmer/ember-cli-build.js deleted file mode 100644 index 6363d3a26..000000000 --- a/frameworks/keyed/glimmer/ember-cli-build.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -const GlimmerApp = require('@glimmer/application-pipeline').GlimmerApp; - -module.exports = function(defaults) { - let app = new GlimmerApp(defaults, { - // Add options here - }); - - return app.toTree(); -}; diff --git a/frameworks/keyed/glimmer/package.json b/frameworks/keyed/glimmer/package.json deleted file mode 100644 index 04161f96b..000000000 --- a/frameworks/keyed/glimmer/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "glimmer", - "version": "0.0.0", - "description": "A brand new Glimmer app.", - "directories": { - "doc": "doc", - "test": "tests" - }, - "js-framework-benchmark": { - "frameworkVersionFromPackage": "@glimmer/application", - "customURL": "/dist" - }, - "scripts": { - "build": "ember build -prod", - "start": "ember server", - "test": "ember test", - "lint:ts": "tslint -c tslint.json 'src/**/*.ts' -t codeFrame", - "build-dev": "ember build", - "build-prod": "ember build --environment=production" - }, - "devDependencies": { - "@glimmer/application": "^0.14.0-alpha.8", - "@glimmer/application-pipeline": "^0.15.0", - "@glimmer/blueprint": "^0.14.0-alpha.8", - "@glimmer/component": "^0.14.0-alpha.8", - "@glimmer/inline-precompile": "^1.0.0", - "@glimmer/resolver": "^0.4.1", - "@glimmer/test-helpers": "^0.31.1", - "@types/qunit": "^2.0.31", - "broccoli-asset-rev": "^2.5.0", - "ember-cli": "^3.9.0", - "ember-cli-dependency-checker": "^2.0.1", - "ember-cli-inject-live-reload": "^1.6.1", - "tslint": "5.11.0", - "ember-template-lint": "^1.0.0-beta.6", - "ember-hbs-minifier": "^0.4.0", - "ember-cli-uglify": "^3.0.0", - "qunitjs": "^2.3.3", - "typescript": "~3.2.1" - }, - "engines": { - "node": ">= 4.0" - }, - "private": true -} diff --git a/frameworks/keyed/glimmer/public/robots.txt b/frameworks/keyed/glimmer/public/robots.txt deleted file mode 100644 index f5916452e..000000000 --- a/frameworks/keyed/glimmer/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# http://www.robotstxt.org -User-agent: * -Disallow: diff --git a/frameworks/keyed/glimmer/src/index.ts b/frameworks/keyed/glimmer/src/index.ts deleted file mode 100644 index 5f57587fc..000000000 --- a/frameworks/keyed/glimmer/src/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentManager } from '@glimmer/component'; -import { setPropertyDidChange } from '@glimmer/tracking'; -import App from './main'; - -const app = new App(); -const containerElement = document.getElementById('app'); - -setPropertyDidChange(() => { - app.scheduleRerender(); -}); - -app.registerInitializer({ - initialize(registry) { - registry.register( - `component-manager:/${app.rootName}/component-managers/main`, - ComponentManager - ); - }, -}); - -app.renderComponent('Glimmer', containerElement, null); - -app.boot(); diff --git a/frameworks/keyed/glimmer/src/main.ts b/frameworks/keyed/glimmer/src/main.ts deleted file mode 100644 index a5ab60b77..000000000 --- a/frameworks/keyed/glimmer/src/main.ts +++ /dev/null @@ -1,20 +0,0 @@ -import Application, { DOMBuilder, RuntimeCompilerLoader, SyncRenderer } from '@glimmer/application'; -import Resolver, { BasicModuleRegistry } from '@glimmer/resolver'; -import moduleMap from '../config/module-map'; -import resolverConfiguration from '../config/resolver-configuration'; - -export default class App extends Application { - constructor() { - let moduleRegistry = new BasicModuleRegistry(moduleMap); - let resolver = new Resolver(resolverConfiguration, moduleRegistry); - const element = document.body; - - super({ - builder: new DOMBuilder({ element, nextSibling: null }), - loader: new RuntimeCompilerLoader(), - renderer: new SyncRenderer(), - resolver, - rootName: resolverConfiguration.app.rootName - }); - } -} diff --git a/frameworks/keyed/glimmer/src/ui/components/BsButton/template.hbs b/frameworks/keyed/glimmer/src/ui/components/BsButton/template.hbs deleted file mode 100644 index 042fac75b..000000000 --- a/frameworks/keyed/glimmer/src/ui/components/BsButton/template.hbs +++ /dev/null @@ -1,8 +0,0 @@ - \ No newline at end of file diff --git a/frameworks/keyed/glimmer/src/ui/components/Glimmer/component-test.ts b/frameworks/keyed/glimmer/src/ui/components/Glimmer/component-test.ts deleted file mode 100644 index 9c34194eb..000000000 --- a/frameworks/keyed/glimmer/src/ui/components/Glimmer/component-test.ts +++ /dev/null @@ -1,13 +0,0 @@ -import hbs from '@glimmer/inline-precompile'; -import { setupRenderingTest } from '@glimmer/test-helpers'; - -const { module, test } = QUnit; - -module('Component: Glimmer', function(hooks) { - setupRenderingTest(hooks); - - test('it renders', async function(assert) { - await this.render(hbs``); - assert.equal(this.containerElement.textContent, 'Welcome to Glimmer!\n'); - }); -}); diff --git a/frameworks/keyed/glimmer/src/ui/components/Glimmer/component.ts b/frameworks/keyed/glimmer/src/ui/components/Glimmer/component.ts deleted file mode 100644 index c5fd47f6c..000000000 --- a/frameworks/keyed/glimmer/src/ui/components/Glimmer/component.ts +++ /dev/null @@ -1,93 +0,0 @@ -import Component, { tracked } from "@glimmer/component"; -import { - add, - deleteRow, - run, - runLots, - swapRows, - update -} from "./../../../utils/benchmark-helpers"; - -function isRendering(ctx) { - if (ctx.__owner__._rendering || ctx.__owner__._scheduled) { - return true; - } - return false; -} - -export default class Glimmer extends Component { - @tracked public id = 1; - @tracked public data = []; - - public create() { - if (isRendering(this)) { - return; - } - const result = run(this.id); - this.data = result.data; - this.id = result.id; - } - - public add() { - if (isRendering(this)) { - return; - } - this.data = add(this.id, this.data).data; - } - - public update() { - if (isRendering(this)) { - return; - } - update(this.data); - } - public runLots() { - if (isRendering(this)) { - return; - } - const result = runLots(this.id); - this.data = result.data; - this.id = result.id; - this.resetSelection(); - } - - public clear() { - this.data = []; - } - - public swapRows() { - if (isRendering(this)) { - return; - } - this.data = swapRows(this.data); - } - - public remove(id) { - if (isRendering(this)) { - return; - } - this.data = deleteRow(this.data, id); - this.resetSelection(); - } - - public select(id) { - if (isRendering(this)) { - return; - } - this.data.forEach(item => { - if (item.id === id) { - item.selected = true; - } else if (item.selected) { - item.selected = false; - } - }); - } - - private resetSelection() { - this.data.forEach(item => { - if (item.selected) { - item.selected = false; - } - }); - } -} diff --git a/frameworks/keyed/glimmer/src/ui/components/Glimmer/template.hbs b/frameworks/keyed/glimmer/src/ui/components/Glimmer/template.hbs deleted file mode 100644 index 0e1d9a90e..000000000 --- a/frameworks/keyed/glimmer/src/ui/components/Glimmer/template.hbs +++ /dev/null @@ -1,53 +0,0 @@ -
-
-
-
-

Glimmer v0.14.0

-
-
-
-
- - Create 1,000 rows - -
-
- - Create 10,000 rows - -
-
- - Append 1,000 rows - -
-
- - Update every 10th row - -
-
- - Clear - -
-
- - Swap Rows - -
-
-
-
-
- - - - - - - \ No newline at end of file diff --git a/frameworks/keyed/glimmer/src/ui/components/PerformantEach/component.ts b/frameworks/keyed/glimmer/src/ui/components/PerformantEach/component.ts deleted file mode 100644 index 4a53d492c..000000000 --- a/frameworks/keyed/glimmer/src/ui/components/PerformantEach/component.ts +++ /dev/null @@ -1,16 +0,0 @@ -import Component from '@glimmer/component'; - -export default class PerformantEach extends Component { - public fragment: any = null; - constructor() { - super(...arguments); - this.fragment = document.createElement('tbody'); - } - get appendNode() { - const item = document.getElementById('items-list'); - if (!item.contains(this.fragment)) { - item.append(this.fragment); - } - return ''; - } -} \ No newline at end of file diff --git a/frameworks/keyed/glimmer/src/ui/components/PerformantEach/template.hbs b/frameworks/keyed/glimmer/src/ui/components/PerformantEach/template.hbs deleted file mode 100644 index e851a5cae..000000000 --- a/frameworks/keyed/glimmer/src/ui/components/PerformantEach/template.hbs +++ /dev/null @@ -1,4 +0,0 @@ -{{#in-element this.fragment}} - {{#each @items key="id" as |item|}}{{/each}} - {{this.appendNode}} -{{/in-element}} diff --git a/frameworks/keyed/glimmer/src/ui/components/Table/template.hbs b/frameworks/keyed/glimmer/src/ui/components/Table/template.hbs deleted file mode 100644 index 12f478acd..000000000 --- a/frameworks/keyed/glimmer/src/ui/components/Table/template.hbs +++ /dev/null @@ -1,6 +0,0 @@ -{{! template-lint-disable }} -
{{item.id}}{{item.label}}
- {{#if @data.length}} - - {{/if}} -
diff --git a/frameworks/keyed/glimmer/src/ui/index.html b/frameworks/keyed/glimmer/src/ui/index.html deleted file mode 100644 index 84e5f780b..000000000 --- a/frameworks/keyed/glimmer/src/ui/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - Glimmer 0.14 - - - - {{content-for "head"}} - - - - {{content-for "head-footer"}} - - - {{content-for "body"}} - -
- - - {{content-for "body-footer"}} - - diff --git a/frameworks/keyed/glimmer/src/ui/styles/app.css b/frameworks/keyed/glimmer/src/ui/styles/app.css deleted file mode 100644 index c6afad22c..000000000 --- a/frameworks/keyed/glimmer/src/ui/styles/app.css +++ /dev/null @@ -1,3 +0,0 @@ -h1 { - color: #444; -} diff --git a/frameworks/keyed/glimmer/src/utils/benchmark-helpers.ts b/frameworks/keyed/glimmer/src/utils/benchmark-helpers.ts deleted file mode 100644 index b8455eb25..000000000 --- a/frameworks/keyed/glimmer/src/utils/benchmark-helpers.ts +++ /dev/null @@ -1,92 +0,0 @@ -import { tracked } from '@glimmer/component'; - -class Item { - public id; - @tracked - public label = ''; - @tracked - public selected = false; - constructor({id, label, selected}) { - this.id = id; - this.label = label; - this.selected = selected; - } -} - -// tslint:disable-next-line: variable-name -const _random = (max) => { - return Math.round(Math.random() * 1000) % max; -}; - -const updateData = (data, mod = 10) => { - for (let i = 0; i < data.length; i += mod) { - data[i].label = data[i].label + ' !!!'; - } -}; - -export const buildData = (id, count = 1000) => { - const adjectives = [ - 'pretty', 'large', 'big', 'small', 'tall', - 'short', 'long', 'handsome', 'plain', 'quaint', - 'clean', 'elegant', 'easy', 'angry', 'crazy', - 'helpful', 'mushy', 'odd', 'unsightly', 'adorable', - 'important', 'inexpensive', 'cheap', 'expensive', 'fancy']; - - let colours = [ - 'red', 'yellow', 'blue', 'green', 'pink', 'brown', 'purple', - 'brown', 'white', 'black', 'orange']; - - let nouns = [ - 'table', 'chair', 'house', 'bbq', 'desk', 'car', 'pony', 'cookie', - 'sandwich', 'burger', 'pizza', 'mouse', 'keyboard']; - - let data = []; - - for (let i = 0; i < count; i++) { - data.push(new Item({ - id: id++, - label: adjectives[_random(adjectives.length)] - + ' ' - + colours[_random(colours.length)] - + ' ' - + nouns[_random(nouns.length)], - selected: false - })); - } - - return { data, id }; -}; - -export const add = (id, data) => { - const newData = buildData(id, 1000); - - return { data: [...data, ...newData.data], id: newData.id }; -}; - -export const run = (id) => { - return buildData(id); -}; - -export const runLots = (id) => { - return buildData(id, 10000); -}; - -export const update = (data) => { - return updateData(data); -}; - -export const swapRows = (data) => { - const newData = [...data]; - if (newData.length > 998) { - let temp = newData[1]; - newData[1] = newData[998]; - newData[998] = temp; - } - return newData; -}; - -export const deleteRow = (data, id) => { - return data.filter((d: Item) => { - return d.id !== id; - }); -}; diff --git a/frameworks/keyed/glimmer/src/utils/test-helpers/test-helper.ts b/frameworks/keyed/glimmer/src/utils/test-helpers/test-helper.ts deleted file mode 100644 index e015436aa..000000000 --- a/frameworks/keyed/glimmer/src/utils/test-helpers/test-helper.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { setApp, start } from '@glimmer/test-helpers'; -import App from '../../main'; - -QUnit.config.autostart = false; -setApp(App); -import '../../../tests'; -start(); diff --git a/frameworks/keyed/glimmer/testem.json b/frameworks/keyed/glimmer/testem.json deleted file mode 100644 index 0231f1634..000000000 --- a/frameworks/keyed/glimmer/testem.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "test_page": "tests/index.html", - "disable_watching": true, - "launch_in_ci": ["Firefox", "Chrome"] -} diff --git a/frameworks/keyed/glimmer/tests/index.html b/frameworks/keyed/glimmer/tests/index.html deleted file mode 100644 index 90bb1b573..000000000 --- a/frameworks/keyed/glimmer/tests/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - glimmer - - - - - - - - - - -
-
-
-
- - diff --git a/frameworks/keyed/glimmer/tsconfig.json b/frameworks/keyed/glimmer/tsconfig.json deleted file mode 100644 index caccd57c3..000000000 --- a/frameworks/keyed/glimmer/tsconfig.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "compilerOptions": { - "target": "es6", - "module": "es2015", - "inlineSourceMap": true, - "inlineSources": true, - "moduleResolution": "node", - "experimentalDecorators": true, - "types": [ - "qunit" - ] - }, - "exclude": [ - "node_modules", - "tmp", - "dist" - ] -} diff --git a/frameworks/keyed/glimmer/tslint.json b/frameworks/keyed/glimmer/tslint.json deleted file mode 100644 index e2b801006..000000000 --- a/frameworks/keyed/glimmer/tslint.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "defaultSeverity": "error", - "extends": [ - "tslint:recommended" - ], - "jsRules": {}, - "rules": { - "quotemark": [true, "single"], - "trailing-comma": false, - "only-arrow-functions": false, - "prefer-const": false, - "interface-name": [true, "never-prefix"] - }, - "rulesDirectory": [] -} diff --git a/frameworks/keyed/helix/.clj-kondo/config.edn b/frameworks/keyed/helix/.clj-kondo/config.edn deleted file mode 100644 index 5d961a3fe..000000000 --- a/frameworks/keyed/helix/.clj-kondo/config.edn +++ /dev/null @@ -1 +0,0 @@ -{:lint-as {helix.core/defnc clojure.core/defn}} diff --git a/frameworks/keyed/helix/.gitignore b/frameworks/keyed/helix/.gitignore deleted file mode 100644 index 9ce4f8f37..000000000 --- a/frameworks/keyed/helix/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -out -.shadow-cljs -dist -dev diff --git a/frameworks/keyed/helix/index-dev.html b/frameworks/keyed/helix/index-dev.html deleted file mode 100755 index 9ddb4fc7c..000000000 --- a/frameworks/keyed/helix/index-dev.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Helix - - - -
- - - diff --git a/frameworks/keyed/helix/index.html b/frameworks/keyed/helix/index.html deleted file mode 100755 index fa5f040c7..000000000 --- a/frameworks/keyed/helix/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Helix - - - -
- - - diff --git a/frameworks/keyed/helix/package.json b/frameworks/keyed/helix/package.json deleted file mode 100644 index f7aa8c5f8..000000000 --- a/frameworks/keyed/helix/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "private": true, - "js-framework-benchmark": { - "frameworkVersion": "0.0.10" - }, - "scripts": { - "watch": "shadow-cljs watch :app", - "build-dev": "shadow-cljs compile :app", - "build-prod": "shadow-cljs release :app" - }, - "devDependencies": { - "shadow-cljs": "2.8.100", - "ws": "^7.1.2" - }, - "dependencies": { - "react": "^16.13.1", - "react-dom": "^16.13.1", - "react-refresh": "0.8.1" - } -} diff --git a/frameworks/keyed/helix/shadow-cljs.edn b/frameworks/keyed/helix/shadow-cljs.edn deleted file mode 100644 index bcd063768..000000000 --- a/frameworks/keyed/helix/shadow-cljs.edn +++ /dev/null @@ -1,34 +0,0 @@ -{:source-paths - ["src" - "resources" - "checkouts/helix/src"] - - :dependencies [[lilactown/helix "0.0.10"] - [lucywang000/hashp "0.1.2"] - [binaryage/devtools "1.0.0"]] - - :nrepl {:port 6666 - :cider true - :init-ns user} - - :builds {:app {:target :browser - - :dev - {:output-dir - "dev" - - :asset-path - "/frameworks/keyed/helix/dev/"} - :devtools {:after-load demo.main/after-reload - - :watch-dir "resources/demo/styles" - :watch-path "/styles" - - :preloads [devtools.preload - hashp.core]} - - :release {:output-dir "dist" - :compiler-options {:optimizations :advanced - :infer-externs true}} - - :modules {:main {:init-fn demo.main/init!}}}}} diff --git a/frameworks/keyed/helix/src/demo/main.cljs b/frameworks/keyed/helix/src/demo/main.cljs deleted file mode 100644 index f55e1fc52..000000000 --- a/frameworks/keyed/helix/src/demo/main.cljs +++ /dev/null @@ -1,115 +0,0 @@ -(ns demo.main - (:require [helix.core :as hx :refer [defnc $]] - [helix.dom :as d] - [helix.hooks :as hooks :refer [use-state use-effect]] - ["react-dom" :as rdom] - [demo.utils :as u])) - -(defnc row [{:keys [data selected? on-select on-delete]}] - (d/tr {:class (if selected? "danger")} - (d/td {:class "col-md-1"} - (:id data)) - (d/td {:class "col-md-4"} - (d/a {:on-click (fn [e] (on-select (:id data)))} - (:label data))) - (d/td {:class "col-md-1"} - (d/a {:on-click (fn [e] (on-delete (:id data)))} - (d/span {:class "glyphicon glyphicon-remove" - :aria-hidden "true"}))) - (d/td {:class "col-md-6"}))) - -(defonce id-atom (atom 0)) - -(defnc main [] - (js/console.log "re-render") - (let [[data set-data] (use-state []) - [selected set-selected] (use-state nil) - run - (fn run [_] - (set-data (vec (u/build-data id-atom 1000))) - (set-selected nil)) - run-lots - (fn run-lots [_] - (set-data (vec (u/build-data id-atom 10000))) - (set-selected nil)) - add - (fn add [_] - (set-data u/add id-atom)) - update-some - (fn update-some [] - (set-data u/update-some)) - clear - (fn clear [] - (set-selected nil) - (set-data [])) - swap-rows - (fn swap-rows [] - (set-data u/swap-rows)) - select - (fn select [id] - (set-selected id)) - delete - (fn delete [id] - (set-data u/delete-row id))] - (d/div - {:class "container"} - (d/div - {:class "jumbotron"} - (d/div - {:class "row"} - (d/div {:class "col-md-6"} - (d/h1 (str "Helix"))) - (d/div {:class "col-md-6"} - (d/div {:class "row"} - (d/div {:class "col-sm-6 smallpad"} - (d/button {:class " btn btn-primary btn-block" - :type "button" - :id "run" - :on-click run} - "Create 1,000 rows")) - (d/div {:class "col-sm-6 smallpad"} - (d/button {:class "btn btn-primary btn-block" - :type "button" - :id "runlots" - :on-click run-lots} - "Create 10,000 rows")) - (d/div {:class "col-sm-6 smallpad"} - (d/button {:class "btn btn-primary btn-block" - :type "button" - :id "add" - :on-click add} - "Append 1,000 rows")) - (d/div {:class "col-sm-6 smallpad"} - (d/button {:class " btn btn-primary btn-block" - :type "button" - :id "update" - :on-click update-some} - "Update every 10th row")) - (d/div {:class "col-sm-6 smallpad"} - (d/button {:class "btn btn-primary btn-block" - :type "button" - :id "clear" - :on-click clear} - "Clear")) - (d/div {:class "col-sm-6 smallpad"} - (d/button {:class "btn btn-primary btn-block" - :type "button" - :id "swaprows" - :on-click swap-rows} - "Swap rows")))))) - (d/table {:class "table table-hover table-striped test-data"} - (d/tbody - (for [{:keys [id] :as d} data] - ($ row {:key id - :data d - :selected? (identical? id selected) - :on-select select - :on-delete delete})))) - (d/span {:class "preloadicon glyphicon glyphicon-remove" - :aria-hidden "true"})))) - -(defn init! [] - (rdom/render ($ main) (.getElementById js/document. "main"))) - -(defn after-reload [] - (init!)) diff --git a/frameworks/keyed/helix/src/demo/utils.cljs b/frameworks/keyed/helix/src/demo/utils.cljs deleted file mode 100644 index 5d7ae53d0..000000000 --- a/frameworks/keyed/helix/src/demo/utils.cljs +++ /dev/null @@ -1,31 +0,0 @@ -(ns demo.utils) - -(def adjectives ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy"]) -(def colours ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"]) -(def nouns ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"]) - -(defrecord Data [id label]) - -(defn build-data [id-atom count] - (repeatedly count (fn [] - (->Data (swap! id-atom inc) (str (rand-nth adjectives) " " (rand-nth colours) " " (rand-nth nouns)))))) - -(defn add [data id-atom] - (into data (build-data id-atom 1000))) - -(defn update-some [data] - (reduce (fn [data index] - (let [row (get data index)] - (assoc data index (assoc row :label (str (:label row) " !!!"))))) - data - (range 0 (count data) 10))) - -(defn swap-rows [data] - (if (> (count data) 998) - (-> data - (assoc 1 (get data 998)) - (assoc 998 (get data 1))) - data)) - -(defn delete-row [data id] - (vec (remove #(identical? id (:id %)) data))) diff --git a/frameworks/keyed/heresy/index.html b/frameworks/keyed/heresy/index.html deleted file mode 100644 index 0d3f58391..000000000 --- a/frameworks/keyed/heresy/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - -heresy keyed - -
- diff --git a/frameworks/keyed/heresy/package.json b/frameworks/keyed/heresy/package.json deleted file mode 100644 index 993d5ffe8..000000000 --- a/frameworks/keyed/heresy/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "js-framework-benchmark-heresy", - "version": "1.0.0", - "description": "heresy demo", - "main": "index.js", - "js-framework-benchmark": { - "frameworkVersionFromPackage": "heresy" - }, - "scripts": { - "build-dev": "rollup -c -w", - "build-prod": "rollup -c" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/krausest/js-framework-benchmark.git" - }, - "keywords": [ - "heresy" - ], - "author": "Mathis Zeiher", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/krausest/js-framework-benchmark/issues" - }, - "homepage": "https://github.com/krausest/js-framework-benchmark#readme", - "dependencies": { - "heresy": "0.26.1", - "js-framework-benchmark-utils": "0.2.5" - }, - "devDependencies": { - "@ungap/degap": "^0.1.7", - "rollup": "^2.0.6", - "rollup-plugin-includepaths": "^0.2.3", - "rollup-plugin-minify-html-literals": "^1.2.3", - "rollup-plugin-node-resolve": "^5.2.0", - "rollup-plugin-terser": "^5.3.0" - } -} diff --git a/frameworks/keyed/heresy/rollup.config.js b/frameworks/keyed/heresy/rollup.config.js deleted file mode 100644 index e21a311c7..000000000 --- a/frameworks/keyed/heresy/rollup.config.js +++ /dev/null @@ -1,39 +0,0 @@ -import resolve from 'rollup-plugin-node-resolve'; -import includePaths from 'rollup-plugin-includepaths'; -import minifyHTML from 'rollup-plugin-minify-html-literals'; -import { terser } from 'rollup-plugin-terser'; - -export default { - input: 'src/index.js', - plugins: [ - minifyHTML({ - options: { - minifyOptions: { - keepClosingSlash: true - } - } - }), - includePaths({ - include: { - "@ungap/create-content": "./node_modules/@ungap/degap/create-content.js", - "@ungap/template-tag-arguments": "./node_modules/@ungap/degap/template-tag-arguments.js", - "@ungap/template-literal": "./node_modules/@ungap/degap/template-literal.js", - "@ungap/weakmap": "./node_modules/@ungap/degap/weakmap.js", - "@ungap/weakset": "./node_modules/@ungap/degap/weakset.js", - "@ungap/event": "./node_modules/@ungap/degap/event.js", - "@ungap/essential-map": "./node_modules/@ungap/degap/essential-map.js", - "@ungap/import-node": "./node_modules/@ungap/degap/import-node.js", - "@ungap/trim": "./node_modules/@ungap/degap/trim.js" - }, - }), - resolve(), - terser() - ], - context: 'null', - moduleContext: 'null', - output: { - file: 'dist/index.js', - format: 'iife', - name: 'app' - } -}; diff --git a/frameworks/keyed/heresy/src/index.js b/frameworks/keyed/heresy/src/index.js deleted file mode 100644 index 8b46a3bcb..000000000 --- a/frameworks/keyed/heresy/src/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import {State} from 'js-framework-benchmark-utils'; -import {define, html, render} from 'heresy'; - -import App from './ui/app.js'; -define('App', App); - -const state = State(update); -const main = document.getElementById('container'); - -update(state); - -function update(state) { - render(main, html``); -} diff --git a/frameworks/keyed/heresy/src/ui/app.js b/frameworks/keyed/heresy/src/ui/app.js deleted file mode 100644 index 2ffdaa2bb..000000000 --- a/frameworks/keyed/heresy/src/ui/app.js +++ /dev/null @@ -1,53 +0,0 @@ -import {html} from 'heresy'; - -import Button from './button.js'; -import Row from './row.js'; - -export default { - extends: 'div', - includes: {Button, Row}, - mappedAttributes: ['state'], - oninit() { - this.classList.add('container'); - }, - onstate() { - this.render(); - }, - onclick({target}) { - const a = target.closest('a'); - const {action} = a.dataset; - this.state[action](+a.closest('tr').id); - }, - render() { - const { - data, selected, - run, runLots, add, update, clear, swapRows - } = this.state; - this.html` -
-
-
-

heresy keyed

-
-
-
-
-
-
-
- - - ${data.map(({id, label}) => html.for(data, id)` - - `)} - -
-