- The benchmark was run on a HP Z440 (3.5 GHz Intel Xeon E5-1650 v3, 32 GB RAM, Windows 10 1709, Chrome 64.0.3282.186 (64-bit))
- Ran
npm run selenium -- --count 10 --framework preactin thewebdriver-tsof this js-framework-benchmarks fork
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Copyright 2018 Google Inc. All Rights Reserved. | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * Unless required by applicable law or agreed to in writing, software | |
| * distributed under the License is distributed on an "AS IS" BASIS, | |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| * See the License for the specific language governing permissions and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { canRoute, customHistory, routeTo } from './preact-router.local'; | |
| import { appRegistry, eventsService } from '../../../services/service-manager'; | |
| /** | |
| * Local setURL function overwrite from preact-router | |
| * | |
| * @param {string} url url, applied to router | |
| * @param {string} type optional operation name, default = push | |
| * @param {{ realURL: string, displayURL: string }} newState state object | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Copyright 2018 Google LLC | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
| * use this file except in compliance with the License. You may obtain a copy of | |
| * the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { watch as watchOnline } from 'is-offline'; | |
| import Sockette from 'sockette'; | |
| const msg_types = { | |
| GQL_CONNECTION_INIT: 'connection_init', // Client -> Server | |
| GQL_CONNECTION_ACK: 'connection_ack', // Server -> Client | |
| GQL_CONNECTION_ERROR: 'connection_error', // Server -> Client | |
| GQL_CONNECTION_TERMINATE: 'connection_terminate', // Client -> Server | |
| GQL_START: 'start', // Client -> Server | |
| GQL_DATA: 'data', // Server -> Client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Expected Queueing Time | |
| // https://docs.google.com/document/d/1Vgu7-R84Ym3lbfTRi98vpdspRr1UwORB4UV-p9K1FF0/edit | |
| // Initial impl by Nicolás Peña (npm), Tim Dresser (tdresser) | |
| // Usage: | |
| // var eqt = EQT.begin(); | |
| // // ... | |
| // const {expectedQueueingTime} = EQT.end(); | |
| class EQT { | |
| constructor() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Handles multithread processing on an array through promise-ified Web Workers | |
| * (through workerize-loader https://github.com/developit/workerize-loader) | |
| * | |
| * @example | |
| * const piranhas = new Piranhas( | |
| * Worker, | |
| * // Listens for messages from workers | |
| * e => { e.data.type === 'INCREMENT' && someIncrementer() } | |
| * ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <script src="./clooney.min.js"></script> | |
| <script> | |
| !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.greenlet=n()}(this,function(){return function(e){var n=new Worker(URL.createObjectURL(new Blob(["onmessage=("+function(e){return function(n){var t=n.data;return Promise.resolve().then(function(){return e.apply(e,t[1])}).then(function(e){postMessage([t[0],null,e])},function(e){postMessage([t[0],""+e])})}}+")("+e+")"]))),t=0,o={};return n.onmessage=function(e){var n=e.data,t=n[0],r=n[1];o[t][r?1:0](r||n[2]),delete o[t]},function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new Promise(function(r,u){o[++t]=[r,u],n.postMessage([t,e])})}}}); | |
| //# sourceMappingURL=greenlet.umd.js.map | |
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component } from 'preact'; | |
| import Snackbar from 'preact-material-components/Snackbar'; | |
| const TIMEOUT = 3; | |
| export default class Toaster extends Component { | |
| seen = []; | |
| queue = []; | |
| snackbarRef = c => { |
So, you need to transpile classes to ES5 for some reason, but you need to do it in the browser.
Could we use a gross regular expression to get that done? Yes.
Should we? No, but it's far too late for that now.