author
int64
4.98k
943k
date
stringdate
2017-04-15 16:45:02
2022-02-25 15:32:15
timezone
int64
-46,800
39.6k
hash
stringlengths
40
40
message
stringlengths
8
468
mods
listlengths
1
16
language
stringclasses
9 values
license
stringclasses
2 values
repo
stringclasses
119 values
original_message
stringlengths
12
491
is_CCS
int64
1
1
commit_type
stringclasses
129 values
commit_scope
stringlengths
1
44
217,922
23.04.2018 21:24:13
-7,200
e0128842a06402eeb3c57f6584753445ac4c84bc
fix(wiki): links for external tools weren't working properly
[ { "change_type": "MODIFY", "diff": "@@ -48,8 +48,8 @@ export class WikiComponent implements OnInit {\n}\ninterceptLinks(event: MouseEvent): void {\n- if (event.srcElement.tagName === 'A' && (event.srcElement.baseURI.indexOf('ffxivteamcraft.com') > -1 ||\n- event.srcElement.baseURI.indexOf('localhost') > -1)) {\n+ if (event.srcElement.tagName === 'A' && ((<any>event.srcElement).href.indexOf('ffxivteamcraft.com') > -1 ||\n+ (<any>event.srcElement).href.indexOf('localhost') > -1)) {\n// If that's an anchor, intercept the click and handle it properly with router\nevent.preventDefault();\nthis.router.navigateByUrl((<HTMLAnchorElement>event.srcElement).pathname);\n", "new_path": "src/app/pages/wiki/wiki/wiki.component.ts", "old_path": "src/app/pages/wiki/wiki/wiki.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix(wiki): links for external tools weren't working properly
1
fix
wiki
217,922
23.04.2018 21:24:44
-7,200
8cfc190c2f3ecb916786e03976749d8d527c93be
chore(wiki): grammar mistake fix
[ { "change_type": "MODIFY", "diff": "@@ -25,7 +25,7 @@ First of all, come on [Discord] and poke @Miu to tell him that you would like to\n## Without github\n- 1. Create a file using one of the editors linked below.\n+ 1. Create a file using one of the editors linked above.\n2. Send me the file on discord.\n## Credits\n", "new_path": "src/assets/wiki/en/contributing.md", "old_path": "src/assets/wiki/en/contributing.md" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore(wiki): grammar mistake fix
1
chore
wiki
730,412
23.04.2018 21:25:11
0
697433e647e74cbb5a8aa4692c656b7866931dd5
chore(release): 0.1.278
[ { "change_type": "MODIFY", "diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.1.278\"></a>\n+## [0.1.278](https://github.com/webex/react-ciscospark/compare/v0.1.277...v0.1.278) (2018-04-23)\n+\n+\n+\n<a name=\"0.1.277\"></a>\n## [0.1.277](https://github.com/ciscospark/react-ciscospark/compare/v0.1.276...v0.1.277) (2018-04-20)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@ciscospark/react-ciscospark\",\n- \"version\": \"0.1.277\",\n+ \"version\": \"0.1.278\",\n\"description\": \"The Cisco Spark for React library allows developers to easily incorporate Spark functionality into an application.\",\n\"scripts\": {\n\"build\": \"./scripts/build/index.js\",\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
MIT License
webex/react-widgets
chore(release): 0.1.278
1
chore
release
217,922
23.04.2018 21:31:50
-7,200
4ff8397b815e81fa69fb7ea3a8ee3aca26ebd97d
fix: inventory view was broken
[ { "change_type": "MODIFY", "diff": "@@ -20,7 +20,9 @@ export class LocalizedDataService {\npublic getItem(id: number): I18nName {\nconst row = this.getRow(items, id);\n+ if (row !== undefined) {\nrow.fr = row.fr.replace(this.indentRegexp, '');\n+ }\nreturn row;\n}\n", "new_path": "src/app/core/data/localized-data.service.ts", "old_path": "src/app/core/data/localized-data.service.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: inventory view was broken
1
fix
null
730,413
24.04.2018 11:11:29
14,400
4eff3e2f88da6c5fe1a8e897302b8cacebbc3351
chore(journeys): use a fresh session for each subset of tests
[ { "change_type": "MODIFY", "diff": "\"react-transform-hmr\": \"^1.0.4\",\n\"redux-mock-store\": \"^1.2.1\",\n\"rimraf\": \"^2.5.4\",\n+ \"saucelabs\": \"^1.4.0\",\n\"semver\": \"^5.4.1\",\n\"sleep-ms\": \"^2.0.1\",\n\"sri-toolbox\": \"^0.2.0\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "MODIFY", "diff": "import uuid from 'uuid';\n+import SauceLabs from 'saucelabs';\n/**\n* Move mouse a specified amount of pixels\n@@ -10,7 +11,6 @@ import uuid from 'uuid';\n* @param {integer} [offsetY=0]\n* @returns {void}\n*/\n-// eslint-disable-next-line import/prefer-default-export\nexport function moveMouse(aBrowser, selector) {\nif (aBrowser.desiredCapabilities.browserName.toLowerCase().includes('firefox')) {\n// Find center point of element\n@@ -36,3 +36,25 @@ export function moveMouse(aBrowser, selector) {\naBrowser.moveToObject(selector);\n}\n}\n+\n+/**\n+ * Reload each active sauce session to a fresh session\n+ * and name session according to suite\n+ * @param {string} name\n+ * @returns {void}\n+ */\n+export function renameSession(name) {\n+ const browserName = process.env.BROWSER || 'chrome';\n+ const platform = process.env.PLATFORM || 'mac 10.12';\n+ if (process.env.SAUCE && process.env.INTEGRATION) {\n+ const account = new SauceLabs({\n+ username: process.env.SAUCE_USERNAME,\n+ password: process.env.SAUCE_ACCESS_KEY\n+ });\n+ account.getJobs((err, jobs) => {\n+ const widgetJobs = jobs.filter((job) => job.name === 'react-widget-integration' && job.consolidated_status === 'in progress'\n+ && job.os.toLowerCase().includes(platform) && job.browser.toLowerCase().includes(browserName));\n+ widgetJobs.forEach((job) => account.updateJob(job.id, {name}));\n+ });\n+ }\n+}\n", "new_path": "test/journeys/lib/test-helpers/index.js", "old_path": "test/journeys/lib/test-helpers/index.js" }, { "change_type": "MODIFY", "diff": "@@ -7,7 +7,7 @@ import CiscoSpark from '@ciscospark/spark-core';\nimport testUsers from '@ciscospark/test-helper-test-users';\nimport waitForPromise from '../../lib/wait-for-promise';\n-import {moveMouse} from '../../lib/test-helpers';\n+import {moveMouse, renameSession} from '../../lib/test-helpers';\nimport {elements as spaceElements} from '../../lib/test-helpers/space-widget/main';\nimport {sendMessage, verifyMessageReceipt} from '../../lib/test-helpers/space-widget/messaging';\n@@ -25,6 +25,10 @@ describe('Multiple Widgets', () => {\nlet conversation, oneOnOneConversation;\nlet local, remote;\n+ before('start new sauce session', () => {\n+ renameSession('react-widget-multiple');\n+ });\n+\nbefore('load browser', () => {\nbrowser.url('/multiple.html');\n});\n", "new_path": "test/journeys/specs/multiple/index.js", "old_path": "test/journeys/specs/multiple/index.js" }, { "change_type": "MODIFY", "diff": "@@ -11,6 +11,7 @@ import {\nFEATURE_FLAG_ROSTER\n} from '../../../lib/test-helpers/space-widget/roster';\nimport {elements, openMenuAndClickButton} from '../../../lib/test-helpers/space-widget/main';\n+import {renameSession} from '../../../lib/test-helpers';\ndescribe('Widget Space: One on One: Data API', () => {\nconst browserLocal = browser.select('browserLocal');\n@@ -19,6 +20,11 @@ describe('Widget Space: One on One: Data API', () => {\nconst mccoyName = 'Bones Mccoy';\nconst spockName = 'Mr Spock';\n+ before('start new sauce session', () => {\n+ browser.reload();\n+ renameSession('react-widget-oneOnOne-dataApi');\n+ });\n+\nbefore('load browsers', () => {\nbrowser.url('/data-api/space.html');\n});\n", "new_path": "test/journeys/specs/oneOnOne/dataApi/basic.js", "old_path": "test/journeys/specs/oneOnOne/dataApi/basic.js" }, { "change_type": "MODIFY", "diff": "@@ -4,6 +4,7 @@ import '@ciscospark/plugin-logger';\nimport CiscoSpark from '@ciscospark/spark-core';\nimport testUsers from '@ciscospark/test-helper-test-users';\n+import {renameSession} from '../../../lib/test-helpers';\nimport {elements as rosterElements, hasParticipants, FEATURE_FLAG_ROSTER} from '../../../lib/test-helpers/space-widget/roster';\nimport {runAxe} from '../../../lib/axe';\nimport {elements, openMenuAndClickButton} from '../../../lib/test-helpers/space-widget/main';\n@@ -15,6 +16,11 @@ describe('Widget Space: One on One', () => {\nconst mccoyName = 'Bones Mccoy';\nconst spockName = 'Mr Spock';\n+ before('start new sauce session', () => {\n+ browser.reload();\n+ renameSession('react-widget-oneOnOne-global');\n+ });\n+\nbefore('load browsers', () => {\nbrowserLocal.url('/space.html?basic');\n});\n", "new_path": "test/journeys/specs/oneOnOne/global/basic.js", "old_path": "test/journeys/specs/oneOnOne/global/basic.js" }, { "change_type": "MODIFY", "diff": "@@ -6,7 +6,7 @@ import '@ciscospark/internal-plugin-conversation';\nimport '@ciscospark/internal-plugin-feature';\nimport CiscoSpark from '@ciscospark/spark-core';\n-import {moveMouse} from '../../../lib/test-helpers';\n+import {moveMouse, renameSession} from '../../../lib/test-helpers';\nimport {FEATURE_FLAG_GROUP_CALLING, elements as meetElements, hangup} from '../../../lib/test-helpers/space-widget/meet';\nimport {\ncreateSpaceAndPost,\n@@ -22,6 +22,12 @@ describe('Widget Recents: Data API', () => {\nlet docbrown, lorraine, marty;\nlet conversation, oneOnOneConversation;\n+ before('start new sauce session', () => {\n+ browser.reload();\n+ renameSession('react-widget-recents-dataApi');\n+ });\n+\n+\nbefore('load browser', () => {\nbrowserLocal.url('/data-api/recents.html');\n});\n", "new_path": "test/journeys/specs/recents/dataApi/basic.js", "old_path": "test/journeys/specs/recents/dataApi/basic.js" }, { "change_type": "MODIFY", "diff": "@@ -10,7 +10,7 @@ import waitForPromise from '../../../lib/wait-for-promise';\nimport {runAxe} from '../../../lib/axe';\nimport {clearEventLog, getEventLog} from '../../../lib/events';\n-import {moveMouse} from '../../../lib/test-helpers';\n+import {moveMouse, renameSession} from '../../../lib/test-helpers';\nimport {FEATURE_FLAG_GROUP_CALLING, elements as meetElements, hangup} from '../../../lib/test-helpers/space-widget/meet';\nimport {\ncreateSpaceAndPost,\n@@ -26,6 +26,11 @@ describe('Widget Recents', () => {\nlet docbrown, lorraine, marty;\nlet conversation, oneOnOneConversation;\n+ before('start new sauce session', () => {\n+ browser.reload();\n+ renameSession('react-widget-recents-global');\n+ });\n+\nbefore('load browser for recents widget', () => {\nbrowserLocal.url('/recents.html');\n});\n", "new_path": "test/journeys/specs/recents/global/basic.js", "old_path": "test/journeys/specs/recents/global/basic.js" }, { "change_type": "MODIFY", "diff": "@@ -5,6 +5,7 @@ import '@ciscospark/plugin-logger';\nimport CiscoSpark from '@ciscospark/spark-core';\nimport '@ciscospark/internal-plugin-conversation';\n+import {renameSession} from '../../../lib/test-helpers';\nimport {elements, openMenuAndClickButton} from '../../../lib/test-helpers/space-widget/main';\nimport {\nelements as rosterElements,\n@@ -19,6 +20,11 @@ describe('Widget Space: Data API', () => {\nlet biff, docbrown, lorraine, marty;\nlet conversation;\n+ before('start new sauce session', () => {\n+ browser.reload();\n+ renameSession('react-widget-space-dataApi');\n+ });\n+\nbefore('load browsers', () => {\nbrowser.url('/data-api/space.html');\n});\n", "new_path": "test/journeys/specs/space/dataApi/basic.js", "old_path": "test/journeys/specs/space/dataApi/basic.js" }, { "change_type": "MODIFY", "diff": "@@ -5,6 +5,7 @@ import '@ciscospark/plugin-logger';\nimport CiscoSpark from '@ciscospark/spark-core';\nimport '@ciscospark/internal-plugin-conversation';\n+import {renameSession} from '../../../lib/test-helpers';\nimport {runAxe} from '../../../lib/axe';\nimport {\nelements as rosterElements,\n@@ -20,6 +21,11 @@ describe('Widget Space', () => {\nlet biff, docbrown, lorraine, marty;\nlet conversation;\n+ before('start new sauce session', () => {\n+ browser.reload();\n+ renameSession('react-widget-space-global');\n+ });\n+\nbefore('load browsers', () => {\nbrowser.url('/space.html');\n});\n", "new_path": "test/journeys/specs/space/global/basic.js", "old_path": "test/journeys/specs/space/global/basic.js" } ]
JavaScript
MIT License
webex/react-widgets
chore(journeys): use a fresh session for each subset of tests
1
chore
journeys
679,913
24.04.2018 11:19:06
-3,600
33f55b3e18df62cb43a153a258aee3328c52d18e
feat(rstream): add owner meta data & IDs for merge/sync inputs
[ { "change_type": "MODIFY", "diff": "@@ -36,7 +36,8 @@ export class StreamMerge<A, B> extends Subscription<A, B> {\nthis.ensureState();\nthis.sources.set(\nsrc,\n- src.subscribe({\n+ src.subscribe(\n+ {\nnext: (x) => {\nif (x instanceof Subscription) {\nthis.add(x);\n@@ -44,8 +45,12 @@ export class StreamMerge<A, B> extends Subscription<A, B> {\nthis.next(x);\n}\n},\n- done: () => this.markDone(src)\n- }));\n+ done: () => this.markDone(src),\n+ __owner: this\n+ },\n+ `in-${src.id}`\n+ )\n+ );\n}\naddAll(src: ISubscribable<A>[]) {\n", "new_path": "packages/rstream/src/stream-merge.ts", "old_path": "packages/rstream/src/stream-merge.ts" }, { "change_type": "MODIFY", "diff": "@@ -88,15 +88,17 @@ export class StreamSync<A, B> extends Subscription<A, B> {\nsrc.subscribe(\n{\nnext: (x) => {\n- if (x instanceof Subscription) {\n- this.add(x);\n+ if (x[1] instanceof Subscription) {\n+ this.add(x[1]);\n} else {\nthis.next(x);\n}\n},\n- done: () => this.markDone(src)\n+ done: () => this.markDone(src),\n+ __owner: this\n},\n- labeled<string, A>(src.id)\n+ labeled<string, A>(src.id),\n+ `in-${src.id}`\n)\n);\n}\n", "new_path": "packages/rstream/src/stream-sync.ts", "old_path": "packages/rstream/src/stream-sync.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(rstream): add owner meta data & IDs for merge/sync inputs
1
feat
rstream
679,913
24.04.2018 11:21:04
-3,600
e72478abc2565ab3d974ba739f7fce029ef6cc84
feat(rstream-dot): initial import package
[ { "change_type": "ADD", "diff": "+build\n+coverage\n+dev\n+doc\n+src*\n+test\n+.nyc_output\n+tsconfig.json\n+*.tgz\n+*.html\n", "new_path": "packages/rstream-dot/.npmignore", "old_path": null }, { "change_type": "ADD", "diff": "+ Apache License\n+ Version 2.0, January 2004\n+ http://www.apache.org/licenses/\n+\n+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n+\n+ 1. Definitions.\n+\n+ \"License\" shall mean the terms and conditions for use, reproduction,\n+ and distribution as defined by Sections 1 through 9 of this document.\n+\n+ \"Licensor\" shall mean the copyright owner or entity authorized by\n+ the copyright owner that is granting the License.\n+\n+ \"Legal Entity\" shall mean the union of the acting entity and all\n+ other entities that control, are controlled by, or are under common\n+ control with that entity. For the purposes of this definition,\n+ \"control\" means (i) the power, direct or indirect, to cause the\n+ direction or management of such entity, whether by contract or\n+ otherwise, or (ii) ownership of fifty percent (50%) or more of the\n+ outstanding shares, or (iii) beneficial ownership of such entity.\n+\n+ \"You\" (or \"Your\") shall mean an individual or Legal Entity\n+ exercising permissions granted by this License.\n+\n+ \"Source\" form shall mean the preferred form for making modifications,\n+ including but not limited to software source code, documentation\n+ source, and configuration files.\n+\n+ \"Object\" form shall mean any form resulting from mechanical\n+ transformation or translation of a Source form, including but\n+ not limited to compiled object code, generated documentation,\n+ and conversions to other media types.\n+\n+ \"Work\" shall mean the work of authorship, whether in Source or\n+ Object form, made available under the License, as indicated by a\n+ copyright notice that is included in or attached to the work\n+ (an example is provided in the Appendix below).\n+\n+ \"Derivative Works\" shall mean any work, whether in Source or Object\n+ form, that is based on (or derived from) the Work and for which the\n+ editorial revisions, annotations, elaborations, or other modifications\n+ represent, as a whole, an original work of authorship. For the purposes\n+ of this License, Derivative Works shall not include works that remain\n+ separable from, or merely link (or bind by name) to the interfaces of,\n+ the Work and Derivative Works thereof.\n+\n+ \"Contribution\" shall mean any work of authorship, including\n+ the original version of the Work and any modifications or additions\n+ to that Work or Derivative Works thereof, that is intentionally\n+ submitted to Licensor for inclusion in the Work by the copyright owner\n+ or by an individual or Legal Entity authorized to submit on behalf of\n+ the copyright owner. For the purposes of this definition, \"submitted\"\n+ means any form of electronic, verbal, or written communication sent\n+ to the Licensor or its representatives, including but not limited to\n+ communication on electronic mailing lists, source code control systems,\n+ and issue tracking systems that are managed by, or on behalf of, the\n+ Licensor for the purpose of discussing and improving the Work, but\n+ excluding communication that is conspicuously marked or otherwise\n+ designated in writing by the copyright owner as \"Not a Contribution.\"\n+\n+ \"Contributor\" shall mean Licensor and any individual or Legal Entity\n+ on behalf of whom a Contribution has been received by Licensor and\n+ subsequently incorporated within the Work.\n+\n+ 2. Grant of Copyright License. Subject to the terms and conditions of\n+ this License, each Contributor hereby grants to You a perpetual,\n+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n+ copyright license to reproduce, prepare Derivative Works of,\n+ publicly display, publicly perform, sublicense, and distribute the\n+ Work and such Derivative Works in Source or Object form.\n+\n+ 3. Grant of Patent License. Subject to the terms and conditions of\n+ this License, each Contributor hereby grants to You a perpetual,\n+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n+ (except as stated in this section) patent license to make, have made,\n+ use, offer to sell, sell, import, and otherwise transfer the Work,\n+ where such license applies only to those patent claims licensable\n+ by such Contributor that are necessarily infringed by their\n+ Contribution(s) alone or by combination of their Contribution(s)\n+ with the Work to which such Contribution(s) was submitted. If You\n+ institute patent litigation against any entity (including a\n+ cross-claim or counterclaim in a lawsuit) alleging that the Work\n+ or a Contribution incorporated within the Work constitutes direct\n+ or contributory patent infringement, then any patent licenses\n+ granted to You under this License for that Work shall terminate\n+ as of the date such litigation is filed.\n+\n+ 4. Redistribution. You may reproduce and distribute copies of the\n+ Work or Derivative Works thereof in any medium, with or without\n+ modifications, and in Source or Object form, provided that You\n+ meet the following conditions:\n+\n+ (a) You must give any other recipients of the Work or\n+ Derivative Works a copy of this License; and\n+\n+ (b) You must cause any modified files to carry prominent notices\n+ stating that You changed the files; and\n+\n+ (c) You must retain, in the Source form of any Derivative Works\n+ that You distribute, all copyright, patent, trademark, and\n+ attribution notices from the Source form of the Work,\n+ excluding those notices that do not pertain to any part of\n+ the Derivative Works; and\n+\n+ (d) If the Work includes a \"NOTICE\" text file as part of its\n+ distribution, then any Derivative Works that You distribute must\n+ include a readable copy of the attribution notices contained\n+ within such NOTICE file, excluding those notices that do not\n+ pertain to any part of the Derivative Works, in at least one\n+ of the following places: within a NOTICE text file distributed\n+ as part of the Derivative Works; within the Source form or\n+ documentation, if provided along with the Derivative Works; or,\n+ within a display generated by the Derivative Works, if and\n+ wherever such third-party notices normally appear. The contents\n+ of the NOTICE file are for informational purposes only and\n+ do not modify the License. You may add Your own attribution\n+ notices within Derivative Works that You distribute, alongside\n+ or as an addendum to the NOTICE text from the Work, provided\n+ that such additional attribution notices cannot be construed\n+ as modifying the License.\n+\n+ You may add Your own copyright statement to Your modifications and\n+ may provide additional or different license terms and conditions\n+ for use, reproduction, or distribution of Your modifications, or\n+ for any such Derivative Works as a whole, provided Your use,\n+ reproduction, and distribution of the Work otherwise complies with\n+ the conditions stated in this License.\n+\n+ 5. Submission of Contributions. Unless You explicitly state otherwise,\n+ any Contribution intentionally submitted for inclusion in the Work\n+ by You to the Licensor shall be under the terms and conditions of\n+ this License, without any additional terms or conditions.\n+ Notwithstanding the above, nothing herein shall supersede or modify\n+ the terms of any separate license agreement you may have executed\n+ with Licensor regarding such Contributions.\n+\n+ 6. Trademarks. This License does not grant permission to use the trade\n+ names, trademarks, service marks, or product names of the Licensor,\n+ except as required for reasonable and customary use in describing the\n+ origin of the Work and reproducing the content of the NOTICE file.\n+\n+ 7. Disclaimer of Warranty. Unless required by applicable law or\n+ agreed to in writing, Licensor provides the Work (and each\n+ Contributor provides its Contributions) on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n+ implied, including, without limitation, any warranties or conditions\n+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n+ PARTICULAR PURPOSE. You are solely responsible for determining the\n+ appropriateness of using or redistributing the Work and assume any\n+ risks associated with Your exercise of permissions under this License.\n+\n+ 8. Limitation of Liability. In no event and under no legal theory,\n+ whether in tort (including negligence), contract, or otherwise,\n+ unless required by applicable law (such as deliberate and grossly\n+ negligent acts) or agreed to in writing, shall any Contributor be\n+ liable to You for damages, including any direct, indirect, special,\n+ incidental, or consequential damages of any character arising as a\n+ result of this License or out of the use or inability to use the\n+ Work (including but not limited to damages for loss of goodwill,\n+ work stoppage, computer failure or malfunction, or any and all\n+ other commercial damages or losses), even if such Contributor\n+ has been advised of the possibility of such damages.\n+\n+ 9. Accepting Warranty or Additional Liability. While redistributing\n+ the Work or Derivative Works thereof, You may choose to offer,\n+ and charge a fee for, acceptance of support, warranty, indemnity,\n+ or other liability obligations and/or rights consistent with this\n+ License. However, in accepting such obligations, You may act only\n+ on Your own behalf and on Your sole responsibility, not on behalf\n+ of any other Contributor, and only if You agree to indemnify,\n+ defend, and hold each Contributor harmless for any liability\n+ incurred by, or claims asserted against, such Contributor by reason\n+ of your accepting any such warranty or additional liability.\n+\n+ END OF TERMS AND CONDITIONS\n+\n+ APPENDIX: How to apply the Apache License to your work.\n+\n+ To apply the Apache License to your work, attach the following\n+ boilerplate notice, with the fields enclosed by brackets \"{}\"\n+ replaced with your own identifying information. (Don't include\n+ the brackets!) The text should be enclosed in the appropriate\n+ comment syntax for the file format. We also recommend that a\n+ file or class name and description of purpose be included on the\n+ same \"printed page\" as the copyright notice for easier\n+ identification within third-party archives.\n+\n+ Copyright {yyyy} {name of copyright owner}\n+\n+ Licensed under the Apache License, Version 2.0 (the \"License\");\n+ you may not use this file except in compliance with the License.\n+ You may obtain a copy of the License at\n+\n+ http://www.apache.org/licenses/LICENSE-2.0\n+\n+ Unless required by applicable law or agreed to in writing, software\n+ distributed under the License is distributed on an \"AS IS\" BASIS,\n+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ See the License for the specific language governing permissions and\n+ limitations under the License.\n", "new_path": "packages/rstream-dot/LICENSE", "old_path": null }, { "change_type": "ADD", "diff": "+# @thi.ng/rstream-dot\n+\n+[![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/rstream-dot.svg)](https://www.npmjs.com/package/@thi.ng/rstream-dot)\n+\n+## About\n+\n+TODO...\n+\n+## Installation\n+\n+```\n+yarn add @thi.ng/rstream-dot\n+```\n+\n+## Usage examples\n+\n+```typescript\n+import * as rstream-dot from \"@thi.ng/rstream-dot\";\n+```\n+\n+## Authors\n+\n+- Karsten Schmidt\n+\n+## License\n+\n+&copy; 2018 Karsten Schmidt // Apache Software License 2.0\n", "new_path": "packages/rstream-dot/README.md", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"name\": \"@thi.ng/rstream-dot\",\n+ \"version\": \"0.0.1\",\n+ \"description\": \"TODO\",\n+ \"main\": \"./index.js\",\n+ \"typings\": \"./index.d.ts\",\n+ \"repository\": \"https://github.com/thi-ng/umbrella\",\n+ \"author\": \"Karsten Schmidt <k+npm@thi.ng>\",\n+ \"license\": \"Apache-2.0\",\n+ \"scripts\": {\n+ \"build\": \"yarn run clean && tsc --declaration\",\n+ \"clean\": \"rm -rf *.js *.d.ts .nyc_output build coverage doc\",\n+ \"cover\": \"yarn test && nyc report --reporter=lcov\",\n+ \"doc\": \"node_modules/.bin/typedoc --mode modules --out doc src\",\n+ \"pub\": \"yarn run build && yarn publish --access public\",\n+ \"test\": \"rm -rf build && tsc -p test && nyc mocha build/test/*.js\"\n+ },\n+ \"devDependencies\": {\n+ \"@types/mocha\": \"^5.0.0\",\n+ \"@types/node\": \"^9.6.1\",\n+ \"mocha\": \"^5.0.5\",\n+ \"nyc\": \"^11.6.0\",\n+ \"typedoc\": \"^0.11.1\",\n+ \"typescript\": \"^2.8.1\"\n+ },\n+ \"dependencies\": {\n+ \"@thi.ng/api\": \"^2.1.0\",\n+ \"@thi.ng/rstream\": \"^1.5.1\",\n+ \"@thi.ng/transducers\": \"^1.8.1\"\n+ },\n+ \"keywords\": [\n+ \"ES6\",\n+ \"typescript\"\n+ ],\n+ \"publishConfig\": {\n+ \"access\": \"public\"\n+ }\n+}\n\\ No newline at end of file\n", "new_path": "packages/rstream-dot/package.json", "old_path": null }, { "change_type": "ADD", "diff": "+import { Subscription, StreamSync, StreamMerge, Stream } from \"@thi.ng/rstream\";\n+\n+export type NodeType =\n+ \"default\" |\n+ \"noid\" |\n+ \"stream\" |\n+ \"streammerge\" |\n+ \"streamsync\";\n+\n+export interface Node {\n+ id: number;\n+ label: string;\n+ type: string;\n+}\n+\n+export interface WalkState {\n+ subs: Map<Subscription<any, any>, Node>;\n+ rels: Node[][];\n+ id: number;\n+}\n+\n+export interface DotOpts {\n+ font: string;\n+ fontsize: string;\n+ text: string;\n+ color: Record<NodeType, string>;\n+}\n+\n+const getNodeType = (sub: Subscription<any, any>) => {\n+ if (sub instanceof Stream) {\n+ return \"Stream\";\n+ }\n+ if (sub instanceof StreamSync) {\n+ return \"StreamSync\";\n+ }\n+ if (sub instanceof StreamMerge) {\n+ return \"StreamMerge\";\n+ }\n+}\n+\n+const dotNode = (s: Node, opts: DotOpts) => {\n+ let res = `s${s.id}[label=`;\n+ if (s.type) {\n+ res += `\"${s.label}\\\\n(${s.type})\"`;\n+ } else {\n+ res += `\"${s.label}\"`;\n+ }\n+ res += \", color=\";\n+ res += (s.type && opts.color[s.type.toLowerCase()]) ||\n+ (s.label === \"<noid>\" ?\n+ opts.color.noid :\n+ opts.color.default);\n+ return res + \"];\"\n+};\n+\n+export const walk = (sub: Subscription<any, any>, state: WalkState) => {\n+ if (state.subs.get(sub)) return state;\n+ const id = state.id;\n+ const desc = { id, label: sub.id || \"<noid>\", type: getNodeType(sub) };\n+ state.subs.set(sub, desc);\n+ state.id++;\n+ const children = (<any>sub).subs ||\n+ ((<any>sub).__owner ?\n+ [(<any>sub).__owner] :\n+ undefined);\n+ if (children) {\n+ for (let s of children) {\n+ walk(s, state);\n+ state.rels.push([desc, state.subs.get(s)]);\n+ }\n+ }\n+ return state;\n+}\n+\n+export const toDot = (state: WalkState, opts: Partial<DotOpts>) => {\n+ opts = Object.assign({\n+ font: \"Inconsolata\",\n+ fontsize: 11,\n+ text: \"white\",\n+ color: {\n+ default: \"black\",\n+ noid: \"gray\",\n+ stream: \"blue\",\n+ streammerge: \"red\",\n+ streamsync: \"red\",\n+ }\n+ }, opts);\n+ return [\n+ \"digraph g {\",\n+ `node[fontname=${opts.font},fontsize=${opts.fontsize},style=filled,fontcolor=${opts.text}];`,\n+ ...[...state.subs.values()].map((n) => dotNode(n, <DotOpts>opts)),\n+ ...state.rels.map(([a, b]) => `s${a.id} -> s${b.id};`),\n+ \"}\"\n+ ].join(\"\\n\");\n+};\n\\ No newline at end of file\n", "new_path": "packages/rstream-dot/src/index.ts", "old_path": null }, { "change_type": "ADD", "diff": "+// import * as assert from \"assert\";\n+// import * as rstream-dot from \"../src/index\";\n+\n+describe(\"rstream-dot\", () => {\n+ it(\"tests pending\");\n+});\n", "new_path": "packages/rstream-dot/test/index.ts", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"extends\": \"../../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \"../build\"\n+ },\n+ \"include\": [\n+ \"./**/*.ts\",\n+ \"../src/**/*.ts\"\n+ ]\n+}\n", "new_path": "packages/rstream-dot/test/tsconfig.json", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"extends\": \"../../tsconfig.json\",\n+ \"compilerOptions\": {\n+ \"outDir\": \".\"\n+ },\n+ \"include\": [\n+ \"./src/**/*.ts\"\n+ ]\n+}\n", "new_path": "packages/rstream-dot/tsconfig.json", "old_path": null } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(rstream-dot): initial import @thi.ng/rstream-dot package
1
feat
rstream-dot
679,913
24.04.2018 11:46:36
-3,600
0153903dcf9a35a9f83b11be86c04b9acc79d18c
feat(rstream-graph): add IDs for all generated nodes, rename factory type MultiInputNodeFn => NodeFactory
[ { "change_type": "MODIFY", "diff": "@@ -2,7 +2,7 @@ import { ISubscribable } from \"@thi.ng/rstream/api\";\nimport { Transducer } from \"@thi.ng/transducers/api\";\nimport { IObjectOf } from \"@thi.ng/api/api\";\n-export type MultiInputNodeFn<T> = (src: ISubscribable<any>[]) => ISubscribable<T>;\n+export type NodeFactory<T> = (src: ISubscribable<any>[], id: string) => ISubscribable<T>;\n/**\n* A dataflow graph spec is simply an object where keys are node names\n@@ -22,7 +22,7 @@ export type GraphSpec = IObjectOf<NodeSpec>;\n* See `initGraph` and `nodeFromSpec` for more details (in /src/nodes.ts)\n*/\nexport interface NodeSpec {\n- fn: (src: ISubscribable<any>[]) => ISubscribable<any>;\n+ fn: NodeFactory<any>;\nins: NodeInput[];\nout?: NodeOutput;\n}\n", "new_path": "packages/rstream-graph/src/api.ts", "old_path": "packages/rstream-graph/src/api.ts" }, { "change_type": "MODIFY", "diff": "@@ -10,7 +10,7 @@ import { sync, StreamSync } from \"@thi.ng/rstream/stream-sync\";\nimport { Subscription } from \"@thi.ng/rstream/subscription\";\nimport { Transducer } from \"@thi.ng/transducers/api\";\n-import { NodeSpec } from \"./api\";\n+import { NodeSpec, NodeFactory } from \"./api\";\n/**\n* Dataflow graph initialization function. Takes an object of\n@@ -23,8 +23,8 @@ import { NodeSpec } from \"./api\";\n* @param nodes\n*/\nexport const initGraph = (state: IAtom<any>, nodes: IObjectOf<NodeSpec>): IObjectOf<ISubscribable<any>> => {\n- for (let k in nodes) {\n- (<any>nodes)[k] = nodeFromSpec(state, nodes[k]);\n+ for (let id in nodes) {\n+ (<any>nodes)[id] = nodeFromSpec(state, nodes[id], id);\n}\nreturn resolveMap(nodes);\n};\n@@ -43,7 +43,7 @@ export const initGraph = (state: IAtom<any>, nodes: IObjectOf<NodeSpec>): IObjec\n*\n* @param spec\n*/\n-const nodeFromSpec = (state: IAtom<any>, spec: NodeSpec) => (resolve) => {\n+const nodeFromSpec = (state: IAtom<any>, spec: NodeSpec, id: string) => (resolve) => {\nconst src: ISubscribable<any>[] = [];\nfor (let i of spec.ins) {\nlet s;\n@@ -63,10 +63,10 @@ const nodeFromSpec = (state: IAtom<any>, spec: NodeSpec) => (resolve) => {\n}\nsrc.push(s);\n}\n- const node = spec.fn(src);\n+ const node = spec.fn(src, id);\nif (spec.out) {\nif (isString(spec.out)) {\n- ((path) => node.subscribe({ next: (x) => state.resetIn(path, x) }))(spec.out);\n+ ((path) => node.subscribe({ next: (x) => state.resetIn(path, x) }, `out-${id}`))(spec.out);\n} else {\nspec.out(node);\n}\n@@ -75,7 +75,7 @@ const nodeFromSpec = (state: IAtom<any>, spec: NodeSpec) => (resolve) => {\n};\nexport const addNode = (graph: IObjectOf<ISubscribable<any>>, state: IAtom<any>, id: string, spec: NodeSpec) =>\n- graph[id] = nodeFromSpec(state, spec)((nodeID) => graph[nodeID]);\n+ graph[id] = nodeFromSpec(state, spec, id)((nodeID) => graph[nodeID]);\nexport const removeNode = (graph: IObjectOf<ISubscribable<any>>, id: string) => {\nif (graph[id]) {\n@@ -94,12 +94,12 @@ export const removeNode = (graph: IObjectOf<ISubscribable<any>>, id: string) =>\n* @param xform\n* @param arity\n*/\n-export const node = (xform: Transducer<IObjectOf<any>, any>, arity?: number) =>\n- (src: ISubscribable<any>[]): StreamSync<any, any> => {\n+export const node = (xform: Transducer<IObjectOf<any>, any>, arity?: number): NodeFactory<any> =>\n+ (src: ISubscribable<any>[], id: string): StreamSync<any, any> => {\nif (arity !== undefined && src.length !== arity) {\nillegalArgs(`wrong number of inputs: got ${src.length}, but needed ${arity}`);\n}\n- return sync({ src, xform, reset: false });\n+ return sync({ src, xform, reset: false, id });\n};\n/**\n@@ -107,5 +107,5 @@ export const node = (xform: Transducer<IObjectOf<any>, any>, arity?: number) =>\n*\n* @param xform\n*/\n-export const node1 = (xform: Transducer<any, any>) =>\n- ([src]: ISubscribable<any>[]): Subscription<any, any> => src.subscribe(xform);\n+export const node1 = (xform: Transducer<any, any>): NodeFactory<any> =>\n+ ([src]: ISubscribable<any>[], id: string): Subscription<any, any> => src.subscribe(xform, id);\n", "new_path": "packages/rstream-graph/src/graph.ts", "old_path": "packages/rstream-graph/src/graph.ts" }, { "change_type": "MODIFY", "diff": "import { Path, getIn } from \"@thi.ng/paths\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\n-import { MultiInputNodeFn } from \"../api\";\n+import { NodeFactory } from \"../api\";\nimport { node1 } from \"../graph\";\n/**\n@@ -9,5 +9,5 @@ import { node1 } from \"../graph\";\n*\n* Inputs: 1\n*/\n-export const extract = (path: Path): MultiInputNodeFn<any> =>\n+export const extract = (path: Path): NodeFactory<any> =>\nnode1(map((x) => getIn(x, path)));\n", "new_path": "packages/rstream-graph/src/nodes/extract.ts", "old_path": "packages/rstream-graph/src/nodes/extract.ts" }, { "change_type": "MODIFY", "diff": "import { IObjectOf } from \"@thi.ng/api/api\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\n-import { MultiInputNodeFn } from \"../api\";\n+import { NodeFactory } from \"../api\";\nimport { node } from \"../graph\";\n/**\n@@ -9,7 +9,7 @@ import { node } from \"../graph\";\n*\n* Inputs: any\n*/\n-export const add: MultiInputNodeFn<number> = node(\n+export const add: NodeFactory<number> = node(\nmap((ports: IObjectOf<number>) => {\nlet acc = 0;\nlet v;\n@@ -25,7 +25,7 @@ export const add: MultiInputNodeFn<number> = node(\n*\n* Inputs: any\n*/\n-export const mul: MultiInputNodeFn<number> = node(\n+export const mul: NodeFactory<number> = node(\nmap((ports: IObjectOf<number>) => {\nlet acc = 1;\nlet v;\n@@ -41,7 +41,7 @@ export const mul: MultiInputNodeFn<number> = node(\n*\n* Inputs: 2\n*/\n-export const sub: MultiInputNodeFn<number> =\n+export const sub: NodeFactory<number> =\nnode(map((ports: IObjectOf<number>) => ports.a - ports.b), 2);\n/**\n@@ -49,5 +49,5 @@ export const sub: MultiInputNodeFn<number> =\n*\n* Inputs: 2\n*/\n-export const div: MultiInputNodeFn<number> =\n+export const div: NodeFactory<number> =\nnode(map((ports: IObjectOf<number>) => ports.a / ports.b), 2);\n", "new_path": "packages/rstream-graph/src/nodes/math.ts", "old_path": "packages/rstream-graph/src/nodes/math.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(rstream-graph): add IDs for all generated nodes, rename factory type - MultiInputNodeFn => NodeFactory
1
feat
rstream-graph
679,913
24.04.2018 11:58:29
-3,600
704025a9d5a063944d88af2f9340d4d58c21d3de
feat(rstream-dot): support multiple roots in walk()
[ { "change_type": "MODIFY", "diff": "@@ -53,7 +53,9 @@ const dotNode = (s: Node, opts: DotOpts) => {\nreturn res + \"];\"\n};\n-export const walk = (sub: Subscription<any, any>, state: WalkState) => {\n+export const walk = (subs: Subscription<any, any>[], state?: WalkState) => {\n+ state || (state = { id: 0, subs: new Map(), rels: [] });\n+ for (let sub of subs) {\nif (state.subs.get(sub)) return state;\nconst id = state.id;\nconst desc = { id, label: sub.id || \"<noid>\", type: getNodeType(sub) };\n@@ -65,14 +67,15 @@ export const walk = (sub: Subscription<any, any>, state: WalkState) => {\nundefined);\nif (children) {\nfor (let s of children) {\n- walk(s, state);\n+ walk([s], state);\nstate.rels.push([desc, state.subs.get(s)]);\n}\n}\n+ }\nreturn state;\n}\n-export const toDot = (state: WalkState, opts: Partial<DotOpts>) => {\n+export const toDot = (state: WalkState, opts?: Partial<DotOpts>) => {\nopts = Object.assign({\nfont: \"Inconsolata\",\nfontsize: 11,\n", "new_path": "packages/rstream-dot/src/index.ts", "old_path": "packages/rstream-dot/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(rstream-dot): support multiple roots in walk()
1
feat
rstream-dot
679,913
24.04.2018 12:02:07
-3,600
d35b5ff162bab308b23e4400bb0d165f70601420
feat(examples): add graphviz DOT output for rstream-dataflow
[ { "change_type": "MODIFY", "diff": "@@ -23,6 +23,7 @@ above dataflow graph in a declarative manner:\n- [@thi.ng/paths](https://github.com/thi-ng/umbrella/tree/master/packages/paths) - nested value accessors\n- [@thi.ng/resolve-map](https://github.com/thi-ng/umbrella/tree/master/packages/resolve-map) - DAG-based object resolution\n- [@thi.ng/rstream](https://github.com/thi-ng/umbrella/tree/master/packages/rstream) - reactive stream constructs\n+- [@thi.ng/rstream-dot](https://github.com/thi-ng/umbrella/tree/master/packages/rstream-dot) - GraphViz DOT output of graph topology\n- [@thi.ng/rstream-gestures](https://github.com/thi-ng/umbrella/tree/master/packages/rstream-gestures) - unified mouse & single-touch event stream\n- [@thi.ng/transducers](https://github.com/thi-ng/umbrella/tree/master/packages/transducers) - data transformations (here used for stream transforms)\n", "new_path": "examples/rstream-dataflow/README.md", "old_path": "examples/rstream-dataflow/README.md" }, { "change_type": "MODIFY", "diff": "\"@thi.ng/hdom\": \"latest\",\n\"@thi.ng/paths\": \"latest\",\n\"@thi.ng/rstream\": \"latest\",\n+ \"@thi.ng/rstream-dot\": \"latest\",\n\"@thi.ng/rstream-gestures\": \"latest\",\n\"@thi.ng/rstream-graph\": \"latest\",\n\"@thi.ng/transducers\": \"latest\"\n", "new_path": "examples/rstream-dataflow/package.json", "old_path": "examples/rstream-dataflow/package.json" }, { "change_type": "MODIFY", "diff": "@@ -3,6 +3,7 @@ import { Atom } from \"@thi.ng/atom/atom\";\nimport { start } from \"@thi.ng/hdom\";\nimport { getIn } from \"@thi.ng/paths\";\nimport { fromRAF } from \"@thi.ng/rstream/from/raf\";\n+import { walk, toDot } from \"@thi.ng/rstream-dot\";\nimport { gestureStream } from \"@thi.ng/rstream-gestures\";\nimport { initGraph, node, node1 } from \"@thi.ng/rstream-graph/graph\";\nimport { extract } from \"@thi.ng/rstream-graph/nodes/extract\";\n@@ -31,6 +32,11 @@ const db = new Atom<any>({});\n// Note: only single touches are supported, no multitouch!\nconst gestures = gestureStream(document.getElementById(\"app\"));\n+// requestAnimationFrame() based counter stream. this is consumed by the\n+// \"sine\" graph node below, but predefined here for visualization\n+// purposes (see end of file)\n+const raf = fromRAF();\n+\n// dataflow graph definition. each key in this object represents a node\n// in the graph and its value is a `NodeSpec`. the `initGraph` function\n// transforms these specs into a DAG (directed acyclic graph) of\n@@ -70,10 +76,12 @@ const graph = initGraph(db, {\n// (`delta` is only defined during drag gestures)\n// `node1` is a helper function for nodes using only a single input\ndist: {\n- fn: node1(map((gesture) => {\n+ fn: node1(map(\n+ (gesture) => {\nconst delta = getIn(gesture, [1, \"delta\"]);\nreturn delta && Math.hypot.apply(null, delta) | 0;\n- })),\n+ }\n+ )),\nins: [{ stream: () => gestures }],\nout: \"dist\"\n},\n@@ -86,10 +94,12 @@ const graph = initGraph(db, {\n// `node` is a helper function to create a `StreamSync` based node\n// with multiple inputs\ncircle: {\n- fn: node(map(({ click, radius, color }) =>\n+ fn: node(map(\n+ ({ click, radius, color }) =>\nclick && radius && color ?\ncircle(color, click[0], click[1], radius * 2) :\n- undefined)),\n+ undefined\n+ )),\nins: [\n{ stream: \"clickpos\", id: \"click\" },\n{ stream: \"radius\", id: \"radius\" },\n@@ -105,7 +115,10 @@ const graph = initGraph(db, {\n// time clickpos is redefined (remember, clickpos is only defined\n// during drag gestures)\ncolor: {\n- fn: node1(comp(dedupe(equiv), map((x) => x && colors.next().value))),\n+ fn: node1(comp(\n+ dedupe(equiv),\n+ map((x) => x && colors.next().value)\n+ )),\nins: [{ stream: \"clickpos\" }],\nout: \"color\"\n},\n@@ -114,7 +127,7 @@ const graph = initGraph(db, {\n// into a sine wave with 0.6 .. 1.0 interval\nsine: {\nfn: node1(map((x: number) => 0.8 + 0.2 * Math.sin(x * 0.05))),\n- ins: [{ stream: () => fromRAF() }],\n+ ins: [{ stream: () => raf }],\nout: \"sin\"\n},\n@@ -138,3 +151,11 @@ start(\"app\", () =>\n// @thi.ng/atom's Atom, Cursor, View etc.)\ngraph.circle\n]);\n+\n+// create a GraphViz DOT file of the entire dataflow graph\n+// copy the output from the console into a new text file and then run:\n+// `dot -Tsvg -o graph.svg graph.dot`\n+//\n+// see for more info:\n+// https://github.com/thi-ng/umbrella/tree/master/packages/rstream-dot\n+console.log(toDot(walk([gestures, raf])));\n", "new_path": "examples/rstream-dataflow/src/index.ts", "old_path": "examples/rstream-dataflow/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(examples): add graphviz DOT output for rstream-dataflow
1
feat
examples
679,913
24.04.2018 12:03:23
-3,600
66ec92fb2341f2f65ec71f2d2bca23dbf1018aff
feat(rstream-query): update index & sub-query caching/reuse
[ { "change_type": "MODIFY", "diff": "\"@thi.ng/api\": \"^2.2.0\",\n\"@thi.ng/associative\": \"^0.4.3\",\n\"@thi.ng/rstream\": \"^1.5.1\",\n+ \"@thi.ng/rstream-dot\": \"^0.0.1\",\n\"@thi.ng/transducers\": \"^1.8.1\"\n},\n\"keywords\": [\n", "new_path": "packages/rstream-query/package.json", "old_path": "packages/rstream-query/package.json" }, { "change_type": "MODIFY", "diff": "@@ -6,6 +6,8 @@ export interface Pattern extends Array<any> {\nexport type Fact = Pattern;\n+export type FactIds = Set<number>\n+\nexport const CHOICES = Symbol(\"CHOICES\");\nexport enum EditOp {\n@@ -18,3 +20,5 @@ export interface Edit {\nindex: Set<number>;\nkey: any;\n}\n+\n+export let DEBUG = true;\n\\ No newline at end of file\n", "new_path": "packages/rstream-query/src/api.ts", "old_path": "packages/rstream-query/src/api.ts" }, { "change_type": "MODIFY", "diff": "import { equiv } from \"@thi.ng/api/equiv\";\nimport { intersection } from \"@thi.ng/associative/intersection\";\n-import { Stream, trace, Subscription, sync } from \"@thi.ng/rstream\";\n+import { Stream, Subscription, sync } from \"@thi.ng/rstream\";\nimport { Transducer, Reducer } from \"@thi.ng/transducers/api\";\nimport { compR } from \"@thi.ng/transducers/func/compr\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\n-import { Fact, Pattern, Edit } from \"./api\";\n+import { DEBUG, Edit, Fact, FactIds, Pattern } from \"./api\";\n+import { IObjectOf } from \"@thi.ng/api/api\";\nexport class FactGraph {\nstatic NEXT_ID = 0;\nfacts: Fact[];\n- indexS: Map<any, Set<number>>;\n- indexP: Map<any, Set<number>>;\n- indexO: Map<any, Set<number>>;\n- allIDs: Set<number>;\n+ indexS: Map<any, FactIds>;\n+ indexP: Map<any, FactIds>;\n+ indexO: Map<any, FactIds>;\n+ indexSelections: IObjectOf<Map<any, Subscription<Edit, FactIds>>>;\n+ allSelections: IObjectOf<Subscription<FactIds, FactIds>>;\n+ allIDs: FactIds;\n- streamAll: Stream<Set<number>>;\n+ streamAll: Stream<FactIds>;\nstreamS: Stream<Edit>;\nstreamP: Stream<Edit>;\nstreamO: Stream<Edit>;\n@@ -27,11 +30,21 @@ export class FactGraph {\nthis.indexS = new Map();\nthis.indexP = new Map();\nthis.indexO = new Map();\n+ this.indexSelections = {\n+ \"s\": new Map(),\n+ \"p\": new Map(),\n+ \"o\": new Map()\n+ };\nthis.streamS = new Stream(\"S\");\nthis.streamP = new Stream(\"P\");\nthis.streamO = new Stream(\"O\");\nthis.streamAll = new Stream(\"ALL\");\nthis.allIDs = new Set<number>();\n+ this.allSelections = {\n+ \"s\": this.streamAll.subscribe(null, \"s\"),\n+ \"p\": this.streamAll.subscribe(null, \"p\"),\n+ \"o\": this.streamAll.subscribe(null, \"o\")\n+ };\n}\naddFact(f: Fact) {\n@@ -58,44 +71,37 @@ export class FactGraph {\nreturn this;\n}\n- addQuery(id: string, [s, p, o]: Pattern) {\n- const qs: Subscription<any, Set<number>> = this.getIndexSelection(this.streamS, s, \"s\");\n- const qp: Subscription<any, Set<number>> = this.getIndexSelection(this.streamP, p, \"p\");\n- const qo: Subscription<any, Set<number>> = this.getIndexSelection(this.streamO, o, \"o\");\n- const results = sync<Set<number>, Set<Fact>>({\n+ addPatternQuery(id: string, [s, p, o]: Pattern): Subscription<FactIds, FactIds> {\n+ if (s == null && p == null && o == null) {\n+ return this.streamAll;\n+ }\n+ const qs = this.getIndexSelection(this.streamS, s, \"s\");\n+ const qp = this.getIndexSelection(this.streamP, p, \"p\");\n+ const qo = this.getIndexSelection(this.streamO, o, \"o\");\n+ const results = sync<FactIds, FactIds>({\nid,\nsrc: [qs, qp, qo],\n- xform: map(\n- ({ s, p, o }) => {\n- const res = new Set<Fact>();\n- for (let id of intersection(intersection(s, p), o)) {\n- res.add(this.facts[id])\n- }\n- return res;\n- }\n- )\n+ xform: map(({ s, p, o }) => intersection(intersection(s, p), o)),\n+ reset: true,\n});\nconst submit = (index: Map<any, Set<number>>, stream: Subscription<any, Set<number>>, key: any) => {\nif (key != null) {\nconst ids = index.get(key);\n- ids && stream.next({ index: ids, key: s });\n- } else {\n- stream.next(this.allIDs);\n+ ids && stream.next({ index: ids, key });\n}\n};\nsubmit(this.indexS, qs, s);\nsubmit(this.indexP, qp, p);\nsubmit(this.indexO, qo, o);\n- return results.subscribe(trace(`${id}: `));\n+ return results;\n}\n- findInIndices(s: Set<number>, p: Set<number>, o: Set<number>, f: Fact) {\n+ protected findInIndices(s: FactIds, p: FactIds, o: FactIds, f: Fact) {\nif (s && p && o) {\nconst facts = this.facts;\nconst index = s.size < p.size ?\ns.size < o.size ? s : p.size < o.size ? p : o :\np.size < o.size ? p : s.size < o.size ? s : o;\n- console.log(\"smallest index\", index, s, p, o);\nfor (let id of index) {\nif (equiv(facts[id], f)) {\nreturn id;\n@@ -105,18 +111,24 @@ export class FactGraph {\nreturn -1;\n}\n- protected getIndexSelection(stream: Stream<Edit>, key: any, id: string): Subscription<any, Set<number>> {\n- return key != null ?\n- stream.transform(indexSel(key), id) :\n- this.streamAll.subscribe(null, id);\n+ protected getIndexSelection(stream: Stream<Edit>, key: any, id: string): Subscription<any, FactIds> {\n+ if (key != null) {\n+ let sel = this.indexSelections[id].get(key);\n+ if (!sel) {\n+ this.indexSelections[id].set(key, sel = stream.transform(indexSel(key), id));\n+ }\n+ return sel;\n+ }\n+ return this.allSelections[id];\n}\n}\n-export const indexSel = (key: any): Transducer<Edit, Set<number>> =>\n- (rfn: Reducer<any, Set<number>>) => {\n+export const indexSel = (key: any): Transducer<Edit, FactIds> =>\n+ (rfn: Reducer<any, FactIds>) => {\nconst r = rfn[2];\nreturn compR(rfn,\n(acc, e) => {\n+ DEBUG && console.log(\"index sel\", e.key, key);\nif (equiv(e.key, key)) {\nreturn r(acc, e.index);\n}\n@@ -125,12 +137,10 @@ export const indexSel = (key: any): Transducer<Edit, Set<number>> =>\n);\n};\n-export const g = new FactGraph();\n-g.addFact([\"mia\", \"loves\", \"toxi\"]);\n-g.addFact([\"mia\", \"loves\", \"ned\"]);\n-g.addFact([\"mia\", \"age\", 42]);\n-g.addFact([\"toxi\", \"age\", 42]);\n-g.addFact([\"mia\", \"loves\", \"noah\"]);\n-export const q1 = g.addQuery(\"mia\", [\"mia\", null, null]);\n-export const q2 = g.addQuery(\"loves\", [null, \"loves\", null]);\n-export const q3 = g.addQuery(\"all\", [null, null, null]);\n+export const asFacts = (graph: FactGraph) =>\n+ map<FactIds, Set<Fact>>(\n+ (ids) => {\n+ const res = new Set<Fact>();\n+ for (let id of ids) res.add(graph.facts[id]);\n+ return res;\n+ });\n", "new_path": "packages/rstream-query/src/graph.ts", "old_path": "packages/rstream-query/src/graph.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(rstream-query): update index & sub-query caching/reuse
1
feat
rstream-query
791,690
24.04.2018 14:17:30
25,200
ad3ebf5d64dd980ec2a41455c7cce3cf9ee55c96
report(util): fix formatDuration, add tests
[ { "change_type": "MODIFY", "diff": "@@ -202,7 +202,7 @@ class CacheHeaders extends Audit {\nresults.push({\nurl,\ncacheControl,\n- cacheLifetimeInSeconds,\n+ cacheLifetimeMs: cacheLifetimeInSeconds * 1000,\ncacheHitProbability,\ntotalBytes,\nwastedBytes,\n@@ -210,7 +210,7 @@ class CacheHeaders extends Audit {\n}\nresults.sort(\n- (a, b) => a.cacheLifetimeInSeconds - b.cacheLifetimeInSeconds || b.totalBytes - a.totalBytes\n+ (a, b) => a.cacheLifetimeMs - b.cacheLifetimeMs || b.totalBytes - a.totalBytes\n);\nconst score = Audit.computeLogNormalScore(\n@@ -221,7 +221,7 @@ class CacheHeaders extends Audit {\nconst headings = [\n{key: 'url', itemType: 'url', text: 'URL'},\n- {key: 'cacheLifetimeInSeconds', itemType: 'ms', text: 'Cache TTL', displayUnit: 'duration'},\n+ {key: 'cacheLifetimeMs', itemType: 'ms', text: 'Cache TTL', displayUnit: 'duration'},\n{key: 'totalBytes', itemType: 'bytes', text: 'Size (KB)', displayUnit: 'kb',\ngranularity: 1},\n];\n", "new_path": "lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js", "old_path": "lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js" }, { "change_type": "MODIFY", "diff": "@@ -99,7 +99,7 @@ class Util {\n* @return {string}\n*/\nstatic formatDuration(timeInMilliseconds) {\n- let timeInSeconds = timeInMilliseconds * 1000;\n+ let timeInSeconds = timeInMilliseconds / 1000;\nif (Math.round(timeInSeconds) === 0) {\nreturn 'None';\n}\n", "new_path": "lighthouse-core/report/v2/renderer/util.js", "old_path": "lighthouse-core/report/v2/renderer/util.js" }, { "change_type": "MODIFY", "diff": "@@ -60,7 +60,7 @@ describe('Cache headers audit', () => {\nreturn CacheHeadersAudit.audit(artifacts, {options}).then(result => {\nconst items = result.extendedInfo.value.results;\nassert.equal(items.length, 1);\n- assert.equal(items[0].cacheLifetimeInSeconds, 0);\n+ assert.equal(items[0].cacheLifetimeMs, 0);\nassert.equal(items[0].wastedBytes, 10000);\nassert.equal(result.displayValue, '1 asset found');\n});\n@@ -77,12 +77,12 @@ describe('Cache headers audit', () => {\nreturn CacheHeadersAudit.audit(artifacts, {options}).then(result => {\nconst items = result.details.items;\nassert.equal(items.length, 3);\n- assert.equal(items[0].cacheLifetimeInSeconds, 3600);\n+ assert.equal(items[0].cacheLifetimeMs, 3600 * 1000);\nassert.equal(items[0].cacheHitProbability, 0.2);\nassert.equal(Math.round(items[0].wastedBytes), 80000);\n- assert.equal(items[1].cacheLifetimeInSeconds, 3600);\n+ assert.equal(items[1].cacheLifetimeMs, 3600 * 1000);\nassert.equal(Math.round(items[1].wastedBytes), 8000);\n- assert.equal(items[2].cacheLifetimeInSeconds, 86400);\n+ assert.equal(items[2].cacheLifetimeMs, 86400 * 1000);\nassert.equal(Math.round(items[2].wastedBytes), 4000);\nassert.equal(result.displayValue, '3 assets found');\n});\n@@ -102,11 +102,11 @@ describe('Cache headers audit', () => {\nreturn CacheHeadersAudit.audit(artifacts, {options}).then(result => {\nconst items = result.extendedInfo.value.results;\nassert.equal(items.length, 3);\n- closeEnough(items[0].cacheLifetimeInSeconds, 3600);\n+ closeEnough(items[0].cacheLifetimeMs, 3600 * 1000);\nassert.equal(Math.round(items[0].wastedBytes), 8000);\n- closeEnough(items[1].cacheLifetimeInSeconds, 86400);\n+ closeEnough(items[1].cacheLifetimeMs, 86400 * 1000);\nassert.equal(Math.round(items[1].wastedBytes), 4000);\n- closeEnough(items[2].cacheLifetimeInSeconds, 86400 * 90);\n+ closeEnough(items[2].cacheLifetimeMs, 86400 * 90 * 1000);\nassert.equal(Math.round(items[2].wastedBytes), 768);\n});\n});\n@@ -128,9 +128,9 @@ describe('Cache headers audit', () => {\nreturn CacheHeadersAudit.audit(artifacts, {options}).then(result => {\nconst items = result.extendedInfo.value.results;\nassert.equal(items.length, 2);\n- assert.ok(Math.abs(items[0].cacheLifetimeInSeconds - 3600) <= 1, 'invalid expires parsing');\n+ assert.ok(Math.abs(items[0].cacheLifetimeMs - 3600 * 1000) <= 1, 'invalid expires parsing');\nassert.equal(Math.round(items[0].wastedBytes), 8000);\n- assert.ok(Math.abs(items[1].cacheLifetimeInSeconds - 86400) <= 1, 'invalid expires parsing');\n+ assert.ok(Math.abs(items[1].cacheLifetimeMs - 86400 * 1000) <= 1, 'invalid expires parsing');\nassert.equal(Math.round(items[1].wastedBytes), 4000);\n});\n});\n", "new_path": "lighthouse-core/test/audits/byte-efficiency/uses-long-cache-ttl-test.js", "old_path": "lighthouse-core/test/audits/byte-efficiency/uses-long-cache-ttl-test.js" }, { "change_type": "RENAME", "diff": "const assert = require('assert');\nconst Util = require('../../../../report/v2/renderer/util.js');\n+const NBSP = '\\xa0';\n/* eslint-env mocha */\n@@ -26,6 +27,23 @@ describe('util helpers', () => {\n);\n});\n+ it('formats bytes', () => {\n+ assert.equal(Util.formatBytesToKB(100), `0.1${NBSP}KB`);\n+ assert.equal(Util.formatBytesToKB(2000), `2${NBSP}KB`);\n+ assert.equal(Util.formatBytesToKB(1014 * 1024), `1,014${NBSP}KB`);\n+ });\n+\n+ it('formats ms', () => {\n+ assert.equal(Util.formatMilliseconds(123), `120${NBSP}ms`);\n+ assert.equal(Util.formatMilliseconds(2456.5, 0.1), `2,456.5${NBSP}ms`);\n+ });\n+\n+ it('formats a duration', () => {\n+ assert.equal(Util.formatDuration(60 * 1000), `1${NBSP}m`);\n+ assert.equal(Util.formatDuration(60 * 60 * 1000 + 5000), `1${NBSP}h 5${NBSP}s`);\n+ assert.equal(Util.formatDuration(28 * 60 * 60 * 1000 + 5000), `1${NBSP}d 4${NBSP}h 5${NBSP}s`);\n+ });\n+\nit('calculates a score ratings', () => {\nassert.equal(Util.calculateRating(0.0), 'fail');\nassert.equal(Util.calculateRating(0.10), 'fail');\n", "new_path": "lighthouse-core/test/report/v2/renderer/util-test.js", "old_path": "lighthouse-core/test/report/v2/renderer/format-helpers-test.js" }, { "change_type": "MODIFY", "diff": "{\n\"url\": \"http://localhost:10200/zone.js\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 71654,\n\"wastedBytes\": 71654\n{\n\"url\": \"http://localhost:10200/dobetterweb/lighthouse-480x318.jpg\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 24741,\n\"wastedBytes\": 24741\n{\n\"url\": \"http://localhost:10200/dobetterweb/dbw_tester.js\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 1703,\n\"wastedBytes\": 1703\n{\n\"url\": \"http://localhost:10200/dobetterweb/dbw_disabled.css?delay=200&isdisabled\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 1108,\n\"wastedBytes\": 1108\n{\n\"url\": \"http://localhost:10200/dobetterweb/dbw_tester.css?delay=3000&async=true\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 821,\n\"wastedBytes\": 821\n{\n\"url\": \"http://localhost:10200/dobetterweb/dbw_tester.css?delay=100\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 821,\n\"wastedBytes\": 821\n{\n\"url\": \"http://localhost:10200/dobetterweb/dbw_tester.css?scriptActivated&delay=200\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 821,\n\"wastedBytes\": 821\n{\n\"url\": \"http://localhost:10200/dobetterweb/dbw_tester.css?delay=2200\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 821,\n\"wastedBytes\": 821\n{\n\"url\": \"http://localhost:10200/dobetterweb/dbw_tester.css?delay=2000&async=true\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 821,\n\"wastedBytes\": 821\n{\n\"url\": \"http://localhost:10200/dobetterweb/empty_module.js?delay=500\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 144,\n\"wastedBytes\": 144\n{\n\"url\": \"blob:http://localhost:10200/ae0eac03-ab9b-4a6a-b299-f5212153e277\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 0,\n\"wastedBytes\": 0\n\"text\": \"URL\"\n},\n{\n- \"key\": \"cacheLifetimeInSeconds\",\n+ \"key\": \"cacheLifetimeMs\",\n\"itemType\": \"ms\",\n\"text\": \"Cache TTL\",\n\"displayUnit\": \"duration\"\n{\n\"url\": \"http://localhost:10200/zone.js\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 71654,\n\"wastedBytes\": 71654\n{\n\"url\": \"http://localhost:10200/dobetterweb/lighthouse-480x318.jpg\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 24741,\n\"wastedBytes\": 24741\n{\n\"url\": \"http://localhost:10200/dobetterweb/dbw_tester.js\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 1703,\n\"wastedBytes\": 1703\n{\n\"url\": \"http://localhost:10200/dobetterweb/dbw_disabled.css?delay=200&isdisabled\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 1108,\n\"wastedBytes\": 1108\n{\n\"url\": \"http://localhost:10200/dobetterweb/dbw_tester.css?delay=3000&async=true\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 821,\n\"wastedBytes\": 821\n{\n\"url\": \"http://localhost:10200/dobetterweb/dbw_tester.css?delay=100\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 821,\n\"wastedBytes\": 821\n{\n\"url\": \"http://localhost:10200/dobetterweb/dbw_tester.css?scriptActivated&delay=200\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 821,\n\"wastedBytes\": 821\n{\n\"url\": \"http://localhost:10200/dobetterweb/dbw_tester.css?delay=2200\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 821,\n\"wastedBytes\": 821\n{\n\"url\": \"http://localhost:10200/dobetterweb/dbw_tester.css?delay=2000&async=true\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 821,\n\"wastedBytes\": 821\n{\n\"url\": \"http://localhost:10200/dobetterweb/empty_module.js?delay=500\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 144,\n\"wastedBytes\": 144\n{\n\"url\": \"blob:http://localhost:10200/ae0eac03-ab9b-4a6a-b299-f5212153e277\",\n\"cacheControl\": null,\n- \"cacheLifetimeInSeconds\": 0,\n+ \"cacheLifetimeMs\": 0,\n\"cacheHitProbability\": 0,\n\"totalBytes\": 0,\n\"wastedBytes\": 0\n", "new_path": "lighthouse-core/test/results/sample_v2.json", "old_path": "lighthouse-core/test/results/sample_v2.json" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
report(util): fix formatDuration, add tests (#5023)
1
report
util
807,849
24.04.2018 14:26:38
25,200
054392b879f2989fccba6f397ba15501ca8ac69b
feat(publish): Add --require-scripts option to opt-in to raw JS lifecycle scripts BREAKING CHANGE: External `$PKGDIR/scripts/{pre,post}publish.js` lifecycles are now opt-in instead of automatic. Pass `--require-scripts` explicitly to restore previous functionality.
[ { "change_type": "MODIFY", "diff": "@@ -85,6 +85,10 @@ exports.builder = yargs => {\ntype: \"string\",\nrequiresArg: true,\n},\n+ \"require-scripts\": {\n+ describe: \"Execute ./scripts/prepublish.js and ./scripts/postpublish.js, relative to package root.\",\n+ type: \"boolean\",\n+ },\npreid: {\ndescribe: \"Specify the prerelease identifier (major.minor.patch-pre).\",\ntype: \"string\",\n", "new_path": "commands/publish/command.js", "old_path": "commands/publish/command.js" }, { "change_type": "MODIFY", "diff": "@@ -56,6 +56,10 @@ class PublishCommand extends Command {\n// https://docs.npmjs.com/misc/config#save-prefix\nthis.savePrefix = this.options.exact ? \"\" : \"^\";\n+ if (this.options.requireScripts) {\n+ this.logger.info(\"require-scripts\", \"enabled\");\n+ }\n+\nthis.npmConfig = {\nnpmClient: this.options.npmClient || \"npm\",\nregistry: this.options.registry,\n@@ -680,7 +684,9 @@ class PublishCommand extends Command {\nchain = chain.then(() => this.runPrepublishScripts(rootPkg));\nchain = chain.then(() =>\npMap(this.updates, ({ pkg }) => {\n+ if (this.options.requireScripts) {\nthis.execScript(pkg, \"prepublish\");\n+ }\nreturn this.runPrepublishScripts(pkg);\n})\n@@ -695,7 +701,9 @@ class PublishCommand extends Command {\ntracker.info(\"published\", pkg.name);\ntracker.completeWork(1);\n+ if (this.options.requireScripts) {\nthis.execScript(pkg, \"postpublish\");\n+ }\nreturn this.runPackageLifecycle(pkg, \"postpublish\");\n});\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" } ]
JavaScript
MIT License
lerna/lerna
feat(publish): Add --require-scripts option to opt-in to raw JS lifecycle scripts BREAKING CHANGE: External `$PKGDIR/scripts/{pre,post}publish.js` lifecycles are now opt-in instead of automatic. Pass `--require-scripts` explicitly to restore previous functionality.
1
feat
publish
679,913
24.04.2018 14:27:15
-3,600
b3928174360689f6798b15cfc372c56ea2552a3b
perf(rstream): support (re)named StreamSync inputs update StreamSyncOpts allow objects as `src` option, use object keys as input IDs update `add()`, add optional ID arg add various maps to handle real vs. alias IDs
[ { "change_type": "MODIFY", "diff": "import { IObjectOf, IID } from \"@thi.ng/api/api\";\n+import { isPlainObject } from \"@thi.ng/checks/is-plain-object\";\nimport { Transducer } from \"@thi.ng/transducers/api\";\nimport { comp } from \"@thi.ng/transducers/func/comp\";\nimport { labeled } from \"@thi.ng/transducers/xform/labeled\";\n@@ -9,7 +10,7 @@ import { ISubscribable, State } from \"./api\";\nimport { Subscription } from \"./subscription\";\nexport interface StreamSyncOpts<A, B> extends IID<string> {\n- src: ISubscribable<A>[];\n+ src: ISubscribable<A>[] | IObjectOf<ISubscribable<A>>;\nxform: Transducer<IObjectOf<A>, B>;\nreset: boolean;\nall: boolean;\n@@ -58,7 +59,26 @@ export interface StreamSyncOpts<A, B> extends IID<string> {\n*/\nexport class StreamSync<A, B> extends Subscription<A, B> {\n+ /**\n+ * maps actual inputs to their virtual input subs\n+ */\nsources: Map<ISubscribable<A>, Subscription<A, [string, A]>>;\n+ /**\n+ * maps real source IDs to their actual input\n+ */\n+ idSources: Map<string, ISubscribable<A>>;\n+ /**\n+ * maps (potentially aliased) input IDs to their actual src.id\n+ */\n+ realSourceIDs: Map<string, string>;\n+ /**\n+ * maps real src.id to (potentially aliased) input IDs\n+ */\n+ invRealSourceIDs: Map<string, string>;\n+ /**\n+ * set of (potentially aliased) input IDs\n+ * these IDs are used to label inputs in result tuple\n+ */\nsourceIDs: Set<string>;\nautoClose: boolean;\n@@ -73,6 +93,9 @@ export class StreamSync<A, B> extends Subscription<A, B> {\n}\nsuper(null, xform, null, opts.id || `streamsync-${Subscription.NEXT_ID++}`);\nthis.sources = new Map();\n+ this.realSourceIDs = new Map();\n+ this.invRealSourceIDs = new Map();\n+ this.idSources = new Map();\nthis.sourceIDs = srcIDs;\nthis.autoClose = opts.close !== false;\nif (opts.src) {\n@@ -80,9 +103,13 @@ export class StreamSync<A, B> extends Subscription<A, B> {\n}\n}\n- add(src: ISubscribable<A>) {\n+ add(src: ISubscribable<A>, id?: string) {\n+ id || (id = src.id);\nthis.ensureState();\n- this.sourceIDs.add(src.id);\n+ this.sourceIDs.add(id);\n+ this.realSourceIDs.set(id, src.id);\n+ this.invRealSourceIDs.set(src.id, id);\n+ this.idSources.set(src.id, src);\nthis.sources.set(\nsrc,\nsrc.subscribe(\n@@ -97,26 +124,39 @@ export class StreamSync<A, B> extends Subscription<A, B> {\ndone: () => this.markDone(src),\n__owner: this\n},\n- labeled<string, A>(src.id),\n- `in-${src.id}`\n+ labeled<string, A>(id),\n+ `in-${id}`\n)\n);\n}\n- addAll(src: ISubscribable<A>[]) {\n+ addAll(src: ISubscribable<A>[] | IObjectOf<ISubscribable<A>>) {\n+ if (isPlainObject(src)) {\n// pre-add all source ids for partitionSync\n- for (let s of src) {\n+ for (let id in src) {\n+ this.sourceIDs.add(id);\n+ }\n+ for (let id in src) {\n+ this.add(src[id], id);\n+ }\n+ } else {\n+ // pre-add all source ids for partitionSync\n+ for (let s of <ISubscribable<A>[]>src) {\nthis.sourceIDs.add(s.id);\n}\nfor (let s of src) {\nthis.add(s);\n}\n}\n+ }\nremove(src: ISubscribable<A>) {\nconst sub = this.sources.get(src);\nif (sub) {\n- this.sourceIDs.delete(src.id);\n+ const id = this.invRealSourceIDs.get(src.id);\n+ this.sourceIDs.delete(id);\n+ this.realSourceIDs.delete(id);\n+ this.idSources.delete(src.id);\nthis.sources.delete(src);\nsub.unsubscribe();\nreturn true;\n@@ -125,10 +165,9 @@ export class StreamSync<A, B> extends Subscription<A, B> {\n}\nremoveID(id: string) {\n- for (let s of this.sources) {\n- if (s[0].id === id) {\n- return this.remove(s[0]);\n- }\n+ const src = this.idSources.get(this.realSourceIDs.get(id));\n+ if (src) {\n+ return this.remove(src);\n}\nreturn false;\n}\n@@ -136,7 +175,7 @@ export class StreamSync<A, B> extends Subscription<A, B> {\nremoveAll(src: ISubscribable<A>[]) {\n// pre-remove all source ids for partitionSync\nfor (let s of src) {\n- this.sourceIDs.delete(s.id);\n+ this.sourceIDs.delete(this.invRealSourceIDs.get(s.id));\n}\nlet ok = true;\nfor (let s of src) {\n@@ -161,6 +200,9 @@ export class StreamSync<A, B> extends Subscription<A, B> {\nthis.state = State.DONE;\nthis.sources.clear();\nthis.sourceIDs.clear();\n+ this.realSourceIDs.clear();\n+ this.invRealSourceIDs.clear();\n+ this.idSources.clear();\n}\nreturn super.unsubscribe(sub);\n}\n", "new_path": "packages/rstream/src/stream-sync.ts", "old_path": "packages/rstream/src/stream-sync.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
perf(rstream): support (re)named StreamSync inputs - update StreamSyncOpts - allow objects as `src` option, use object keys as input IDs - update `add()`, add optional ID arg - add various maps to handle real vs. alias IDs
1
perf
rstream
679,913
24.04.2018 14:28:31
-3,600
3408c137a94f5f41fe771524f605a4006c2da39d
feat(rstream-gestures): allows partial opts, add ID option
[ { "change_type": "MODIFY", "diff": "+import { IID } from \"@thi.ng/api/api\";\nimport { fromEvent } from \"@thi.ng/rstream/from/event\";\nimport { merge, StreamMerge } from \"@thi.ng/rstream/stream-merge\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\n@@ -22,7 +23,7 @@ export interface GestureEvent {\n[1]: GestureInfo;\n}\n-export interface GestureStreamOpts {\n+export interface GestureStreamOpts extends IID<string> {\nzoom: number;\nminZoom: number;\nmaxZoom: number;\n@@ -53,16 +54,18 @@ export interface GestureStreamOpts {\n* @param el\n* @param opts\n*/\n-export function gestureStream(el: Element, opts?: GestureStreamOpts): StreamMerge<any, GestureEvent> {\n+export function gestureStream(el: Element, opts?: Partial<GestureStreamOpts>): StreamMerge<any, GestureEvent> {\nlet isDown = false,\nclickPos: number[];\nopts = Object.assign({\n+ id: \"gestures\",\nzoom: 1,\nminZoom: 0.25,\nmaxZoom: 4,\n}, opts);\nlet zoom = Math.min(Math.max(opts.zoom, opts.minZoom), opts.maxZoom);\nreturn merge({\n+ id: opts.id,\nsrc: [\n\"mousedown\", \"mousemove\", \"mouseup\",\n\"touchstart\", \"touchmove\", \"touchend\", \"touchcancel\",\n", "new_path": "packages/rstream-gestures/src/index.ts", "old_path": "packages/rstream-gestures/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(rstream-gestures): allows partial opts, add ID option
1
feat
rstream-gestures
679,913
24.04.2018 14:34:37
-3,600
e11b9a807f359cdc4773b43e8390e82a9051a6f4
refactor(examples): update rstream-dataflow to use new specs
[ { "change_type": "MODIFY", "diff": "@@ -58,7 +58,7 @@ const graph = initGraph(db, {\n// the `[1, 0]` is the lookup path, i.e. `gesture[1][0]`\nmpos: {\nfn: extract([1, \"pos\"]),\n- ins: [{ stream: () => gestures }],\n+ ins: { src: { stream: () => gestures } },\nout: \"mpos\"\n},\n@@ -67,7 +67,7 @@ const graph = initGraph(db, {\n// (only defined during drag gestures)\nclickpos: {\nfn: extract([1, \"click\"]),\n- ins: [{ stream: () => gestures }],\n+ ins: { src: { stream: () => gestures } },\nout: \"clickpos\"\n},\n@@ -82,7 +82,7 @@ const graph = initGraph(db, {\nreturn delta && Math.hypot.apply(null, delta) | 0;\n}\n)),\n- ins: [{ stream: () => gestures }],\n+ ins: { src: { stream: () => gestures } },\nout: \"dist\"\n},\n@@ -100,11 +100,11 @@ const graph = initGraph(db, {\ncircle(color, click[0], click[1], radius * 2) :\nundefined\n)),\n- ins: [\n- { stream: \"clickpos\", id: \"click\" },\n- { stream: \"radius\", id: \"radius\" },\n- { stream: \"color\", id: \"color\" },\n- ],\n+ ins: {\n+ click: { stream: \"clickpos\" },\n+ radius: { stream: \"radius\" },\n+ color: { stream: \"color\" },\n+ },\nout: \"circle\"\n},\n@@ -119,7 +119,7 @@ const graph = initGraph(db, {\ndedupe(equiv),\nmap((x) => x && colors.next().value)\n)),\n- ins: [{ stream: \"clickpos\" }],\n+ ins: { src: { stream: \"clickpos\" } },\nout: \"color\"\n},\n@@ -127,7 +127,7 @@ const graph = initGraph(db, {\n// into a sine wave with 0.6 .. 1.0 interval\nsine: {\nfn: node1(map((x: number) => 0.8 + 0.2 * Math.sin(x * 0.05))),\n- ins: [{ stream: () => raf }],\n+ ins: { src: { stream: () => raf } },\nout: \"sin\"\n},\n@@ -135,7 +135,10 @@ const graph = initGraph(db, {\n// radius value for `circle`\nradius: {\nfn: mul,\n- ins: [{ stream: \"sine\" }, { stream: \"dist\" }],\n+ ins: {\n+ a: { stream: \"sine\" },\n+ b: { stream: \"dist\" }\n+ },\nout: \"radius\"\n}\n});\n", "new_path": "examples/rstream-dataflow/src/index.ts", "old_path": "examples/rstream-dataflow/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(examples): update rstream-dataflow to use new specs
1
refactor
examples
730,412
24.04.2018 15:16:47
0
e91f87fd1375cc5f283c77b4e76618bfca1ba695
chore: update packages to 1.31.1
[ { "change_type": "MODIFY", "diff": "\"homepage\": \"https://github.com/webex/react-ciscospark#readme\",\n\"main\": \"src/index.js\",\n\"dependencies\": {\n- \"@ciscospark/common\": \"1.28.5\",\n- \"@ciscospark/helper-html\": \"1.28.5\",\n- \"@ciscospark/internal-plugin-conversation\": \"1.28.5\",\n- \"@ciscospark/internal-plugin-encryption\": \"1.28.5\",\n- \"@ciscospark/internal-plugin-feature\": \"1.28.5\",\n- \"@ciscospark/internal-plugin-flag\": \"1.28.5\",\n- \"@ciscospark/internal-plugin-mercury\": \"1.28.5\",\n- \"@ciscospark/internal-plugin-metrics\": \"1.28.5\",\n- \"@ciscospark/internal-plugin-presence\": \"1.28.5\",\n- \"@ciscospark/internal-plugin-search\": \"1.28.5\",\n- \"@ciscospark/internal-plugin-team\": \"1.28.5\",\n- \"@ciscospark/internal-plugin-user\": \"1.28.5\",\n- \"@ciscospark/plugin-authorization\": \"1.28.5\",\n- \"@ciscospark/plugin-logger\": \"1.28.5\",\n- \"@ciscospark/plugin-people\": \"1.28.5\",\n- \"@ciscospark/plugin-phone\": \"1.29.0\",\n- \"@ciscospark/spark-core\": \"1.28.5\",\n- \"@ciscospark/storage-adapter-local-forage\": \"1.28.5\",\n- \"@ciscospark/storage-adapter-local-storage\": \"1.28.5\",\n+ \"@ciscospark/common\": \"1.31.1\",\n+ \"@ciscospark/helper-html\": \"1.31.1\",\n+ \"@ciscospark/internal-plugin-conversation\": \"1.31.1\",\n+ \"@ciscospark/internal-plugin-encryption\": \"1.31.1\",\n+ \"@ciscospark/internal-plugin-feature\": \"1.31.1\",\n+ \"@ciscospark/internal-plugin-flag\": \"1.31.1\",\n+ \"@ciscospark/internal-plugin-mercury\": \"1.31.1\",\n+ \"@ciscospark/internal-plugin-metrics\": \"1.31.1\",\n+ \"@ciscospark/internal-plugin-presence\": \"1.31.1\",\n+ \"@ciscospark/internal-plugin-search\": \"1.31.1\",\n+ \"@ciscospark/internal-plugin-team\": \"1.31.1\",\n+ \"@ciscospark/internal-plugin-user\": \"1.31.1\",\n+ \"@ciscospark/plugin-authorization\": \"1.31.1\",\n+ \"@ciscospark/plugin-logger\": \"1.31.1\",\n+ \"@ciscospark/plugin-people\": \"1.31.1\",\n+ \"@ciscospark/plugin-phone\": \"1.31.1\",\n+ \"@ciscospark/spark-core\": \"1.31.1\",\n+ \"@ciscospark/storage-adapter-local-forage\": \"1.31.1\",\n+ \"@ciscospark/storage-adapter-local-storage\": \"1.31.1\",\n\"ampersand-events\": \"^2.0.2\",\n\"classnames\": \"^2.2.5\",\n\"core-decorators\": \"^0.20.0\",\n\"devDependencies\": {\n\"@ciscospark/eslint-config-base\": \"^0.6.1\",\n\"@ciscospark/eslint-config-react\": \"^0.6.1\",\n- \"@ciscospark/test-helper-appid\": \"1.28.5\",\n- \"@ciscospark/test-helper-file\": \"1.28.5\",\n- \"@ciscospark/test-helper-server\": \"1.28.5\",\n- \"@ciscospark/test-helper-test-users\": \"1.28.5\",\n+ \"@ciscospark/test-helper-appid\": \"1.31.1\",\n+ \"@ciscospark/test-helper-file\": \"1.31.1\",\n+ \"@ciscospark/test-helper-server\": \"1.31.1\",\n+ \"@ciscospark/test-helper-test-users\": \"1.31.1\",\n\"axe-core\": \"^2.3.1\",\n\"babel-cli\": \"^6.22.2\",\n\"babel-core\": \"^6.22.1\",\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
MIT License
webex/react-widgets
chore: update @ciscospark packages to 1.31.1
1
chore
null
815,745
24.04.2018 15:41:18
-10,800
c07351cf70185113e4b7ec653763da6d2f52f36a
fix: use width for dropdown panel
[ { "change_type": "MODIFY", "diff": "@@ -268,8 +268,9 @@ export class ItemsList {\n}\nprivate _groupBy(items: NgOption[], prop: string | Function): OptionGroups {\n+ const isFn = isFunction(this._ngSelect.groupBy);\nconst groups = items.reduce((grouped, item) => {\n- const key = isFunction(prop) ? (<Function>prop).apply(this, [item.value]) : item.value[<string>prop];\n+ const key = isFn ? (<Function>prop).apply(this, [item.value]) : item.value[<string>prop];\nconst group = grouped.get(key);\nif (group) {\ngroup.push(item);\n@@ -282,6 +283,7 @@ export class ItemsList {\n}\nprivate _flatten(groups: OptionGroups) {\n+ const isFn = isFunction(this._ngSelect.groupBy);\nlet i = 0;\nreturn Array.from(groups.keys()).reduce((items: NgOption[], key: string) => {\n@@ -292,7 +294,7 @@ export class ItemsList {\ndisabled: !this._ngSelect.selectableGroup,\nhtmlId: newId()\n};\n- const groupKey = isFunction(this._ngSelect.groupBy) ? this._ngSelect.bindLabel : this._ngSelect.groupBy;\n+ const groupKey = isFn ? this._ngSelect.bindLabel : this._ngSelect.groupBy;\nparent.value = { [groupKey]: key };\nitems.push(parent);\ni++;\n", "new_path": "src/ng-select/items-list.ts", "old_path": "src/ng-select/items-list.ts" }, { "change_type": "MODIFY", "diff": "@@ -340,8 +340,7 @@ export class NgDropdownPanelComponent implements OnInit, OnChanges, OnDestroy, A\ndropdownPanel.style.top = offsetTop + topDelta + 'px';\ndropdownPanel.style.bottom = 'auto';\ndropdownPanel.style.left = offsetLeft + 'px';\n- dropdownPanel.style.minWidth = selectRect.width + 'px';\n- dropdownPanel.style.width = 'auto';\n+ dropdownPanel.style.width = selectRect.width + 'px';\n}\nprivate _whenContentReady(): Promise<void> {\n", "new_path": "src/ng-select/ng-dropdown-panel.component.ts", "old_path": "src/ng-select/ng-dropdown-panel.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: use width for dropdown panel
1
fix
null
815,745
24.04.2018 16:05:42
-10,800
75a3ee55ca0450fd7037cd555dac8c7cebc0d5dd
chore(release): 1.1.3
[ { "change_type": "MODIFY", "diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"1.1.3\"></a>\n+## [1.1.3](https://github.com/ng-select/ng-select/compare/v1.1.2...v1.1.3) (2018-04-24)\n+\n+\n+\n<a name=\"1.1.2\"></a>\n## [1.1.2](https://github.com/ng-select/ng-select/compare/v1.1.1...v1.1.2) (2018-04-24)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"$schema\": \"../node_modules/ng-packagr/package.schema.json\",\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"1.1.2\",\n+ \"version\": \"1.1.3\",\n\"description\": \"Angular ng-select - All in One UI Select, Multiselect and Autocomplete\",\n\"author\": \"@ng-select/ng-select\",\n\"license\": \"MIT\",\n", "new_path": "src/package.json", "old_path": "src/package.json" } ]
TypeScript
MIT License
ng-select/ng-select
chore(release): 1.1.3
1
chore
release
679,913
24.04.2018 16:08:33
-3,600
2b9a8883e6fbbf7b98158a10c62dad52b7d60f12
refactor(rstream-graph): extract ensureInputs(), update docs
[ { "change_type": "MODIFY", "diff": "@@ -18,8 +18,13 @@ export type GraphSpec = IObjectOf<NodeSpec>;\n* combine the inputs and produce values for the node's result stream.\n*\n* The `fn` function is responsible to produce such a stream construct.\n+ * The keys used to specify inputs in the `ins` object are dictated by\n+ * the actual node `fn` used. Most node functions with multiple inputs\n+ * are implemented as `StreamSync` instances and the input IDs are used\n+ * to locally rename input streams within the `StreamSync` container.\n*\n- * See `initGraph` and `nodeFromSpec` for more details (in /src/nodes.ts)\n+ * See `initGraph` and `nodeFromSpec` for more details (in\n+ * /src/nodes.ts)\n*/\nexport interface NodeSpec {\nfn: NodeFactory<any>;\n@@ -67,11 +72,6 @@ export interface NodeSpec {\n*\n* If the optional `xform` is given, a subscription with the transducer\n* is added to the input and then used as input instead.\n- *\n- * If the optional `id` is specified, a dummy subscription with the ID\n- * is added to the input and used as input instead. This allows for\n- * local renaming of inputs and is needed for some ops (e.g.\n- * `StreamSync` based nodes).\n*/\nexport interface NodeInput {\nid?: string;\n", "new_path": "packages/rstream-graph/src/api.ts", "old_path": "packages/rstream-graph/src/api.ts" }, { "change_type": "MODIFY", "diff": "@@ -89,25 +89,16 @@ export const removeNode = (graph: IObjectOf<ISubscribable<any>>, id: string) =>\n/**\n* Higher order node / stream creator. Takes a transducer and (optional)\n* required input stream IDs. The returned function takes an object of\n- * input streams and returns a new\n- * @thi.ng/rstream/StreamSync instance. The returned function will throw\n- * an error if `inputIDs` is given and the object of inputs does contain\n- * all of them.\n+ * input streams and returns a new `StreamSync` instance. The returned\n+ * function will throw an error if `inputIDs` is given and the object of\n+ * inputs does not contain all of them.\n*\n* @param xform\n* @param inputIDs\n*/\nexport const node = (xform: Transducer<IObjectOf<any>, any>, inputIDs?: string[]): NodeFactory<any> =>\n(src: IObjectOf<ISubscribable<any>>, id: string): StreamSync<any, any> => {\n- if (inputIDs !== undefined) {\n- const missing: string[] = [];\n- for (let i of inputIDs) {\n- !src[i] && missing.push(i);\n- }\n- if (missing.length) {\n- illegalArgs(`node \"${id}\": missing inputs: ${missing.join(\", \")}`);\n- }\n- }\n+ ensureInputs(src, inputIDs, id);\nreturn sync({ src, xform, reset: false, id });\n};\n@@ -120,7 +111,26 @@ export const node = (xform: Transducer<IObjectOf<any>, any>, inputIDs?: string[]\n*/\nexport const node1 = (xform: Transducer<any, any>, inputID = \"src\"): NodeFactory<any> =>\n(src: IObjectOf<ISubscribable<any>>, id: string): Subscription<any, any> => {\n- const input = src[inputID];\n- !input && illegalArgs(`node \"${id}\": missing input: ${inputID}`);\n- return input.subscribe(xform, id);\n+ ensureInputs(src, [inputID], id);\n+ return src[inputID].subscribe(xform, id);\n+ };\n+\n+/**\n+ * Helper function to verify given object of inputs has required input IDs.\n+ * Throws error if validation fails.\n+ *\n+ * @param src\n+ * @param inputIDs\n+ * @param nodeID\n+ */\n+export const ensureInputs = (src: IObjectOf<ISubscribable<any>>, inputIDs: string[], nodeID: string) => {\n+ if (inputIDs !== undefined) {\n+ const missing: string[] = [];\n+ for (let i of inputIDs) {\n+ !src[i] && missing.push(i);\n+ }\n+ if (missing.length) {\n+ illegalArgs(`node \"${nodeID}\": missing input(s): ${missing.join(\", \")}`);\n+ }\n+ }\n};\n", "new_path": "packages/rstream-graph/src/graph.ts", "old_path": "packages/rstream-graph/src/graph.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(rstream-graph): extract ensureInputs(), update docs
1
refactor
rstream-graph
679,913
24.04.2018 16:10:00
-3,600
32fb7ff94fba8f0cdf2ad2fdf7b4f0047a97f70c
docs(rstream-graph): update readme
[ { "change_type": "MODIFY", "diff": "@@ -35,19 +35,19 @@ const graph = rsg.initGraph(state, {\n// from values in the state atom\nadd: {\nfn: rsg.add,\n- ins: [\n- { path: \"a\" },\n- { path: \"b\" }\n- ],\n+ ins: {\n+ a: { path: \"a\" },\n+ b: { path: \"b\" }\n+ },\n},\n// this node receives values from the `add` node\n// and the given iterable\nmul: {\nfn: rsg.mul,\n- ins: [\n- { stream: \"add\" },\n- { stream: () => rs.fromIterable([10, 20, 30]) }\n- ],\n+ ins: {\n+ a: { stream: \"add\" },\n+ b: { stream: () => rs.fromIterable([10, 20, 30]) }\n+ },\n}\n});\n", "new_path": "packages/rstream-graph/README.md", "old_path": "packages/rstream-graph/README.md" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(rstream-graph): update readme
1
docs
rstream-graph
730,414
24.04.2018 16:31:08
14,400
e84436ada8a9e3853c2108552cc44c3da0b754e3
feat(widget-space): add selector for other user
[ { "change_type": "MODIFY", "diff": "@@ -12,17 +12,28 @@ const getOwnProps = (state, ownProps) => ownProps;\n/**\n* Get the other user in the 1:1 conversation.\n- * @param {convesation} conversation\n+ * @param {conversation} conversation\n* @param {participant} currentUser\n* @returns {participant}\n*/\n-function getToUser(conversation, currentUser) {\n+export function getToUser(conversation, currentUser) {\nreturn conversation\n.get('participants')\n.filter((participant) => participant.get('id') !== currentUser.id)\n.first();\n}\n+export const getToUserSelector = createSelector(\n+ [getConversation, getCurrentUser],\n+ /* eslint arrow-body-style: [0] */\n+ (conversation, currentUser) => {\n+ return conversation\n+ .get('participants')\n+ .filter((participant) => participant.get('id') !== currentUser.id)\n+ .first();\n+ }\n+);\n+\nexport const getSpaceDetails = createSelector(\n[getWidget, getConversation, getUsers, getCurrentUser],\n(widget, conversation, users, currentUser) => {\n", "new_path": "packages/node_modules/@ciscospark/widget-space/src/selector.js", "old_path": "packages/node_modules/@ciscospark/widget-space/src/selector.js" } ]
JavaScript
MIT License
webex/react-widgets
feat(widget-space): add selector for other user
1
feat
widget-space
679,913
24.04.2018 16:33:07
-3,600
7ffaa615ca9604e8816617209b54c5046433d28f
feat(rstream-dot): add xform edge labels, extract types to api.ts
[ { "change_type": "ADD", "diff": "+import { ISubscribable } from \"@thi.ng/rstream\";\n+\n+export interface IToDot {\n+ toDot(opts?: Partial<DotOpts>): string;\n+}\n+\n+export type NodeType =\n+ \"default\" |\n+ \"noid\" |\n+ \"stream\" |\n+ \"streammerge\" |\n+ \"streamsync\";\n+\n+export interface Node {\n+ id: number;\n+ label: string;\n+ type: string;\n+ xform: boolean;\n+}\n+\n+export interface WalkState {\n+ subs: Map<ISubscribable<any>, Node>;\n+ rels: Node[][];\n+ id: number;\n+}\n+\n+export interface DotOpts {\n+ dir: string;\n+ font: string;\n+ fontsize: string;\n+ text: string;\n+ color: Record<NodeType, string>;\n+}\n", "new_path": "packages/rstream-dot/src/api.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "-import { Subscription, StreamSync, StreamMerge, Stream } from \"@thi.ng/rstream\";\n+import { ISubscribable, StreamSync, StreamMerge, Stream } from \"@thi.ng/rstream\";\n-export type NodeType =\n- \"default\" |\n- \"noid\" |\n- \"stream\" |\n- \"streammerge\" |\n- \"streamsync\";\n+import { DotOpts, Node, WalkState } from \"./api\";\n-export interface Node {\n- id: number;\n- label: string;\n- type: string;\n-}\n-\n-export interface WalkState {\n- subs: Map<Subscription<any, any>, Node>;\n- rels: Node[][];\n- id: number;\n-}\n-\n-export interface DotOpts {\n- font: string;\n- fontsize: string;\n- text: string;\n- color: Record<NodeType, string>;\n-}\n+export * from \"./api\";\n-const getNodeType = (sub: Subscription<any, any>) => {\n+const getNodeType = (sub: ISubscribable<any>) => {\nif (sub instanceof Stream) {\nreturn \"Stream\";\n}\n@@ -53,12 +31,20 @@ const dotNode = (s: Node, opts: DotOpts) => {\nreturn res + \"];\"\n};\n-export const walk = (subs: Subscription<any, any>[], state?: WalkState) => {\n+const dotEdge = (a: Node, b: Node, _: DotOpts) => {\n+ let res = `s${a.id} -> s${b.id}`;\n+ if (b.xform) {\n+ res += `[label=\"xform\"]`;\n+ }\n+ return res + \";\"\n+};\n+\n+export const walk = (subs: ISubscribable<any>[], state?: WalkState) => {\nstate || (state = { id: 0, subs: new Map(), rels: [] });\nfor (let sub of subs) {\nif (state.subs.get(sub)) return state;\nconst id = state.id;\n- const desc = { id, label: sub.id || \"<noid>\", type: getNodeType(sub) };\n+ const desc: Node = { id, label: sub.id || \"<noid>\", type: getNodeType(sub), xform: !!(<any>sub).xform };\nstate.subs.set(sub, desc);\nstate.id++;\nconst children = (<any>sub).subs ||\n@@ -66,9 +52,9 @@ export const walk = (subs: Subscription<any, any>[], state?: WalkState) => {\n[(<any>sub).__owner] :\nundefined);\nif (children) {\n- for (let s of children) {\n- walk([s], state);\n- state.rels.push([desc, state.subs.get(s)]);\n+ walk(children, state);\n+ for (let c of children) {\n+ state.rels.push([desc, state.subs.get(c)]);\n}\n}\n}\n@@ -77,6 +63,7 @@ export const walk = (subs: Subscription<any, any>[], state?: WalkState) => {\nexport const toDot = (state: WalkState, opts?: Partial<DotOpts>) => {\nopts = Object.assign({\n+ dir: \"LR\",\nfont: \"Inconsolata\",\nfontsize: 11,\ntext: \"white\",\n@@ -90,9 +77,11 @@ export const toDot = (state: WalkState, opts?: Partial<DotOpts>) => {\n}, opts);\nreturn [\n\"digraph g {\",\n+ `rankdir=${opts.dir};`,\n`node[fontname=${opts.font},fontsize=${opts.fontsize},style=filled,fontcolor=${opts.text}];`,\n+ `edge[fontname=${opts.font},fontsize=${opts.fontsize}];`,\n...[...state.subs.values()].map((n) => dotNode(n, <DotOpts>opts)),\n- ...state.rels.map(([a, b]) => `s${a.id} -> s${b.id};`),\n+ ...state.rels.map((r) => dotEdge(r[0], r[1], <DotOpts>opts)),\n\"}\"\n].join(\"\\n\");\n};\n\\ No newline at end of file\n", "new_path": "packages/rstream-dot/src/index.ts", "old_path": "packages/rstream-dot/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(rstream-dot): add xform edge labels, extract types to api.ts
1
feat
rstream-dot
730,414
24.04.2018 16:33:37
14,400
b0f7f0e1c5f44da63f9b049259574d04b759b79e
test(widget-space): add function test
[ { "change_type": "ADD", "diff": "+import {fromJS} from 'immutable';\n+\n+import {getToUser} from './selector';\n+\n+describe('widget-space selectors', () => {\n+ it('gets the \"to user\"', () => {\n+ const currentUser = {\n+ entryEmail: 'qtcrabfq6f@2cecfb0e-f9fc-45cb-b8fc-1f9ebf87209b',\n+ displayName: 'User-qTCRABFq6f',\n+ entryUUID: '1c8ce4a0-df7b-4e62-8020-a1a430581e51',\n+ emailAddress: 'qtcrabfq6f@2cecfb0e-f9fc-45cb-b8fc-1f9ebf87209b',\n+ objectType: 'person',\n+ type: 'APPUSER',\n+ id: '1c8ce4a0-df7b-4e62-8020-a1a430581e51',\n+ orgId: '2cecfb0e-f9fc-45cb-b8fc-1f9ebf87209b'\n+ };\n+ const otherUser = {\n+ entryEmail: 'ccwexpress@sparkbot.io',\n+ displayName: 'Nakia - Personal Assistant',\n+ entryUUID: '889869a1-f5b9-408b-a514-12704f02817a',\n+ emailAddress: 'ccwexpress@sparkbot.io',\n+ objectType: 'person',\n+ type: 'ROBOT',\n+ id: '889869a1-f5b9-408b-a514-12704f02817a',\n+ orgId: '1eb65fdf-9643-417f-9974-ad72cae0e10f'\n+ };\n+\n+ const mockedConversation = fromJS({\n+ participants: [currentUser, otherUser]\n+ });\n+\n+ // const toUserSelector = getToUserSelector.resultFunc(mockedConversation, currentUser);\n+ const toUser = getToUser(mockedConversation, currentUser);\n+ expect(toUser.get('id')).toBe(toUser.id);\n+ });\n+});\n", "new_path": "packages/node_modules/@ciscospark/widget-space/src/selector.test.js", "old_path": null } ]
JavaScript
MIT License
webex/react-widgets
test(widget-space): add function test
1
test
widget-space
679,913
24.04.2018 16:39:21
-3,600
a68eca0b416dce1538204b84a1983e9de0584662
feat(rstream-query): add IToDot impl for graphviz conversion/viz
[ { "change_type": "MODIFY", "diff": "+import { IObjectOf } from \"@thi.ng/api/api\";\nimport { equiv } from \"@thi.ng/api/equiv\";\nimport { intersection } from \"@thi.ng/associative/intersection\";\nimport { Stream, Subscription, sync } from \"@thi.ng/rstream\";\n+import { toDot, walk, DotOpts, IToDot } from \"@thi.ng/rstream-dot\";\nimport { Transducer, Reducer } from \"@thi.ng/transducers/api\";\nimport { compR } from \"@thi.ng/transducers/func/compr\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\nimport { DEBUG, Edit, Fact, FactIds, Pattern } from \"./api\";\n-import { IObjectOf } from \"@thi.ng/api/api\";\n-export class FactGraph {\n+export class FactGraph implements\n+ IToDot {\nstatic NEXT_ID = 0;\n@@ -96,6 +98,10 @@ export class FactGraph {\nreturn results;\n}\n+ toDot(opts?: Partial<DotOpts>) {\n+ return toDot(walk([this.streamS, this.streamP, this.streamO, this.streamAll]), opts);\n+ }\n+\nprotected findInIndices(s: FactIds, p: FactIds, o: FactIds, f: Fact) {\nif (s && p && o) {\nconst facts = this.facts;\n", "new_path": "packages/rstream-query/src/graph.ts", "old_path": "packages/rstream-query/src/graph.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(rstream-query): add IToDot impl for graphviz conversion/viz
1
feat
rstream-query
791,723
24.04.2018 16:40:23
25,200
d18e977caca06fb7cd37167a4911c396ce5237c8
report: score gauges, metrics display, add rich tooltips
[ { "change_type": "MODIFY", "diff": "@@ -235,26 +235,19 @@ class CategoryRenderer {\n*/\nrenderScoreGauge(category) {\nconst tmpl = this.dom.cloneTemplate('#tmpl-lh-gauge', this.templateContext);\n- this.dom.find('.lh-gauge__wrapper', tmpl).href = `#${category.id}`;\n- this.dom.find('.lh-gauge__label', tmpl).textContent = category.name;\n-\n- const scoreOutOf100 = Math.round(category.score * 100);\n- const fillRotation = Math.floor((scoreOutOf100 / 100) * 180);\n+ const wrapper = this.dom.find('.lh-gauge__wrapper', tmpl);\n+ wrapper.href = `#${category.id}`;\n+ wrapper.classList.add(`lh-gauge__wrapper--${Util.calculateRating(category.score)}`);\nconst gauge = this.dom.find('.lh-gauge', tmpl);\n- gauge.setAttribute('data-progress', scoreOutOf100); // .dataset not supported in jsdom.\n- gauge.classList.add(`lh-gauge--${Util.calculateRating(category.score)}`);\n-\n- this.dom.findAll('.lh-gauge__fill', gauge).forEach(el => {\n- el.style.transform = `rotate(${fillRotation}deg)`;\n- });\n-\n- this.dom.find('.lh-gauge__mask--full', gauge).style.transform =\n- `rotate(${fillRotation}deg)`;\n- this.dom.find('.lh-gauge__fill--fix', gauge).style.transform =\n- `rotate(${fillRotation * 2}deg)`;\n- this.dom.find('.lh-gauge__percentage', gauge).textContent = scoreOutOf100;\n+ // 329 is ~= 2 * Math.PI * gauge radius (53)\n+ // https://codepen.io/xgad/post/svg-radial-progress-meters\n+ // score of 50: `stroke-dasharray: 164.5 329`;\n+ this.dom.find('.lh-gauge-arc', gauge).style.strokeDasharray = `${category.score * 329} 329`;\n+ const scoreOutOf100 = Math.round(category.score * 100);\n+ this.dom.find('.lh-gauge__percentage', tmpl).textContent = scoreOutOf100;\n+ this.dom.find('.lh-gauge__label', tmpl).textContent = category.name;\nreturn tmpl;\n}\n", "new_path": "lighthouse-core/report/v2/renderer/category-renderer.js", "old_path": "lighthouse-core/report/v2/renderer/category-renderer.js" }, { "change_type": "MODIFY", "diff": "class PerformanceCategoryRenderer extends CategoryRenderer {\n/**\n* @param {!ReportRenderer.AuditJSON} audit\n- * @param {number} scale\n* @return {!Element}\n*/\n- _renderTimelineMetricAudit(audit, scale) {\n- const tmpl = this.dom.cloneTemplate('#tmpl-lh-timeline-metric', this.templateContext);\n- const element = this.dom.find('.lh-timeline-metric', tmpl);\n- element.classList.add(`lh-timeline-metric--${Util.calculateRating(audit.result.score)}`);\n+ _renderMetric(audit) {\n+ const tmpl = this.dom.cloneTemplate('#tmpl-lh-perf-metric', this.templateContext);\n+ const element = this.dom.find('.lh-perf-metric', tmpl);\n+ element.classList.add(`lh-perf-metric--${Util.calculateRating(audit.result.score)}`);\n- const titleEl = this.dom.find('.lh-timeline-metric__title', tmpl);\n+ const titleEl = this.dom.find('.lh-perf-metric__title', tmpl);\ntitleEl.textContent = audit.result.description;\n- const valueEl = this.dom.find('.lh-timeline-metric__value', tmpl);\n+ const valueEl = this.dom.find('.lh-perf-metric__value span', tmpl);\nvalueEl.textContent = audit.result.displayValue;\n- const descriptionEl = this.dom.find('.lh-timeline-metric__description', tmpl);\n+ const descriptionEl = this.dom.find('.lh-perf-metric__description', tmpl);\ndescriptionEl.appendChild(this.dom.convertMarkdownLinkSnippets(audit.result.helpText));\nif (typeof audit.result.rawValue !== 'number') {\n@@ -33,9 +32,6 @@ class PerformanceCategoryRenderer extends CategoryRenderer {\nreturn element;\n}\n- const sparklineBarEl = this.dom.find('.lh-sparkline__bar', tmpl);\n- sparklineBarEl.style.width = `${audit.result.rawValue / scale * 100}%`;\n-\nreturn element;\n}\n@@ -119,38 +115,37 @@ class PerformanceCategoryRenderer extends CategoryRenderer {\nconst metricAudits = category.audits.filter(audit => audit.group === 'perf-metric');\nconst metricAuditsEl = this.renderAuditGroup(groups['perf-metric'], {expandable: false});\n- const timelineContainerEl = this.dom.createChildOf(metricAuditsEl, 'div',\n- 'lh-timeline-container');\n- const timelineEl = this.dom.createChildOf(timelineContainerEl, 'div', 'lh-timeline');\n-\n- let perfTimelineScale = 0;\n- metricAudits.forEach(audit => {\n- if (typeof audit.result.rawValue === 'number' && audit.result.rawValue) {\n- perfTimelineScale = Math.max(perfTimelineScale, audit.result.rawValue);\n- }\n+\n+ // Metrics\n+ const keyMetrics = metricAudits.filter(a => a.weight >= 3);\n+ const otherMetrics = metricAudits.filter(a => a.weight < 3);\n+\n+ const metricsBoxesEl = this.dom.createChildOf(metricAuditsEl, 'div', 'lh-metrics-container');\n+ const metricsColumn1El = this.dom.createChildOf(metricsBoxesEl, 'div', 'lh-metrics-column');\n+ const metricsColumn2El = this.dom.createChildOf(metricsBoxesEl, 'div', 'lh-metrics-column');\n+\n+ keyMetrics.forEach(item => {\n+ metricsColumn1El.appendChild(this._renderMetric(item));\n+ });\n+ otherMetrics.forEach(item => {\n+ metricsColumn2El.appendChild(this._renderMetric(item));\n});\n+ // Filmstrip\n+ const timelineEl = this.dom.createChildOf(metricAuditsEl, 'div', 'lh-timeline');\nconst thumbnailAudit = category.audits.find(audit => audit.id === 'screenshot-thumbnails');\nconst thumbnailResult = thumbnailAudit && thumbnailAudit.result;\nif (thumbnailResult && thumbnailResult.details) {\nconst thumbnailDetails = /** @type {!DetailsRenderer.FilmstripDetails} */\n(thumbnailResult.details);\n- perfTimelineScale = Math.max(perfTimelineScale, thumbnailDetails.scale);\nconst filmstripEl = this.detailsRenderer.render(thumbnailDetails);\ntimelineEl.appendChild(filmstripEl);\n}\n- metricAudits.forEach(item => {\n- if (item.id === 'speed-index' || item.id === 'estimated-input-latency') {\n- return metricAuditsEl.appendChild(this.renderAudit(item));\n- }\n-\n- timelineEl.appendChild(this._renderTimelineMetricAudit(item, perfTimelineScale));\n- });\n-\nmetricAuditsEl.open = true;\nelement.appendChild(metricAuditsEl);\n+ // Opportunities\nconst hintAudits = category.audits\n.filter(audit => audit.group === 'perf-hint' && audit.result.score < 1)\n.sort((auditA, auditB) => auditB.result.rawValue - auditA.result.rawValue);\n@@ -163,6 +158,7 @@ class PerformanceCategoryRenderer extends CategoryRenderer {\nelement.appendChild(hintAuditsEl);\n}\n+ // Diagnostics\nconst infoAudits = category.audits\n.filter(audit => audit.group === 'perf-info' && audit.result.score < 1);\nif (infoAudits.length) {\n", "new_path": "lighthouse-core/report/v2/renderer/performance-category-renderer.js", "old_path": "lighthouse-core/report/v2/renderer/performance-category-renderer.js" }, { "change_type": "MODIFY", "diff": "@@ -171,6 +171,9 @@ class ReportRenderer {\ncategories.appendChild(renderer.render(category, report.reportGroups));\n}\n+ const scoreScale = this._dom.cloneTemplate('#tmpl-lh-scorescale', this._templateContext);\n+ scoreHeader.appendChild(scoreScale);\n+\nreportSection.appendChild(this._renderReportFooter(report));\nreturn container;\n", "new_path": "lighthouse-core/report/v2/renderer/report-renderer.js", "old_path": "lighthouse-core/report/v2/renderer/report-renderer.js" }, { "change_type": "MODIFY", "diff": "--expandable-indent: 20px;\n--secondary-text-color: #565656;\n/*--accent-color: #3879d9;*/\n- --fail-color: #df332f;\n- --pass-color: #2b882f;\n+ --fail-color: hsl(1, 73%, 45%);\n+ --average-color: hsl(31, 100%, 45%); /* md orange 800 */\n+ --pass-color: hsl(139, 70%, 30%);\n--informative-color: #0c50c7;\n- --manual-color: #757575;\n- --average-color: #ef6c00; /* md orange 800 */\n+ --medium-75-gray: #757575;\n--warning-color: #ffab00; /* md amber a700 */\n--report-border-color: #ccc;\n--report-secondary-border-color: #ebebeb;\n@@ -174,7 +174,7 @@ summary {\nword-break: break-word;\ncolor: hsl(174, 100%, 27%);\n}\n-span.lh-node:hover {\n+.lh-node:hover {\nbackground: hsl(0, 0%, 98%);\nborder-radius: 2px;\n}\n@@ -221,7 +221,7 @@ span.lh-node:hover {\n.lh-score--manual .lh-score__value::after {\nbackground: url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg\"><title>manual</title><path d=\"M2 5h8v2H2z\" fill=\"hsl(0, 0%, 100%)\" fill-rule=\"evenodd\"/></svg>') no-repeat 50% 50%;\nbackground-size: 18px;\n- background-color: var(--manual-color);\n+ background-color: var(--medium-75-gray);\nwidth: 20px;\nheight: 20px;\nposition: relative;\n@@ -362,78 +362,82 @@ span.lh-node:hover {\n/* Perf Timeline Metric */\n-.lh-timeline-metric {\n+.lh-metrics-container {\n+ display: flex;\n+}\n+\n+.lh-metrics-column {\n+ flex: 1;\n+ margin-right: 20px;\n+}\n+\n+.lh-perf-metric {\nposition: relative;\n- margin-bottom: calc(2 * var(--lh-audit-vpadding));\n- padding-top: var(--lh-audit-vpadding);\n+ display: flex;\n+ justify-content: space-between;\n+\n+ padding: calc(2 * var(--lh-audit-vpadding)) 0;\nborder-top: 1px solid var(--report-secondary-border-color);\n}\n-.lh-timeline-metric__header {\n+.lh-perf-metric__header {\ndisplay: flex;\n}\n-.lh-timeline-metric__details {\n+.lh-perf-metric__details {\norder: -1;\n}\n-.lh-timeline-metric__title {\n+.lh-perf-metric__title {\nfont-size: var(--body-font-size);\nline-height: var(--body-line-height);\ndisplay: flex;\n}\n-.lh-timeline-metric__name {\n+.lh-perf-metric__name {\nflex: 1;\n}\n-.lh-timeline-metric__description {\n+.lh-perf-metric__description {\ncolor: var(--secondary-text-color);\n}\n-.lh-timeline-metric__value {\n- width: var(--lh-audit-score-width);\n- text-align: right;\n-}\n-.lh-timeline-metric--pass .lh-timeline-metric__value {\n+.lh-perf-metric--pass .lh-perf-metric__value {\ncolor: var(--pass-color);\n}\n-.lh-timeline-metric--average .lh-timeline-metric__value {\n- color: var(--average-color);\n+.lh-perf-metric .lh-perf-metric__value span::after {\n+ content: '';\n+ width: var(--body-font-size);\n+ height: var(--body-font-size);\n+ background-size: contain;\n+ display: inline-block;\n+ vertical-align: text-bottom;\n+ margin-left: calc(var(--body-font-size) / 2);\n}\n-.lh-timeline-metric--fail .lh-timeline-metric__value {\n- color: var(--fail-color);\n+.lh-perf-metric--pass .lh-perf-metric__value span::after {\n+ background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\"><title>check</title><path fill=\"hsl(139, 70%, 30%)\" d=\"M24 4C12.95 4 4 12.95 4 24c0 11.04 8.95 20 20 20 11.04 0 20-8.96 20-20 0-11.05-8.96-20-20-20zm-4 30L10 24l2.83-2.83L20 28.34l15.17-15.17L38 16 20 34z\"/></svg>') no-repeat 50% 50%;\n}\n-.lh-timeline-metric__sparkline {\n- position: absolute;\n- left: 0;\n- right: 0;\n- top: -1px;\n- height: 3px;\n- width: 100%;\n-}\n-.lh-timeline-metric__sparkline .lh-sparkline__bar {\n- float: none;\n+.lh-perf-metric--average .lh-perf-metric__value {\n+ color: var(--average-color);\n}\n-\n-.lh-timeline-metric--pass .lh-sparkline__bar {\n- background: var(--pass-color);\n+.lh-perf-metric--average .lh-perf-metric__value span::after {\n+ background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\"><title>info</title><path fill=\"hsl(31, 100%, 45%)\" d=\"M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm2 30h-4V22h4v12zm0-16h-4v-4h4v4z\"/></svg>') no-repeat 50% 50%;\n}\n-.lh-timeline-metric--average .lh-sparkline__bar {\n- background: var(--average-color);\n-}\n-.lh-timeline-metric--fail .lh-sparkline__bar {\n- background: var(--fail-color);\n+.lh-perf-metric--fail .lh-perf-metric__value {\n+ color: var(--fail-color);\n+}\n+.lh-perf-metric--fail .lh-perf-metric__value span::after {\n+ background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\"><title>warn</title><path fill=\"hsl(1, 73%, 45%)\" d=\"M2 42h44L24 4 2 42zm24-6h-4v-4h4v4zm0-8h-4v-8h4v8z\"/></svg>') no-repeat 50% 50%;\n}\n-.lh-timeline-metric .lh-debug {\n+.lh-perf-metric .lh-debug {\nmargin-left: var(--expandable-indent);\n}\n@@ -583,7 +587,7 @@ span.lh-node:hover {\n}\n/* correlate metric end location with sparkline */\n-.lh-timeline-metric:hover .lh-sparkline__bar::after {\n+.lh-perf-metric:hover .lh-sparkline__bar::after {\ncontent: '';\nheight: 100vh;\nwidth: 2px;\n@@ -722,14 +726,48 @@ span.lh-node:hover {\ndisplay: flex;\njustify-content: center;\noverflow-x: hidden;\n- padding: var(--section-padding);\n+ padding: var(--section-padding) var(--section-padding) calc(var(--section-padding) * 3);\nborder-bottom: 1px solid var(--report-border-color);\n+ position: relative;\n}\n.lh-scores-header__solo {\npadding: 0;\nborder: 0;\n}\n+.lh-scorescale {\n+ position: absolute;\n+ right: var(--section-padding);\n+ bottom: var(--section-padding);\n+ color: var(--medium-75-gray);\n+}\n+\n+.lh-scorescale-range {\n+ margin-left: 10px;\n+}\n+\n+.lh-scorescale-range::before {\n+ content: '';\n+ width: var(--body-font-size);\n+ height: calc(var(--body-font-size) * .60);\n+ border-radius: 4px;\n+ display: inline-block;\n+ margin: 0 5px;\n+}\n+\n+.lh-scorescale-range--pass::before {\n+ background-color: var(--pass-color);\n+}\n+\n+.lh-scorescale-range--average::before {\n+ background-color: var(--average-color);\n+}\n+\n+.lh-scorescale-range--fail::before {\n+ background-color: var(--fail-color);\n+}\n+\n+\n.lh-categories {\nwidth: 100%;\noverflow: hidden;\n@@ -917,4 +955,48 @@ summary.lh-passed-audits-summary {\nobject-fit: contain;\n}\n+\n+/* Tooltip */\n+.tooltip-boundary {\n+ position: relative;\n+}\n+\n+.tooltip {\n+ position: absolute;\n+ display: none; /* Don't retain these layers when not needed */\n+ opacity: 0;\n+}\n+\n+.tooltip-boundary:hover .tooltip {\n+ display: block;\n+ animation: fadeInTooltip 150ms;\n+ animation-fill-mode: forwards;\n+ animation-delay: 500ms;\n+ min-width: 15em;\n+ background: #ffffff;\n+ padding: 15px;\n+ border-radius: 5px;\n+ bottom: 100%;\n+ z-index: 1;\n+ will-change: opacity;\n+}\n+\n+.tooltip::before {\n+ content: \"\";\n+ border: solid transparent;\n+ border-bottom-color: #fff;\n+ border-width: 10px;\n+ position: absolute;\n+ bottom: -20px;\n+ transform: rotate(180deg);\n+ pointer-events: none;\n+}\n+\n+@keyframes fadeInTooltip {\n+ 0% { opacity: 0; }\n+ 75% { opacity: 1; }\n+ 100% { opacity: 1; filter: drop-shadow(1px 0px 1px #aaa) drop-shadow(0px 2px 4px hsla(206, 6%, 25%, 0.15)); }\n+}\n+\n+\n/*# sourceURL=report.styles.css */\n", "new_path": "lighthouse-core/report/v2/report-styles.css", "old_path": "lighthouse-core/report/v2/report-styles.css" }, { "change_type": "MODIFY", "diff": "</div>\n</template>\n+<!-- Lighthouse score scale -->\n+<template id=\"tmpl-lh-scorescale\">\n+ <div class=\"lh-scorescale\">\n+ <span class=\"lh-scorescale-label\">Score scale:</span>\n+ <span class=\"lh-scorescale-range lh-scorescale-range--fail\">0-44</span>\n+ <span class=\"lh-scorescale-range lh-scorescale-range--average\">45-74</span>\n+ <span class=\"lh-scorescale-range lh-scorescale-range--pass\">75-100</span>\n+ </div>\n+</template>\n+\n<!-- Lighthouse category score -->\n<template id=\"tmpl-lh-category-score\">\n<div class=\"lh-score\">\n</div>\n</template>\n-<!-- Lighthouse timeline metric -->\n-<template id=\"tmpl-lh-timeline-metric\">\n- <div class=\"lh-timeline-metric\">\n- <div class=\"lh-timeline-metric__sparkline\">\n- <div class=\"lh-sparkline__bar\"></div>\n- </div>\n- <div class=\"lh-timeline-metric__header\">\n- <div class=\"lh-timeline-metric__value\"><!-- fill me --></div>\n- <details class=\"lh-timeline-metric__details lh-expandable-details\">\n- <summary class=\"lh-timeline-metric__summary lh-expandable-details__summary\">\n- <span class=\"lh-timeline-metric__title\"><!-- fill me --></span>\n- <div class=\"lh-toggle-arrow\" title=\"See audits\"></div>\n- </summary>\n- <div class=\"lh-timeline-metric__description\"><!-- fill me --></div>\n- </details>\n- </div>\n+<!-- Lighthouse perf metric -->\n+<template id=\"tmpl-lh-perf-metric\">\n+\n+ <div class=\"lh-perf-metric tooltip-boundary\">\n+ <span class=\"lh-perf-metric__title\"></span>\n+ <div class=\"lh-perf-metric__value\"><span></span></div>\n+ <div class=\"lh-perf-metric__description tooltip\"></div>\n</div>\n+\n</template>\n<!-- Lighthouse left nav -->\n<!-- Lighthouse score gauge -->\n<template id=\"tmpl-lh-gauge\">\n<style>\n- .lh-gauge {\n+ .lh-gauge__wrapper {\n--circle-size: calc(2.5 * var(--header-font-size));\n--circle-size-half: calc(var(--circle-size) / 2);\n- --circle-background: #ccc;\n- --circle-border-width: 2px;\n+ --circle-background: hsl(216, 12%, 92%);\n+ --circle-border-width: 9;\n--inset-size: calc(var(--circle-size) - 2 * var(--circle-border-width));\n- --inset-color: #fff;\n--transition-length: 1s;\n- width: var(--circle-size);\n- height: var(--circle-size);\n- background-color: var(--circle-background);\n- border-radius: 50%;\n}\n- .lh-gauge--pass {\n+\n+ .lh-gauge__wrapper--pass,\n+ .lh-gauge__wrapper--pass .lh-gauge {\n--circle-color: var(--pass-color);\ncolor: var(--circle-color);\n}\n- .lh-gauge--average {\n+\n+ .lh-gauge__wrapper--average,\n+ .lh-gauge__wrapper--average .lh-gauge {\n--circle-color: var(--average-color);\ncolor: var(--circle-color);\n}\n- .lh-gauge--fail {\n+\n+ .lh-gauge__wrapper--fail,\n+ .lh-gauge__wrapper--fail .lh-gauge {\n--circle-color: var(--fail-color);\ncolor: var(--circle-color);\n}\n- .lh-gauge__mask,\n- .lh-gauge__fill {\n+\n+ .lh-gauge {\n+ max-width: 360px;\n+ max-height: 360px;\n+ stroke-linecap: round;\nwidth: var(--circle-size);\nheight: var(--circle-size);\n- position: absolute;\n- transition: transform var(--transition-length);\n- border-radius: 50%;\n}\n- .lh-gauge__mask {\n- clip: rect(0px, var(--circle-size), var(--circle-size), var(--circle-size-half));\n+\n+ .lh-gauge-base {\n+ fill: none;\n+ stroke: var(--circle-background);\n+ stroke-width: var(--circle-border-width);\n+ }\n+ .lh-gauge-arc {\n+ fill: none;\n+ stroke: var(--circle-color);\n+ stroke-width: var(--circle-border-width);\n+ animation: load-gauge var(--transition-length) ease forwards;\n+ animation-delay: 250ms;\n}\n- .lh-gauge__mask .lh-gauge__fill {\n- clip: rect(0px, var(--circle-size-half), var(--circle-size), 0px);\n- background-color: var(--circle-color);\n- backface-visibility: hidden;\n+\n+ @keyframes load-gauge {\n+ from { stroke-dasharray: 0 329; }\n}\n+\n.lh-gauge__percentage {\n--spacer: calc((var(--circle-size) - var(--inset-size)) / 2);\nwidth: var(--inset-size);\nheight: var(--inset-size);\nposition: absolute;\n- margin-left: var(--spacer);\n- margin-top: var(--spacer);\n- background-color: var(--inset-color);\nborder-radius: inherit;\n- display: flex;\n- align-items: center;\n- justify-content: center;\nfont-size: var(--header-font-size);\n+ text-align: center;\n+ top: calc(var(--circle-size) / 3);\n}\n+\n.lh-gauge__wrapper {\ndisplay: inline-flex;\nalign-items: center;\nflex-direction: column;\ntext-decoration: none;\n- color: inherit;\nflex: 1;\nmin-width: auto;\nposition: relative;\n+\n+ /* Contain the layout style paint & layers during animation*/\n+ contain: content;\n+ will-change: opacity; /* Only using for layer promotion */\n}\n- .lh-scores-header .lh-gauge__wrapper {\n- width: calc(10.5 * var(--body-font-size));\n- }\n+\n.lh-gauge__label {\nfont-size: var(--body-font-size);\nline-height: var(--body-line-height);\nmargin-top: calc(0.5 * var(--body-line-height));\ntext-align: center;\n+ color: black;\n}\n+\n</style>\n<a href=\"#\" class=\"lh-gauge__wrapper\">\n- <div class=\"lh-gauge\" data-progress=\"0\">\n- <div class=\"lh-gauge__circle\">\n- <div class=\"lh-gauge__mask lh-gauge__mask--full\">\n- <div class=\"lh-gauge__fill\"></div>\n- </div>\n- <div class=\"lh-gauge__mask lh-gauge__mask--half\">\n- <div class=\"lh-gauge__fill\"></div>\n- <div class=\"lh-gauge__fill lh-gauge__fill--fix\"></div>\n- </div>\n- </div>\n+ <svg viewBox=\"0 0 120 120\" class=\"lh-gauge\" fill=\"none\" stroke-width=\"2\">\n+ <circle class=\"lh-gauge-base\" r=\"53\" cx=\"60\" cy=\"60\"></circle>\n+ <circle class=\"lh-gauge-arc\" transform=\"rotate(-90 60 60)\" stroke-dasharray=\"0 329\" stroke-dashoffset=\"0\" r=\"53\" cx=\"60\" cy=\"60\"></circle>\n+ </svg>\n<div class=\"lh-gauge__percentage\"></div>\n- </div>\n- <div class=\"lh-gauge__label\"><!-- fill me --></div>\n+ <div class=\"lh-gauge__label\"></div>\n</a>\n</template>\n", "new_path": "lighthouse-core/report/v2/templates.html", "old_path": "lighthouse-core/report/v2/templates.html" }, { "change_type": "MODIFY", "diff": "@@ -168,9 +168,8 @@ describe('CategoryRenderer', () => {\nit('renders the category header', () => {\nconst categoryDOM = renderer.render(category, sampleResults.reportGroups);\n- const gauge = categoryDOM.querySelector('.lh-gauge');\n+ const gauge = categoryDOM.querySelector('.lh-gauge__percentage');\nassert.equal(gauge.textContent.trim(), '35', 'score is 0-100');\n- assert.equal(gauge.getAttribute('data-progress'), '35', 'score gauge is visually 0-100');\nconst score = categoryDOM.querySelector('.lh-score');\nconst value = categoryDOM.querySelector('.lh-score > .lh-score__value');\n", "new_path": "lighthouse-core/test/report/v2/renderer/category-renderer-test.js", "old_path": "lighthouse-core/test/report/v2/renderer/category-renderer-test.js" }, { "change_type": "MODIFY", "diff": "@@ -76,7 +76,7 @@ describe('PerfCategoryRenderer', () => {\nconst metricsSection = categoryDOM.querySelectorAll('.lh-category > .lh-audit-group')[0];\nconst metricAudits = category.audits.filter(audit => audit.group === 'perf-metric');\n- const timelineElements = metricsSection.querySelectorAll('.lh-timeline-metric');\n+ const timelineElements = metricsSection.querySelectorAll('.lh-perf-metric');\nconst nontimelineElements = metricsSection.querySelectorAll('.lh-audit');\nassert.equal(timelineElements.length + nontimelineElements.length, metricAudits.length);\n});\n", "new_path": "lighthouse-core/test/report/v2/renderer/performance-category-renderer-test.js", "old_path": "lighthouse-core/test/report/v2/renderer/performance-category-renderer-test.js" }, { "change_type": "MODIFY", "diff": "@@ -105,8 +105,8 @@ describe('Lighthouse chrome extension', function() {\nconst selectors = {\n- audits: '.lh-audit,.lh-timeline-metric,.lh-perf-hint',\n- titles: '.lh-score__title, .lh-perf-hint__title, .lh-timeline-metric__title',\n+ audits: '.lh-audit,.lh-perf-metric,.lh-perf-hint',\n+ titles: '.lh-score__title, .lh-perf-hint__title, .lh-perf-metric__title',\n};\nit('should contain all categories', async () => {\n", "new_path": "lighthouse-extension/test/extension-test.js", "old_path": "lighthouse-extension/test/extension-test.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
report: score gauges, metrics display, add rich tooltips (#5009)
1
report
null
730,414
24.04.2018 16:43:07
14,400
adca3d757985eef6f4fd3c514f1c157abb4b8188
test(widget-space): confirm capitalized email works
[ { "change_type": "MODIFY", "diff": "@@ -3,6 +3,16 @@ import {fromJS} from 'immutable';\nimport {getToUser} from './selector';\ndescribe('widget-space selectors', () => {\n+ const otherUser = {\n+ entryEmail: 'ccwexpress@sparkbot.io',\n+ displayName: 'Nakia - Personal Assistant',\n+ entryUUID: '889869a1-f5b9-408b-a514-12704f02817a',\n+ emailAddress: 'ccwexpress@sparkbot.io',\n+ objectType: 'person',\n+ type: 'ROBOT',\n+ id: '889869a1-f5b9-408b-a514-12704f02817a',\n+ orgId: '1eb65fdf-9643-417f-9974-ad72cae0e10f'\n+ };\nit('gets the \"to user\"', () => {\nconst currentUser = {\nentryEmail: 'qtcrabfq6f@2cecfb0e-f9fc-45cb-b8fc-1f9ebf87209b',\n@@ -14,15 +24,25 @@ describe('widget-space selectors', () => {\nid: '1c8ce4a0-df7b-4e62-8020-a1a430581e51',\norgId: '2cecfb0e-f9fc-45cb-b8fc-1f9ebf87209b'\n};\n- const otherUser = {\n- entryEmail: 'ccwexpress@sparkbot.io',\n- displayName: 'Nakia - Personal Assistant',\n- entryUUID: '889869a1-f5b9-408b-a514-12704f02817a',\n- emailAddress: 'ccwexpress@sparkbot.io',\n+\n+ const mockedConversation = fromJS({\n+ participants: [currentUser, otherUser]\n+ });\n+\n+ // const toUserSelector = getToUserSelector.resultFunc(mockedConversation, currentUser);\n+ const toUser = getToUser(mockedConversation, currentUser);\n+ expect(toUser.get('displayName')).toBe(otherUser.displayName);\n+ });\n+ it('gets the \"to user\" with capitalized email', () => {\n+ const currentUser = {\n+ entryEmail: 'qTCRABFq6f@2cecfb0e-f9fc-45cb-b8fc-1f9ebf87209b',\n+ displayName: 'User-qTCRABFq6f',\n+ entryUUID: '1c8ce4a0-df7b-4e62-8020-a1a430581e51',\n+ emailAddress: 'qTCRABFq6f@2cecfb0e-f9fc-45cb-b8fc-1f9ebf87209b',\nobjectType: 'person',\n- type: 'ROBOT',\n- id: '889869a1-f5b9-408b-a514-12704f02817a',\n- orgId: '1eb65fdf-9643-417f-9974-ad72cae0e10f'\n+ type: 'APPUSER',\n+ id: '1c8ce4a0-df7b-4e62-8020-a1a430581e51',\n+ orgId: '2cecfb0e-f9fc-45cb-b8fc-1f9ebf87209b'\n};\nconst mockedConversation = fromJS({\n@@ -31,6 +51,6 @@ describe('widget-space selectors', () => {\n// const toUserSelector = getToUserSelector.resultFunc(mockedConversation, currentUser);\nconst toUser = getToUser(mockedConversation, currentUser);\n- expect(toUser.get('id')).toBe(toUser.id);\n+ expect(toUser.get('displayName')).toBe(otherUser.displayName);\n});\n});\n", "new_path": "packages/node_modules/@ciscospark/widget-space/src/selector.test.js", "old_path": "packages/node_modules/@ciscospark/widget-space/src/selector.test.js" } ]
JavaScript
MIT License
webex/react-widgets
test(widget-space): confirm capitalized email works
1
test
widget-space
730,414
24.04.2018 16:50:15
14,400
4d37ec975b1bdeb854a0a3cc776afcfa13afe9f5
refactor(widget-space): remove unused selector & use new selector
[ { "change_type": "MODIFY", "diff": "@@ -5,25 +5,17 @@ const getWidget = (state) => state.widgetSpace;\nconst getSpark = (state) => state.spark;\nconst getMedia = (state) => state.media;\nconst getConversation = (state) => state.conversation;\n-const getUsers = (state) => state.users;\nconst getCurrentUser = (state, ownProps) => ownProps.currentUser;\nconst getFeatures = (state) => state.features;\nconst getOwnProps = (state, ownProps) => ownProps;\n/**\n- * Get the other user in the 1:1 conversation.\n+ * Get the other user in a 1:1 conversation.\n* @param {conversation} conversation\n* @param {participant} currentUser\n* @returns {participant}\n*/\n-export function getToUser(conversation, currentUser) {\n- return conversation\n- .get('participants')\n- .filter((participant) => participant.get('id') !== currentUser.id)\n- .first();\n-}\n-\n-export const getToUserSelector = createSelector(\n+export const getToUser = createSelector(\n[getConversation, getCurrentUser],\n/* eslint arrow-body-style: [0] */\n(conversation, currentUser) => {\n@@ -35,16 +27,14 @@ export const getToUserSelector = createSelector(\n);\nexport const getSpaceDetails = createSelector(\n- [getWidget, getConversation, getUsers, getCurrentUser],\n- (widget, conversation, users, currentUser) => {\n+ [getWidget, getConversation, getCurrentUser, getToUser],\n+ (widget, conversation, currentUser, toUser) => {\nconst spaceDetails = widget.get('spaceDetails');\nif (conversation.get('id') && currentUser) {\nlet title = spaceDetails.get('title');\nlet avatarId = conversation.get('id');\n- let toUser;\n// Grab avatar if we're in a direct conversation\nif (spaceDetails.get('type') === 'direct') {\n- toUser = getToUser(conversation, currentUser);\nif (toUser) {\ntitle = toUser.get('displayName');\navatarId = toUser.get('id');\n", "new_path": "packages/node_modules/@ciscospark/widget-space/src/selector.js", "old_path": "packages/node_modules/@ciscospark/widget-space/src/selector.js" }, { "change_type": "MODIFY", "diff": "@@ -29,8 +29,7 @@ describe('widget-space selectors', () => {\nparticipants: [currentUser, otherUser]\n});\n- // const toUserSelector = getToUserSelector.resultFunc(mockedConversation, currentUser);\n- const toUser = getToUser(mockedConversation, currentUser);\n+ const toUser = getToUser.resultFunc(mockedConversation, currentUser);\nexpect(toUser.get('displayName')).toBe(otherUser.displayName);\n});\nit('gets the \"to user\" with capitalized email', () => {\n@@ -49,8 +48,7 @@ describe('widget-space selectors', () => {\nparticipants: [currentUser, otherUser]\n});\n- // const toUserSelector = getToUserSelector.resultFunc(mockedConversation, currentUser);\n- const toUser = getToUser(mockedConversation, currentUser);\n+ const toUser = getToUser.resultFunc(mockedConversation, currentUser);\nexpect(toUser.get('displayName')).toBe(otherUser.displayName);\n});\n});\n", "new_path": "packages/node_modules/@ciscospark/widget-space/src/selector.test.js", "old_path": "packages/node_modules/@ciscospark/widget-space/src/selector.test.js" } ]
JavaScript
MIT License
webex/react-widgets
refactor(widget-space): remove unused selector & use new selector
1
refactor
widget-space
730,414
24.04.2018 16:58:51
14,400
66193026ba6a58f43a403a0113f79381b3d824c4
refactor(widget-space): rename IDs
[ { "change_type": "MODIFY", "diff": "@@ -4,25 +4,25 @@ import {getToUser} from './selector';\ndescribe('widget-space selectors', () => {\nconst otherUser = {\n- entryEmail: 'ccwexpress@sparkbot.io',\n- displayName: 'Nakia - Personal Assistant',\n- entryUUID: '889869a1-f5b9-408b-a514-12704f02817a',\n- emailAddress: 'ccwexpress@sparkbot.io',\n+ entryEmail: 'fakebot@sparkbot.io',\n+ displayName: 'Personal Assistant Bot',\n+ entryUUID: 'c04b6751-bbed-4ac8-aa63-9654b757e171',\n+ emailAddress: 'fakebot@sparkbot.io',\nobjectType: 'person',\ntype: 'ROBOT',\n- id: '889869a1-f5b9-408b-a514-12704f02817a',\n- orgId: '1eb65fdf-9643-417f-9974-ad72cae0e10f'\n+ id: 'c04b6751-bbed-4ac8-aa63-9654b757e171',\n+ orgId: 'ac9c7b0d-77e3-4ab9-b8f6-b092c57e5999'\n};\nit('gets the \"to user\"', () => {\nconst currentUser = {\n- entryEmail: 'qtcrabfq6f@2cecfb0e-f9fc-45cb-b8fc-1f9ebf87209b',\n+ entryEmail: 'qtcrabfq6f@4c45deca-dc35-4c44-9941-b0c7ba8f7b13',\ndisplayName: 'User-qTCRABFq6f',\nentryUUID: '1c8ce4a0-df7b-4e62-8020-a1a430581e51',\n- emailAddress: 'qtcrabfq6f@2cecfb0e-f9fc-45cb-b8fc-1f9ebf87209b',\n+ emailAddress: 'qtcrabfq6f@4c45deca-dc35-4c44-9941-b0c7ba8f7b13',\nobjectType: 'person',\ntype: 'APPUSER',\nid: '1c8ce4a0-df7b-4e62-8020-a1a430581e51',\n- orgId: '2cecfb0e-f9fc-45cb-b8fc-1f9ebf87209b'\n+ orgId: '4c45deca-dc35-4c44-9941-b0c7ba8f7b13'\n};\nconst mockedConversation = fromJS({\n@@ -34,14 +34,14 @@ describe('widget-space selectors', () => {\n});\nit('gets the \"to user\" with capitalized email', () => {\nconst currentUser = {\n- entryEmail: 'qTCRABFq6f@2cecfb0e-f9fc-45cb-b8fc-1f9ebf87209b',\n+ entryEmail: 'qTCRABFq6f@4c45deca-dc35-4c44-9941-b0c7ba8f7b13',\ndisplayName: 'User-qTCRABFq6f',\nentryUUID: '1c8ce4a0-df7b-4e62-8020-a1a430581e51',\n- emailAddress: 'qTCRABFq6f@2cecfb0e-f9fc-45cb-b8fc-1f9ebf87209b',\n+ emailAddress: 'qTCRABFq6f@4c45deca-dc35-4c44-9941-b0c7ba8f7b13',\nobjectType: 'person',\ntype: 'APPUSER',\nid: '1c8ce4a0-df7b-4e62-8020-a1a430581e51',\n- orgId: '2cecfb0e-f9fc-45cb-b8fc-1f9ebf87209b'\n+ orgId: '4c45deca-dc35-4c44-9941-b0c7ba8f7b13'\n};\nconst mockedConversation = fromJS({\n", "new_path": "packages/node_modules/@ciscospark/widget-space/src/selector.test.js", "old_path": "packages/node_modules/@ciscospark/widget-space/src/selector.test.js" } ]
JavaScript
MIT License
webex/react-widgets
refactor(widget-space): rename IDs
1
refactor
widget-space
815,745
24.04.2018 17:00:16
-10,800
ef247a80512634d911922aac435bb80c3c21ed42
fix: add min-width to dropdown panel
[ { "change_type": "MODIFY", "diff": "@@ -341,6 +341,7 @@ export class NgDropdownPanelComponent implements OnInit, OnChanges, OnDestroy, A\ndropdownPanel.style.bottom = 'auto';\ndropdownPanel.style.left = offsetLeft + 'px';\ndropdownPanel.style.width = selectRect.width + 'px';\n+ dropdownPanel.style.minWidth = selectRect.width + 'px';\n}\nprivate _whenContentReady(): Promise<void> {\n", "new_path": "src/ng-select/ng-dropdown-panel.component.ts", "old_path": "src/ng-select/ng-dropdown-panel.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: add min-width to dropdown panel #476
1
fix
null
815,745
24.04.2018 17:01:33
-10,800
23e56b19773921a7baacf8a782d5db3f40fae691
chore(release): 1.1.4
[ { "change_type": "MODIFY", "diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"1.1.4\"></a>\n+## [1.1.4](https://github.com/ng-select/ng-select/compare/v1.1.3...v1.1.4) (2018-04-24)\n+\n+\n+### Bug Fixes\n+\n+* add min-width to dropdown panel ([ef247a8](https://github.com/ng-select/ng-select/commit/ef247a8))\n+\n+\n+\n<a name=\"1.1.3\"></a>\n## [1.1.3](https://github.com/ng-select/ng-select/compare/v1.1.2...v1.1.3) (2018-04-24)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"$schema\": \"../node_modules/ng-packagr/package.schema.json\",\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"1.1.3\",\n+ \"version\": \"1.1.4\",\n\"description\": \"Angular ng-select - All in One UI Select, Multiselect and Autocomplete\",\n\"author\": \"@ng-select/ng-select\",\n\"license\": \"MIT\",\n", "new_path": "src/package.json", "old_path": "src/package.json" } ]
TypeScript
MIT License
ng-select/ng-select
chore(release): 1.1.4
1
chore
release
679,913
24.04.2018 17:07:29
-3,600
3135da20c7c150bd4ada715e691cda1b6d67ff33
docs(examples): update rs-dlow diagram & readme
[ { "change_type": "MODIFY", "diff": "digraph g {\n-\nrankdir=LR;\n- node[fontname=Inconsolata,fontsize=9,fontcolor=white,style=filled,color=black];\n- edge[fontname=Inconsolata,fontsize=9,arrowsize=0.66];\n-\n- mousedown -> gestures;\n- mousemove -> gestures;\n- mouseup -> gestures;\n- touchstart -> gestures;\n- touchmove -> gestures;\n- touchend -> gestures;\n-\n- gestures -> mpos[label=extract];\n- gestures -> clickpos[label=extract];\n- gestures -> dist[label=extract];\n-\n- clickpos -> color[label=\"pick random\"];\n-\n- clickpos -> circle;\n- radius -> circle;\n- color -> circle;\n-\n- RAF -> sine[label=\"frame counter\"];\n-\n- sine -> radius;\n- dist -> radius;\n-\n- mousedown[color=\"#666666\"];\n- mousemove[color=\"#666666\"];\n- mouseup[color=\"#666666\"];\n- touchstart[color=\"#666666\"];\n- touchmove[color=\"#666666\"];\n- touchend[color=\"#666666\"];\n- RAF[color=\"#666666\"];\n+node[fontname=Inconsolata,fontsize=11,style=filled,fontcolor=white];\n+edge[fontname=Inconsolata,fontsize=11];\n+s0[label=\"gestures\\n(StreamMerge)\", color=red];\n+s1[label=\"mpos\", color=black];\n+s2[label=\"out-mpos\", color=black];\n+s3[label=\"<noid>\", color=gray];\n+s4[label=\"clickpos\", color=black];\n+s5[label=\"out-clickpos\", color=black];\n+s6[label=\"<noid>\", color=gray];\n+s7[label=\"color\", color=black];\n+s8[label=\"out-color\", color=black];\n+s9[label=\"<noid>\", color=gray];\n+s10[label=\"in-color\", color=black];\n+s11[label=\"<noid>\", color=gray];\n+s12[label=\"circle\\n(StreamSync)\", color=red];\n+s13[label=\"out-circle\", color=black];\n+s14[label=\"<noid>\", color=gray];\n+s15[label=\"in-click\", color=black];\n+s16[label=\"<noid>\", color=gray];\n+s17[label=\"dist\", color=black];\n+s18[label=\"out-dist\", color=black];\n+s19[label=\"<noid>\", color=gray];\n+s20[label=\"in-b\", color=black];\n+s21[label=\"<noid>\", color=gray];\n+s22[label=\"radius\\n(StreamSync)\", color=red];\n+s23[label=\"out-radius\", color=black];\n+s24[label=\"<noid>\", color=gray];\n+s25[label=\"in-radius\", color=black];\n+s26[label=\"<noid>\", color=gray];\n+s27[label=\"raf-8\\n(Stream)\", color=blue];\n+s28[label=\"sine\", color=black];\n+s29[label=\"out-sine\", color=black];\n+s30[label=\"<noid>\", color=gray];\n+s31[label=\"in-a\", color=black];\n+s32[label=\"<noid>\", color=gray];\n+s2 -> s3;\n+s1 -> s2;\n+s5 -> s6;\n+s8 -> s9;\n+s13 -> s14;\n+s12 -> s13;\n+s11 -> s12[label=\"xform\"];\n+s10 -> s11;\n+s7 -> s8;\n+s7 -> s10[label=\"xform\"];\n+s16 -> s12[label=\"xform\"];\n+s15 -> s16;\n+s4 -> s5;\n+s4 -> s7[label=\"xform\"];\n+s4 -> s15[label=\"xform\"];\n+s18 -> s19;\n+s23 -> s24;\n+s26 -> s12[label=\"xform\"];\n+s25 -> s26;\n+s22 -> s23;\n+s22 -> s25[label=\"xform\"];\n+s21 -> s22[label=\"xform\"];\n+s20 -> s21;\n+s17 -> s18;\n+s17 -> s20[label=\"xform\"];\n+s0 -> s1[label=\"xform\"];\n+s0 -> s4[label=\"xform\"];\n+s0 -> s17[label=\"xform\"];\n+s29 -> s30;\n+s32 -> s22[label=\"xform\"];\n+s31 -> s32;\n+s28 -> s29;\n+s28 -> s31[label=\"xform\"];\n+s27 -> s28[label=\"xform\"];\n}\n\\ No newline at end of file\n", "new_path": "assets/rs-dflow.dot", "old_path": "assets/rs-dflow.dot" }, { "change_type": "MODIFY", "diff": "Binary files a/assets/rs-dflow.png and b/assets/rs-dflow.png differ\n", "new_path": "assets/rs-dflow.png", "old_path": "assets/rs-dflow.png" }, { "change_type": "MODIFY", "diff": "@@ -16,7 +16,9 @@ Installs all dependencies, runs `webpack-dev-server` and opens the app in your b\n![dataflow graph](../../assets/rs-dflow.png)\nThis example combines the following packages to create & execute the\n-above dataflow graph in a declarative manner:\n+above dataflow graph in a declarative manner. The diagram generation\n+itself is part of the example and handled via the @thi.ng/rstream-dot\n+package.\n- [@thi.ng/atom](https://github.com/thi-ng/umbrella/tree/master/packages/atom) - state container\n- [@thi.ng/hdom](https://github.com/thi-ng/umbrella/tree/master/packages/hdom) - UI component rendering\n", "new_path": "examples/rstream-dataflow/README.md", "old_path": "examples/rstream-dataflow/README.md" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(examples): update rs-dlow diagram & readme
1
docs
examples
679,913
24.04.2018 18:45:39
-3,600
6368cd2d006f0e6cea6b33a96de1f40ec752e9b8
docs(rstream-dot): update readme, add diagram
[ { "change_type": "ADD", "diff": "+digraph g {\n+rankdir=LR;\n+node[fontname=Inconsolata,fontsize=11,style=filled,fontcolor=white];\n+edge[fontname=Inconsolata,fontsize=11];\n+s0[label=\"iterable-0\\n(Stream)\", color=blue];\n+s1[label=\"x10\", color=black];\n+s2[label=\"in-iterable-0\", color=black];\n+s3[label=\"<noid>\", color=gray];\n+s4[label=\"streammerge-0\\n(StreamMerge)\", color=red];\n+s5[label=\"sub-1\", color=black];\n+s6[label=\"<noid>\", color=gray];\n+s7[label=\"iterable-1\\n(Stream)\", color=blue];\n+s8[label=\"in-iterable-1\", color=black];\n+s9[label=\"<noid>\", color=gray];\n+s5 -> s6;\n+s4 -> s5;\n+s3 -> s4;\n+s2 -> s3;\n+s0 -> s1[label=\"xform\"];\n+s0 -> s2;\n+s9 -> s4;\n+s8 -> s9;\n+s7 -> s8;\n+}\n", "new_path": "assets/rs-dot-example.dot", "old_path": null }, { "change_type": "ADD", "diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n+<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n+ \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n+<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n+ -->\n+<!-- Title: g Pages: 1 -->\n+<svg width=\"719pt\" height=\"156pt\"\n+ viewBox=\"0.00 0.00 718.51 155.98\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n+<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 151.9754)\">\n+<title>g</title>\n+<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-151.9754 714.5138,-151.9754 714.5138,4 -4,4\"/>\n+<!-- s0 -->\n+<g id=\"node1\" class=\"node\">\n+<title>s0</title>\n+<ellipse fill=\"#0000ff\" stroke=\"#0000ff\" cx=\"50.2046\" cy=\"-106.9754\" rx=\"50.41\" ry=\"21.9508\"/>\n+<text text-anchor=\"middle\" x=\"50.2046\" y=\"-109.7144\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#ffffff\">iterable&#45;0</text>\n+<text text-anchor=\"middle\" x=\"50.2046\" y=\"-98.1754\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#ffffff\">(Stream)</text>\n+</g>\n+<!-- s1 -->\n+<g id=\"node2\" class=\"node\">\n+<title>s1</title>\n+<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"215.999\" cy=\"-129.9754\" rx=\"27\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"215.999\" y=\"-126.9449\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#ffffff\">x10</text>\n+</g>\n+<!-- s0&#45;&gt;s1 -->\n+<g id=\"edge5\" class=\"edge\">\n+<title>s0&#45;&gt;s1</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M98.1592,-113.628C123.9845,-117.2106 155.348,-121.5615 179.2239,-124.8737\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"178.9032,-128.3627 189.2893,-126.2701 179.8652,-121.4291 178.9032,-128.3627\"/>\n+<text text-anchor=\"middle\" x=\"132.1592\" y=\"-121.7144\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#000000\">xform</text>\n+</g>\n+<!-- s2 -->\n+<g id=\"node3\" class=\"node\">\n+<title>s2</title>\n+<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"215.999\" cy=\"-75.9754\" rx=\"52.1798\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"215.999\" y=\"-72.9449\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#ffffff\">in&#45;iterable&#45;0</text>\n+</g>\n+<!-- s0&#45;&gt;s2 -->\n+<g id=\"edge6\" class=\"edge\">\n+<title>s0&#45;&gt;s2</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M96.3876,-98.3402C116.1494,-94.6451 139.3996,-90.2978 160.1209,-86.4234\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"160.8773,-89.8427 170.0637,-84.5643 159.5907,-82.962 160.8773,-89.8427\"/>\n+</g>\n+<!-- s3 -->\n+<g id=\"node4\" class=\"node\">\n+<title>s3</title>\n+<ellipse fill=\"#c0c0c0\" stroke=\"#c0c0c0\" cx=\"334.2591\" cy=\"-75.9754\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"334.2591\" y=\"-72.9449\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#ffffff\">&lt;noid&gt;</text>\n+</g>\n+<!-- s2&#45;&gt;s3 -->\n+<g id=\"edge4\" class=\"edge\">\n+<title>s2&#45;&gt;s3</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M268.2139,-75.9754C277.1877,-75.9754 286.3771,-75.9754 294.9397,-75.9754\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"295.0168,-79.4755 305.0168,-75.9754 295.0168,-72.4755 295.0168,-79.4755\"/>\n+</g>\n+<!-- s4 -->\n+<g id=\"node5\" class=\"node\">\n+<title>s4</title>\n+<ellipse fill=\"#ff0000\" stroke=\"#ff0000\" cx=\"462.3013\" cy=\"-47.9754\" rx=\"61.744\" ry=\"21.9508\"/>\n+<text text-anchor=\"middle\" x=\"462.3013\" y=\"-50.7144\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#ffffff\">streammerge&#45;0</text>\n+<text text-anchor=\"middle\" x=\"462.3013\" y=\"-39.1754\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#ffffff\">(StreamMerge)</text>\n+</g>\n+<!-- s3&#45;&gt;s4 -->\n+<g id=\"edge3\" class=\"edge\">\n+<title>s3&#45;&gt;s4</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M362.0424,-69.8998C373.1199,-67.4774 386.3557,-64.583 399.5214,-61.704\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"400.5174,-65.069 409.5388,-59.5134 399.0219,-58.2306 400.5174,-65.069\"/>\n+</g>\n+<!-- s5 -->\n+<g id=\"node6\" class=\"node\">\n+<title>s5</title>\n+<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"588.1731\" cy=\"-47.9754\" rx=\"27\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"588.1731\" y=\"-44.9449\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#ffffff\">sub&#45;1</text>\n+</g>\n+<!-- s4&#45;&gt;s5 -->\n+<g id=\"edge2\" class=\"edge\">\n+<title>s4&#45;&gt;s5</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M524.4997,-47.9754C533.558,-47.9754 542.6367,-47.9754 550.9851,-47.9754\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"551.1125,-51.4755 561.1125,-47.9754 551.1125,-44.4755 551.1125,-51.4755\"/>\n+</g>\n+<!-- s6 -->\n+<g id=\"node7\" class=\"node\">\n+<title>s6</title>\n+<ellipse fill=\"#c0c0c0\" stroke=\"#c0c0c0\" cx=\"681.3435\" cy=\"-47.9754\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"681.3435\" y=\"-44.9449\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#ffffff\">&lt;noid&gt;</text>\n+</g>\n+<!-- s5&#45;&gt;s6 -->\n+<g id=\"edge1\" class=\"edge\">\n+<title>s5&#45;&gt;s6</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M615.6234,-47.9754C623.8797,-47.9754 633.1065,-47.9754 641.9757,-47.9754\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"642.1434,-51.4755 652.1434,-47.9754 642.1433,-44.4755 642.1434,-51.4755\"/>\n+</g>\n+<!-- s7 -->\n+<g id=\"node8\" class=\"node\">\n+<title>s7</title>\n+<ellipse fill=\"#0000ff\" stroke=\"#0000ff\" cx=\"50.2046\" cy=\"-21.9754\" rx=\"50.41\" ry=\"21.9508\"/>\n+<text text-anchor=\"middle\" x=\"50.2046\" y=\"-24.7144\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#ffffff\">iterable&#45;1</text>\n+<text text-anchor=\"middle\" x=\"50.2046\" y=\"-13.1754\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#ffffff\">(Stream)</text>\n+</g>\n+<!-- s8 -->\n+<g id=\"node9\" class=\"node\">\n+<title>s8</title>\n+<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"215.999\" cy=\"-21.9754\" rx=\"52.1798\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"215.999\" y=\"-18.9449\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#ffffff\">in&#45;iterable&#45;1</text>\n+</g>\n+<!-- s7&#45;&gt;s8 -->\n+<g id=\"edge9\" class=\"edge\">\n+<title>s7&#45;&gt;s8</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M100.8492,-21.9754C117.4867,-21.9754 136.1777,-21.9754 153.5835,-21.9754\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"153.658,-25.4755 163.658,-21.9754 153.6579,-18.4755 153.658,-25.4755\"/>\n+</g>\n+<!-- s9 -->\n+<g id=\"node10\" class=\"node\">\n+<title>s9</title>\n+<ellipse fill=\"#c0c0c0\" stroke=\"#c0c0c0\" cx=\"334.2591\" cy=\"-21.9754\" rx=\"29.3416\" ry=\"18\"/>\n+<text text-anchor=\"middle\" x=\"334.2591\" y=\"-18.9449\" font-family=\"Inconsolata\" font-size=\"11.00\" fill=\"#ffffff\">&lt;noid&gt;</text>\n+</g>\n+<!-- s8&#45;&gt;s9 -->\n+<g id=\"edge8\" class=\"edge\">\n+<title>s8&#45;&gt;s9</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M268.2139,-21.9754C277.1877,-21.9754 286.3771,-21.9754 294.9397,-21.9754\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"295.0168,-25.4755 305.0168,-21.9754 295.0168,-18.4755 295.0168,-25.4755\"/>\n+</g>\n+<!-- s9&#45;&gt;s4 -->\n+<g id=\"edge7\" class=\"edge\">\n+<title>s9&#45;&gt;s4</title>\n+<path fill=\"none\" stroke=\"#000000\" d=\"M362.0424,-27.617C372.8854,-29.8188 385.7964,-32.4405 398.6854,-35.0577\"/>\n+<polygon fill=\"#000000\" stroke=\"#000000\" points=\"398.0063,-38.4911 408.5028,-37.0512 399.3994,-31.6311 398.0063,-38.4911\"/>\n+</g>\n+</g>\n+</svg>\n", "new_path": "assets/rs-dot-example.svg", "old_path": null }, { "change_type": "MODIFY", "diff": "## About\n-TODO...\n+Graphviz DOT conversion of @thi.ng/rstream dataflow graph topologies.\n## Installation\n@@ -15,9 +15,57 @@ yarn add @thi.ng/rstream-dot\n## Usage examples\n```typescript\n-import * as rstream-dot from \"@thi.ng/rstream-dot\";\n+import * as rsd from \"@thi.ng/rstream-dot\";\n+\n+import * as rs from \"@thi.ng/rstream\";\n+import * as tx from \"@thi.ng/transducers\";\n+\n+a = rs.fromIterable([1,2,3]);\n+b = rs.fromIterable([10, 20, 30]);\n+\n+a.transform(tx.map((x)=> x*10), \"x10\");\n+\n+rs.merge({src: [a,b]}).subscribe(rs.trace());\n+\n+// now capture the topology by walking the graph from its root(s)\n+console.log(rsd.toDot(rsd.walk([a,b])));\n+\n+// digraph g {\n+// rankdir=LR;\n+// node[fontname=Inconsolata,fontsize=11,style=filled,fontcolor=white];\n+// edge[fontname=Inconsolata,fontsize=11];\n+// s0[label=\"iterable-0\\n(Stream)\", color=blue];\n+// s1[label=\"x10\", color=black];\n+// s2[label=\"in-iterable-0\", color=black];\n+// s3[label=\"<noid>\", color=gray];\n+// s4[label=\"streammerge-0\\n(StreamMerge)\", color=red];\n+// s5[label=\"sub-1\", color=black];\n+// s6[label=\"<noid>\", color=gray];\n+// s7[label=\"iterable-1\\n(Stream)\", color=blue];\n+// s8[label=\"in-iterable-1\", color=black];\n+// s9[label=\"<noid>\", color=gray];\n+// s5 -> s6;\n+// s4 -> s5;\n+// s3 -> s4;\n+// s2 -> s3;\n+// s0 -> s1[label=\"xform\"];\n+// s0 -> s2;\n+// s9 -> s4;\n+// s8 -> s9;\n+// s7 -> s8;\n+// }\n```\n+Copy output to file `graph.dot` and then run:\n+\n+```\n+dot -Tsvg -o graph.svg graph.dot\n+```\n+\n+This will generate this diagram:\n+\n+![graphviz output](../../assets/rs-dot-example.svg)\n+\n## Authors\n- Karsten Schmidt\n", "new_path": "packages/rstream-dot/README.md", "old_path": "packages/rstream-dot/README.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@thi.ng/rstream-dot\",\n\"version\": \"0.0.1\",\n- \"description\": \"TODO\",\n+ \"description\": \"Graphviz DOT conversion of @thi.ng/rstream dataflow graph topologies\",\n\"main\": \"./index.js\",\n\"typings\": \"./index.d.ts\",\n\"repository\": \"https://github.com/thi-ng/umbrella\",\n", "new_path": "packages/rstream-dot/package.json", "old_path": "packages/rstream-dot/package.json" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs(rstream-dot): update readme, add diagram
1
docs
rstream-dot
679,913
24.04.2018 22:26:34
-3,600
d9b845e07c277bdbb408a7501d97839aa9374dda
feat(rstream-query): add param queries w/ variables, update addPatternQuery add FactGraph.addParamQuery() add FactGraph.has() add qvarResolver()
[ { "change_type": "MODIFY", "diff": "-export interface Pattern extends Array<any> {\n- [0]: any;\n- [1]: any;\n- [2]: any;\n-}\n+export type Pattern = [any, any, any];\nexport type Fact = Pattern;\n@@ -21,4 +17,4 @@ export interface Edit {\nkey: any;\n}\n-export let DEBUG = true;\n\\ No newline at end of file\n+export let DEBUG = false;\n", "new_path": "packages/rstream-query/src/api.ts", "old_path": "packages/rstream-query/src/api.ts" }, { "change_type": "MODIFY", "diff": "import { IObjectOf } from \"@thi.ng/api/api\";\nimport { equiv } from \"@thi.ng/api/equiv\";\n+import { illegalArgs } from \"@thi.ng/api/error\";\nimport { intersection } from \"@thi.ng/associative/intersection\";\nimport { Stream, Subscription, sync } from \"@thi.ng/rstream\";\nimport { toDot, walk, DotOpts, IToDot } from \"@thi.ng/rstream-dot\";\n@@ -8,6 +9,8 @@ import { compR } from \"@thi.ng/transducers/func/compr\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\nimport { DEBUG, Edit, Fact, FactIds, Pattern } from \"./api\";\n+import { qvarResolver } from \"./pattern\";\n+import { isQVar } from \"./qvar\";\nexport class FactGraph implements\nIToDot {\n@@ -49,6 +52,15 @@ export class FactGraph implements\n};\n}\n+ has(f: Fact) {\n+ return this.findInIndices(\n+ this.indexS.get(f[0]),\n+ this.indexP.get(f[1]),\n+ this.indexO.get(f[2]),\n+ f\n+ ) !== -1;\n+ }\n+\naddFact(f: Fact) {\nlet s = this.indexS.get(f[0]);\nlet p = this.indexP.get(f[1]);\n@@ -73,14 +85,30 @@ export class FactGraph implements\nreturn this;\n}\n- addPatternQuery(id: string, [s, p, o]: Pattern): Subscription<FactIds, FactIds> {\n+ /**\n+ * Creates a new query subscription from given SPO pattern. Any\n+ * `null` values in the pattern act as wildcard selectors and any\n+ * other value as filter for the given fact component. E.g. the\n+ * pattern `[null, \"type\", \"person\"]` matches all facts which have\n+ * `\"type\"` as predicate and `\"person\"` as object. Likewise the\n+ * pattern `[null, null, null]` matches ALL facts in the graph.\n+ *\n+ * By default, the returned rstream subscription emits sets of\n+ * matched facts. If only the raw fact IDs are wanted, set\n+ * `emitFacts` arg to `false`.\n+ *\n+ * @param id\n+ * @param param1\n+ */\n+ addPatternQuery(id: string, [s, p, o]: Pattern, emitFacts = true): Subscription<FactIds, FactIds | Set<Fact>> {\n+ let results: Subscription<any, FactIds | Set<Fact>>;\nif (s == null && p == null && o == null) {\n- return this.streamAll;\n- }\n+ results = this.streamAll;\n+ } else {\nconst qs = this.getIndexSelection(this.streamS, s, \"s\");\nconst qp = this.getIndexSelection(this.streamP, p, \"p\");\nconst qo = this.getIndexSelection(this.streamO, o, \"o\");\n- const results = sync<FactIds, FactIds>({\n+ results = sync<FactIds, FactIds>({\nid,\nsrc: [qs, qp, qo],\nxform: map(({ s, p, o }) => intersection(intersection(s, p), o)),\n@@ -95,7 +123,55 @@ export class FactGraph implements\nsubmit(this.indexS, qs, s);\nsubmit(this.indexP, qp, p);\nsubmit(this.indexO, qo, o);\n- return results;\n+ }\n+ return emitFacts ?\n+ results.transform(asFacts(this)) :\n+ results;\n+ }\n+\n+ /**\n+ * Creates a new parametric query using given pattern with at least\n+ * 1 query variable. Query vars are strings with `?` prefix. The\n+ * rest of the string is considered the variable name.\n+ *\n+ * ```\n+ * g.addParamQuery(\"id\", [\"?a\", \"friend\", \"?b\"]);\n+ * ```\n+ *\n+ * Internally, the query pattern is translated into a basic param\n+ * query with an additional result transformation to resolve the\n+ * stated query variable solutions. Returns a rstream subscription\n+ * emitting arrays of solution objects like:\n+ *\n+ * ```\n+ * [{a: \"asterix\", b: \"obelix\"}, {a: \"romeo\", b: \"julia\"}]\n+ * ```\n+ *\n+ * @param id\n+ * @param param1\n+ */\n+ addParamQuery(id: string, [s, p, o]: Pattern) {\n+ const vs = isQVar(s);\n+ const vp = isQVar(p);\n+ const vo = isQVar(o);\n+ const resolve = qvarResolver(vs, vp, vo, s, p, o);\n+ if (!resolve) {\n+ illegalArgs(\"at least 1 query variable is required in pattern\");\n+ }\n+ const query = <Subscription<any, Set<Fact>>>this.addPatternQuery(\n+ id + \"-raw\",\n+ [vs ? null : s, vp ? null : p, vo ? null : o],\n+ );\n+ return query.transform(\n+ map((facts: Set<Fact>) => {\n+ const res = [];\n+ for (let f of facts) {\n+ res.push(resolve(f));\n+ }\n+ return res;\n+ }),\n+ id\n+ );\n}\ntoDot(opts?: Partial<DotOpts>) {\n", "new_path": "packages/rstream-query/src/graph.ts", "old_path": "packages/rstream-query/src/graph.ts" }, { "change_type": "ADD", "diff": "+export * from \"./api\";\n+export * from \"./graph\";\n+export * from \"./pattern\";\n+export * from \"./qvar\";\n", "new_path": "packages/rstream-query/src/index.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "import { repeatedly } from \"@thi.ng/transducers/iter/repeatedly\";\n-import { Pattern } from \"./api\";\n-import { isQVar, autoQVar } from \"./qvar\";\n+import { Fact, Pattern } from \"./api\";\n+import { isQVar, autoQVar, qvarName } from \"./qvar\";\nexport const patternVarCount = (p: Pattern) => {\nlet n = 0;\n@@ -42,3 +42,43 @@ export const resolvePathPattern = ([s, p, o], maxd = p.length) => {\nexport const sortPatterns = (patterns: Pattern[]) =>\npatterns.sort((a, b) => patternVarCount(a) - patternVarCount(b));\n+\n+/**\n+ * Returns an optimized query variable solution extractor function based\n+ * on given pattern type. `vs`, `vp`, `vo` are flags to indicate if `s`,\n+ * `p` and/or `o` pattern items are query variables. The returned fn\n+ * will be optimized to 1 of the 8 possible case and accepts a single\n+ * fact to extract the respective variables from.\n+ *\n+ * @param vs\n+ * @param vp\n+ * @param vo\n+ * @param s\n+ * @param p\n+ * @param o\n+ */\n+export const qvarResolver = (vs: boolean, vp: boolean, vo: boolean, s, p, o) => {\n+ const type = ((<any>vs) << 2) | ((<any>vp) << 1) | (<any>vo);\n+ let ss: any = vs && qvarName(s);\n+ let pp: any = vp && qvarName(p);\n+ let oo: any = vo && qvarName(o);\n+ switch (type) {\n+ case 0:\n+ default:\n+ return;\n+ case 1:\n+ return (f: Fact) => ({ [oo]: f[2] });\n+ case 2:\n+ return (f: Fact) => ({ [pp]: f[1] });\n+ case 3:\n+ return (f: Fact) => ({ [pp]: f[1], [oo]: f[2] });\n+ case 4:\n+ return (f: Fact) => ({ [ss]: f[0] });\n+ case 5:\n+ return (f: Fact) => ({ [ss]: f[0], [oo]: f[2] });\n+ case 6:\n+ return (f: Fact) => ({ [ss]: f[0], [pp]: f[1] });\n+ case 7:\n+ return (f: Fact) => ({ [ss]: f[0], [pp]: f[1], [oo]: f[2] });\n+ }\n+};\n", "new_path": "packages/rstream-query/src/pattern.ts", "old_path": "packages/rstream-query/src/pattern.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(rstream-query): add param queries w/ variables, update addPatternQuery - add FactGraph.addParamQuery() - add FactGraph.has() - add qvarResolver()
1
feat
rstream-query
679,913
24.04.2018 22:26:52
-3,600
781ae217cb02d51ed1f2bd46eccdf3ab0df8a6a4
test(rstream-query): add query tests
[ { "change_type": "MODIFY", "diff": "-// import * as assert from \"assert\";\n-// import * as rstream-query from \"../src/index\";\n+import * as assert from \"assert\";\n+import { FactGraph, Fact } from \"../src/index\";\ndescribe(\"rstream-query\", () => {\n- it(\"tests pending\");\n+\n+ const facts: Fact[] = [\n+ [\"a\", \"type\", \"foo\"], // 0\n+ [\"b\", \"type\", \"bar\"], // 1\n+ [\"c\", \"type\", \"baz\"], // 2\n+ [\"a\", \"value\", 0], // 3\n+ [\"b\", \"value\", 1], // 4\n+ [\"c\", \"friend\", \"a\"], // 5\n+ ];\n+\n+ let g: FactGraph;\n+\n+ beforeEach(() => {\n+ g = new FactGraph();\n+ FactGraph.NEXT_ID = 0;\n+ for (let f of facts) {\n+ g.addFact(f);\n+\n+ }\n+ });\n+\n+ it(\"pattern query (S)\", () => {\n+ const res = [];\n+ g.addPatternQuery(\"q\", [\"a\", null, null], false).subscribe({ next: (r) => res.push(r) });\n+ assert.deepEqual(res, [new Set([0, 3])]);\n+ });\n+\n+ it(\"pattern query (P)\", () => {\n+ const res = [];\n+ g.addPatternQuery(\"q\", [null, \"type\", null], false).subscribe({ next: (r) => res.push(r) });\n+ assert.deepEqual(res, [new Set([0, 1, 2])]);\n+ });\n+\n+ it(\"pattern query (O)\", () => {\n+ const res = [];\n+ g.addPatternQuery(\"q\", [null, null, \"a\"], false).subscribe({ next: (r) => res.push(r) });\n+ assert.deepEqual(res, [new Set([5])]);\n+ });\n+\n+ it(\"pattern query (SP)\", () => {\n+ const res = [];\n+ g.addPatternQuery(\"q\", [\"a\", \"value\", null], false).subscribe({ next: (r) => res.push(r) });\n+ assert.deepEqual(res, [new Set([3])]);\n+ });\n+\n+ it(\"pattern query (PO)\", () => {\n+ const res = [];\n+ g.addPatternQuery(\"q\", [null, \"value\", 0], false).subscribe({ next: (r) => res.push(r) });\n+ assert.deepEqual(res, [new Set([3])]);\n+ });\n+\n+ it(\"pattern query (SO)\", () => {\n+ const res = [];\n+ g.addPatternQuery(\"q\", [\"b\", null, \"bar\"], false).subscribe({ next: (r) => res.push(r) });\n+ assert.deepEqual(res, [new Set([1])]);\n+ });\n+\n+ it(\"pattern query (SPO)\", () => {\n+ const res = [];\n+ g.addPatternQuery(\"q\", [\"c\", \"type\", \"baz\"], false).subscribe({ next: (r) => res.push(r) });\n+ assert.deepEqual(res, [new Set([2])]);\n+ });\n+\n+ it(\"pattern query (all)\", () => {\n+ const res = [];\n+ g.addPatternQuery(\"q\", [null, null, null], false).subscribe({ next: (r) => res.push(r) });\n+ assert.deepEqual(res, [new Set([0, 1, 2, 3, 4, 5])]);\n+ });\n+\n+ it(\"param query (S)\", () => {\n+ const res = [];\n+ g.addParamQuery(\"q\", [\"a\", \"?p\", \"?o\"]).subscribe({ next: (r) => res.push(r) });\n+ assert.deepEqual(res, [[{ p: \"type\", o: \"foo\" }, { p: \"value\", o: 0 }]]);\n+ });\n+\n+ it(\"param query (P)\", () => {\n+ const res = [];\n+ g.addParamQuery(\"q\", [\"?s\", \"type\", \"?o\"]).subscribe({ next: (r) => res.push(r) });\n+ assert.deepEqual(res, [[{ s: \"a\", o: \"foo\" }, { s: \"b\", o: \"bar\" }, { s: \"c\", o: \"baz\" }]]);\n+ });\n+\n+ it(\"param query (O)\", () => {\n+ const res = [];\n+ g.addParamQuery(\"q\", [\"?s\", \"?p\", \"a\"]).subscribe({ next: (r) => res.push(r) });\n+ assert.deepEqual(res, [[{ s: \"c\", p: \"friend\" }]]);\n+ });\n+\n+ it(\"param query (SP)\", () => {\n+ const res = [];\n+ g.addParamQuery(\"q\", [\"a\", \"value\", \"?o\"]).subscribe({ next: (r) => res.push(r) });\n+ assert.deepEqual(res, [[{ o: 0 }]]);\n+ });\n+\n+ it(\"param query (PO)\", () => {\n+ const res = [];\n+ g.addParamQuery(\"q\", [\"?s\", \"value\", 0]).subscribe({ next: (r) => res.push(r) });\n+ assert.deepEqual(res, [[{ s: \"a\" }]]);\n+ });\n+\n+ it(\"param query (SO)\", () => {\n+ const res = [];\n+ g.addParamQuery(\"q\", [\"b\", \"?p\", \"bar\"]).subscribe({ next: (r) => res.push(r) });\n+ assert.deepEqual(res, [[{ p: \"type\" }]]);\n+ });\n+\n+ it(\"param query (SPO)\", () => {\n+ assert.throws(() => g.addParamQuery(\"q\", [\"c\", \"type\", \"baz\"]));\n+ });\n+\n+ it(\"param query (all)\", () => {\n+ const res = [];\n+ g.addParamQuery(\"q\", [\"?s\", \"?p\", \"?o\"]).subscribe({ next: (r) => res.push(r) });\n+ assert.deepEqual(res, [[\n+ { s: \"a\", p: \"type\", o: \"foo\" },\n+ { s: \"b\", p: \"type\", o: \"bar\" },\n+ { s: \"c\", p: \"type\", o: \"baz\" },\n+ { s: \"a\", p: \"value\", o: 0 },\n+ { s: \"b\", p: \"value\", o: 1 },\n+ { s: \"c\", p: \"friend\", o: \"a\" },\n+ ]]);\n+ });\n});\n", "new_path": "packages/rstream-query/test/index.ts", "old_path": "packages/rstream-query/test/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
test(rstream-query): add query tests
1
test
rstream-query
679,913
24.04.2018 22:56:14
-3,600
97a6e945bf30000e858f3f19f42572efc208f7e9
docs: update various readmes
[ { "change_type": "MODIFY", "diff": "[![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/cache.svg)](https://www.npmjs.com/package/@thi.ng/cache)\n+This project is part of the\n+[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.\n+\n## About\nIn-memory cache implementations with different [eviction\n", "new_path": "packages/cache/README.md", "old_path": "packages/cache/README.md" }, { "change_type": "MODIFY", "diff": "[![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/heaps.svg)](https://www.npmjs.com/package/@thi.ng/heaps)\n+This project is part of the\n+[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.\n+\n## About\nType agnostic binary heap & d-ary heap implementations with customizable\n", "new_path": "packages/heaps/README.md", "old_path": "packages/heaps/README.md" }, { "change_type": "MODIFY", "diff": "[![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/rstream-dot.svg)](https://www.npmjs.com/package/@thi.ng/rstream-dot)\n+This project is part of the\n+[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.\n+\n## About\nGraphviz DOT conversion of @thi.ng/rstream dataflow graph topologies.\n", "new_path": "packages/rstream-dot/README.md", "old_path": "packages/rstream-dot/README.md" }, { "change_type": "MODIFY", "diff": "[![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/rstream-gestures.svg)](https://www.npmjs.com/package/@thi.ng/rstream-gestures)\n+This project is part of the\n+[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.\n+\n## About\nUnified mouse, mouse wheel & single-touch event stream abstraction.\n", "new_path": "packages/rstream-gestures/README.md", "old_path": "packages/rstream-gestures/README.md" }, { "change_type": "MODIFY", "diff": "[![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/rstream-query.svg)](https://www.npmjs.com/package/@thi.ng/rstream-query)\n+This project is part of the\n+[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.\n+\n## About\n-TODO...\n+@thi.ng/rstream based [triple\n+store](https://en.wikipedia.org/wiki/Triplestore) & reactive query\n+engine with high re-use ratio of sub-query results. Inserted\n+facts/triples are broadcast to multiple indexing streams and query\n+subscriptions attached to them. This enables push-based, auto-updating\n+query results, which are only changing if upstream transformations &\n+filters have been triggered.\n+\n+Unlike with traditional RDF triple stores, any JS data types can be used\n+as subject, predicate or object (though support for such must be\n+explicitly enabled).\n+\n+### Status\n+\n+This project is currently in pre-ALPHA and intended as a continuation of\n+the Clojure based [thi.ng/fabric](http://thi.ng/fabric) project, this\n+time built on the streaming primitives provided by\n+[@thi.ng/rstream](https://github.com/thi-ng/umbrella/tree/master/packages/rstream).\n## Installation\n@@ -16,6 +36,8 @@ yarn add @thi.ng/rstream-query\n```typescript\nimport * as rstream-query from \"@thi.ng/rstream-query\";\n+\n+\n```\n## Authors\n", "new_path": "packages/rstream-query/README.md", "old_path": "packages/rstream-query/README.md" }, { "change_type": "MODIFY", "diff": "@@ -71,9 +71,11 @@ are provided too:\n## Supporting packages\n- [@thi.ng/rstream-csp](https://github.com/thi-ng/umbrella/tree/master/packages/rstream-csp) - CSP channel-to-stream adapter\n+- [@thi.ng/rstream-dot](https://github.com/thi-ng/umbrella/tree/master/packages/rstream-dot) - GraphViz DOT conversion of rstream dataflow graph topologies\n- [@thi.ng/rstream-gestures](https://github.com/thi-ng/umbrella/tree/master/packages/rstream-gestures) - unified mouse, single-touch & wheel event stream\n- [@thi.ng/rstream-graph](https://github.com/thi-ng/umbrella/tree/master/packages/rstream-graph) - declarative dataflow graph construction\n- [@thi.ng/rstream-log](https://github.com/thi-ng/umbrella/tree/master/packages/rstream-log) - extensible multi-level, multi-target structured logging\n+- [@thi.ng/rstream-query](https://github.com/thi-ng/umbrella/tree/master/packages/rstream-query) - triple store & reactive query engine\n## Conceptual differences to RxJS\n", "new_path": "packages/rstream/README.md", "old_path": "packages/rstream/README.md" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs: update various readmes
1
docs
null
679,913
25.04.2018 00:56:47
-3,600
cc286e1266a1609370fd9e9c089f6409ce5667d3
fix(rstream): minor fix StreamSync.addAll()
[ { "change_type": "MODIFY", "diff": "@@ -144,7 +144,7 @@ export class StreamSync<A, B> extends Subscription<A, B> {\nfor (let s of <ISubscribable<A>[]>src) {\nthis.sourceIDs.add(s.id);\n}\n- for (let s of src) {\n+ for (let s of <ISubscribable<A>[]>src) {\nthis.add(s);\n}\n}\n", "new_path": "packages/rstream/src/stream-sync.ts", "old_path": "packages/rstream/src/stream-sync.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
fix(rstream): minor fix StreamSync.addAll()
1
fix
rstream
679,913
25.04.2018 01:25:51
-3,600
cf388ddbe7a0611dd8e83ab03e20ff94ae9043ad
docs: update rstream-* readmes
[ { "change_type": "MODIFY", "diff": "@@ -27,6 +27,7 @@ package.\n- [@thi.ng/rstream](https://github.com/thi-ng/umbrella/tree/master/packages/rstream) - reactive stream constructs\n- [@thi.ng/rstream-dot](https://github.com/thi-ng/umbrella/tree/master/packages/rstream-dot) - GraphViz DOT output of graph topology\n- [@thi.ng/rstream-gestures](https://github.com/thi-ng/umbrella/tree/master/packages/rstream-gestures) - unified mouse & single-touch event stream\n+- [@thi.ng/rstream-graph](https://github.com/thi-ng/umbrella/tree/master/packages/rstream-graph) - declarative dataflow graph creation\n- [@thi.ng/transducers](https://github.com/thi-ng/umbrella/tree/master/packages/transducers) - data transformations (here used for stream transforms)\nPlease see detailed comments in the source code for further explanations.\n", "new_path": "examples/rstream-dataflow/README.md", "old_path": "examples/rstream-dataflow/README.md" }, { "change_type": "MODIFY", "diff": "@@ -7,7 +7,9 @@ This project is part of the\n## About\n-Graphviz DOT conversion of @thi.ng/rstream dataflow graph topologies.\n+Graphviz DOT conversion of\n+[@thi.ng/rstream](https://github.com/thi-ng/umbrella/tree/master/packages/rstream)\n+dataflow graph topologies.\n## Installation\n@@ -23,14 +25,14 @@ import * as rsd from \"@thi.ng/rstream-dot\";\nimport * as rs from \"@thi.ng/rstream\";\nimport * as tx from \"@thi.ng/transducers\";\n+// create dummy dataflow\na = rs.fromIterable([1,2,3]);\nb = rs.fromIterable([10, 20, 30]);\n-\na.transform(tx.map((x) => x * 10), \"x10\");\n-\nrs.merge({src: [a, b]}).subscribe(rs.trace());\n// now capture the topology by walking the graph from its root(s)\n+// and convert the result to GraphViz DOT format\nconsole.log(rsd.toDot(rsd.walk([a, b])));\n// digraph g {\n", "new_path": "packages/rstream-dot/README.md", "old_path": "packages/rstream-dot/README.md" }, { "change_type": "MODIFY", "diff": "@@ -30,8 +30,13 @@ yarn add @thi.ng/rstream-gestures\n## Usage examples\n+A small, fully commented project can be found in the `/examples` folder:\n+\n+[Source](https://github.com/thi-ng/umbrella/tree/master/examples/rstream-dataflow) |\n+[Live version](http://demo.thi.ng/umbrella/rstream-dataflow)\n+\n```typescript\n-import * as rsg from \"@thi.ng/rstream-gestures\";\n+import { gestureStream } from \"@thi.ng/rstream-gestures\";\n```\n## Authors\n", "new_path": "packages/rstream-gestures/README.md", "old_path": "packages/rstream-gestures/README.md" }, { "change_type": "MODIFY", "diff": "@@ -21,6 +21,13 @@ yarn add @thi.ng/rstream-graph\n## Usage examples\n+A small, fully commented project can be found in the `/examples` folder:\n+\n+[Source](https://github.com/thi-ng/umbrella/tree/master/examples/rstream-dataflow) |\n+[Live version](http://demo.thi.ng/umbrella/rstream-dataflow)\n+\n+More basic:\n+\n```typescript\nimport { Atom } from \"@thi.ng/atom\";\nimport * as rs from \"@thi.ng/rstream\";\n@@ -65,6 +72,8 @@ state.resetIn(\"a\", 10);\n// result: 360\n```\n+Please documentation in the source code for further details.\n+\n## Authors\n- Karsten Schmidt\n", "new_path": "packages/rstream-graph/README.md", "old_path": "packages/rstream-graph/README.md" }, { "change_type": "MODIFY", "diff": "@@ -84,7 +84,7 @@ final subscriptions to output them to the console (using `trace`, see\nabove).\nBtw. The diagram has been generated using\n-[@thi.ng/rstream-dot](https://github.com/thi-ng/umbrella/tree/master/packages/rstream)\n+[@thi.ng/rstream-dot](https://github.com/thi-ng/umbrella/tree/master/packages/rstream-dot)\nand can be recreated by calling `store.toDot()` (for the above example)\n(Many) more features forthcoming...\n", "new_path": "packages/rstream-query/README.md", "old_path": "packages/rstream-query/README.md" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
docs: update rstream-* readmes
1
docs
null
679,913
25.04.2018 01:32:45
-3,600
888f4e56edc56a9be98c1f8430edae489f8b2369
build: update package keywords
[ { "change_type": "MODIFY", "diff": "\"@thi.ng/transducers\": \"^1.8.1\"\n},\n\"keywords\": [\n+ \"conversion\",\n+ \"dataflow\",\n+ \"DAG\",\n\"ES6\",\n- \"typescript\"\n+ \"graph\",\n+ \"graphviz\",\n+ \"stream\",\n+ \"topology\",\n+ \"typescript\",\n+ \"visualization\"\n],\n\"publishConfig\": {\n\"access\": \"public\"\n", "new_path": "packages/rstream-dot/package.json", "old_path": "packages/rstream-dot/package.json" }, { "change_type": "MODIFY", "diff": "\"@thi.ng/transducers\": \"^1.8.1\"\n},\n\"keywords\": [\n+ \"dataflow\",\n\"ES6\",\n\"events\",\n\"interaction\",\n", "new_path": "packages/rstream-gestures/package.json", "old_path": "packages/rstream-gestures/package.json" }, { "change_type": "MODIFY", "diff": "\"multilevel\",\n\"multiplex\",\n\"pipeline\",\n+ \"stream\",\n\"transducers\",\n\"typescript\"\n],\n", "new_path": "packages/rstream-log/package.json", "old_path": "packages/rstream-log/package.json" }, { "change_type": "MODIFY", "diff": "\"@thi.ng/transducers\": \"^1.8.1\"\n},\n\"keywords\": [\n+ \"dataflow\",\n\"ES6\",\n+ \"query engine\",\n+ \"reactive\",\n+ \"stream\",\n+ \"subscription\",\n+ \"triples\",\n+ \"triplestore\",\n\"typescript\"\n],\n\"publishConfig\": {\n", "new_path": "packages/rstream-query/package.json", "old_path": "packages/rstream-query/package.json" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
build: update package keywords
1
build
null
815,785
25.04.2018 09:27:13
-10,800
47f02c87a0a22ab187ee9ffd2e699462b5a1b37b
feat: clear on add functionality, expose updateDropdownPosition closes
[ { "change_type": "MODIFY", "diff": "@@ -129,6 +129,7 @@ map: {\n| placeholder | `string` | `-` | no | Placeholder text. |\n| [searchable] | `boolean` | `true` | no | Allow to search for value. Default `true`|\n| [searchFn] | `(term: string, item: any) => boolean` | `null` | no | Allow to filter by custom search function |\n+| [clearSearchOnAdd] | `boolean` | `true` | no | Clears search input when item is selected. Default `true`|\n| [selectOnTab] | `boolean` | `false` | no | Select marked dropdown item using tab. Default `false`|\n| [typeahead] | `Subject` | `-` | no | Custom autocomplete or advanced filter. |\n| typeToSearchText | `string` | `Type to search` | no | Set custom text when using Typeahead |\n", "new_path": "README.md", "old_path": "README.md" }, { "change_type": "MODIFY", "diff": "@@ -118,7 +118,7 @@ export class NgDropdownPanelComponent implements OnInit, OnChanges, OnDestroy, A\nngAfterContentInit() {\nthis._whenContentReady().then(() => {\n- this._handleDropdownPosition();\n+ this.updateDropdownPosition();\n});\n}\n@@ -159,6 +159,34 @@ export class NgDropdownPanelComponent implements OnInit, OnChanges, OnDestroy, A\nel.scrollTop = d.childHeight * (d.itemsLength + 1);\n}\n+ updateDropdownPosition() {\n+ if (this.appendTo) {\n+ this._appendDropdown();\n+ this._handleDocumentResize();\n+ }\n+\n+ const dropdownEl: HTMLElement = this._elementRef.nativeElement;\n+ this._currentPosition = this._calculateCurrentPosition(dropdownEl);\n+ const selectEl: HTMLElement = this._selectElement;\n+ if (this._currentPosition === 'top') {\n+ this._renderer.addClass(dropdownEl, TOP_CSS_CLASS)\n+ this._renderer.removeClass(dropdownEl, BOTTOM_CSS_CLASS)\n+ this._renderer.addClass(selectEl, TOP_CSS_CLASS)\n+ this._renderer.removeClass(selectEl, BOTTOM_CSS_CLASS)\n+ } else {\n+ this._renderer.addClass(dropdownEl, BOTTOM_CSS_CLASS)\n+ this._renderer.removeClass(dropdownEl, TOP_CSS_CLASS)\n+ this._renderer.addClass(selectEl, BOTTOM_CSS_CLASS)\n+ this._renderer.removeClass(selectEl, TOP_CSS_CLASS)\n+ }\n+\n+ if (this.appendTo) {\n+ this._updateAppendedDropdownPosition();\n+ }\n+\n+ dropdownEl.style.opacity = '1';\n+ }\n+\nprivate _handleOutsideClick($event: any) {\nif (this._selectElement.contains($event.target)) {\nreturn;\n@@ -277,34 +305,6 @@ export class NgDropdownPanelComponent implements OnInit, OnChanges, OnDestroy, A\nthis.scrollInto(this._itemsList.markedItem)\n}\n- private _handleDropdownPosition() {\n- if (this.appendTo) {\n- this._appendDropdown();\n- this._handleDocumentResize();\n- }\n-\n- const dropdownEl: HTMLElement = this._elementRef.nativeElement;\n- this._currentPosition = this._calculateCurrentPosition(dropdownEl);\n- const selectEl: HTMLElement = this._selectElement;\n- if (this._currentPosition === 'top') {\n- this._renderer.addClass(dropdownEl, TOP_CSS_CLASS)\n- this._renderer.removeClass(dropdownEl, BOTTOM_CSS_CLASS)\n- this._renderer.addClass(selectEl, TOP_CSS_CLASS)\n- this._renderer.removeClass(selectEl, BOTTOM_CSS_CLASS)\n- } else {\n- this._renderer.addClass(dropdownEl, BOTTOM_CSS_CLASS)\n- this._renderer.removeClass(dropdownEl, TOP_CSS_CLASS)\n- this._renderer.addClass(selectEl, BOTTOM_CSS_CLASS)\n- this._renderer.removeClass(selectEl, TOP_CSS_CLASS)\n- }\n-\n- if (this.appendTo) {\n- this._updateAppendedDropdownPosition();\n- }\n-\n- dropdownEl.style.opacity = '1';\n- }\n-\nprivate _calculateCurrentPosition(dropdownEl: HTMLElement) {\nif (this.position !== 'auto') {\nreturn this.position;\n", "new_path": "src/ng-select/ng-dropdown-panel.component.ts", "old_path": "src/ng-select/ng-dropdown-panel.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -2007,6 +2007,58 @@ describe('NgSelectComponent', function () {\nexpect(fixture.componentInstance.select.isOpen).toBeTruthy();\n}));\n});\n+\n+ describe('clear on add', () => {\n+ it('should clear search term by default', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ [typeahead]=\"filter\"\n+ bindLabel=\"name\"\n+ [hideSelected]=\"hideSelected\"\n+ [closeOnSelect]=\"false\"\n+ [(ngModel)]=\"selectedCity\">\n+ </ng-select>`);\n+\n+ expect(fixture.componentInstance.select.clearSearchOnAdd).toBeTruthy();\n+\n+ fixture.componentInstance.filter.subscribe();\n+ fixture.componentInstance.select.filter('new');\n+ fixture.componentInstance.cities = [{ id: 4, name: 'New York' }];\n+ tickAndDetectChanges(fixture);\n+ expect(fixture.componentInstance.select.itemsList.filteredItems.length).toBe(1);\n+ expect(fixture.componentInstance.select.filterValue).toBe('new');\n+\n+ fixture.componentInstance.select.select(fixture.componentInstance.select.viewPortItems[0]);\n+ expect(fixture.componentInstance.select.filterValue).toBeNull();\n+ }));\n+\n+ it('should not clear search term when clearSearchOnAdd is false', fakeAsync(() => {\n+ const fixture = createTestingModule(\n+ NgSelectTestCmp,\n+ `<ng-select [items]=\"cities\"\n+ [typeahead]=\"filter\"\n+ bindLabel=\"name\"\n+ [hideSelected]=\"hideSelected\"\n+ [clearSearchOnAdd]=\"false\"\n+ [closeOnSelect]=\"false\"\n+ [(ngModel)]=\"selectedCity\">\n+ </ng-select>`);\n+\n+ expect(fixture.componentInstance.select.clearSearchOnAdd).toBeFalsy();\n+ expect(fixture.componentInstance.select.closeOnSelect).toBeFalsy();\n+\n+ fixture.componentInstance.filter.subscribe();\n+ fixture.componentInstance.select.filter('new');\n+ fixture.componentInstance.cities = [{ id: 4, name: 'New York' }, { id: 5, name: 'California' }];\n+ tickAndDetectChanges(fixture);\n+ expect(fixture.componentInstance.select.itemsList.filteredItems.length).toBe(2);\n+ expect(fixture.componentInstance.select.filterValue).toBe('new');\n+\n+ fixture.componentInstance.select.select(fixture.componentInstance.select.viewPortItems[0]);\n+ expect(fixture.componentInstance.select.filterValue).toBe('new');\n+ }));\n+ });\n});\ndescribe('Accessability', () => {\n", "new_path": "src/ng-select/ng-select.component.spec.ts", "old_path": "src/ng-select/ng-select.component.spec.ts" }, { "change_type": "MODIFY", "diff": "@@ -98,6 +98,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n@Input() virtualScroll = false;\n@Input() selectableGroup = false;\n@Input() searchFn = null;\n+ @Input() clearSearchOnAdd = true;\n@Input() @HostBinding('class.ng-select-typeahead') typeahead: Subject<string>;\n@Input() @HostBinding('class.ng-select-multiple') multiple = false;\n@Input() @HostBinding('class.ng-select-taggable') addTag: boolean | AddTagFn = false;\n@@ -352,7 +353,11 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nselect(item: NgOption) {\nthis.itemsList.select(item);\n+\n+ if (this.clearSearchOnAdd) {\nthis._clearSearch();\n+ }\n+\nthis.addEvent.emit(item.value);\nif (this.closeOnSelect || this.itemsList.noItemsToSelect) {\nthis.close();\n@@ -455,6 +460,12 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\n}\n+ updateDropdownPosition() {\n+ if (this.dropdownPanel) {\n+ this.dropdownPanel.updateDropdownPosition();\n+ }\n+ }\n+\nprivate _setItems(items: any[]) {\nconst firstItem = items[0];\nthis.bindLabel = this.bindLabel || this._defaultLabel;\n", "new_path": "src/ng-select/ng-select.component.ts", "old_path": "src/ng-select/ng-select.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
feat: clear on add functionality, expose updateDropdownPosition (#497) closes #276
1
feat
null
217,922
25.04.2018 10:04:07
-7,200
40a2d161ceda6147c21ff01259e0c0983fa6e95b
fix: folklore icon missing in some cases
[ { "change_type": "MODIFY", "diff": "</div>\n<div *ngIf=\"folkloreId\" [ngClass]=\"{'masterbook':true, 'compact': settings.compactLists}\">\n<img matListAvatar\n- src=\"https://ffxiv.consolegameswiki.com/mediawiki/images/5/53/Tome_of_ichthyological_folklore_-_coerthas_icon1.png\"\n+ src=\"/assets/FSH_folklore.png\"\nmatTooltip=\"{{folkloreId | itemName | i18n}}\"\nmatTooltipPosition=\"above\"\nalt=\"{{folkloreId | itemName | i18n}}\">\n", "new_path": "src/app/modules/item/item/item.component.html", "old_path": "src/app/modules/item/item/item.component.html" }, { "change_type": "ADD", "diff": "Binary files /dev/null and b/src/assets/icons/BTN_folklore.png differ\n", "new_path": "src/assets/icons/BTN_folklore.png", "old_path": "src/assets/icons/BTN_folklore.png" }, { "change_type": "ADD", "diff": "Binary files /dev/null and b/src/assets/icons/FSH_folklore.png differ\n", "new_path": "src/assets/icons/FSH_folklore.png", "old_path": "src/assets/icons/FSH_folklore.png" }, { "change_type": "ADD", "diff": "Binary files /dev/null and b/src/assets/icons/MIN_folklore.png differ\n", "new_path": "src/assets/icons/MIN_folklore.png", "old_path": "src/assets/icons/MIN_folklore.png" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: folklore icon missing in some cases
1
fix
null
217,922
25.04.2018 10:27:50
-7,200
b0e80d892fa623ab80a23cef77aa9da7ed8c4623
chore: fixed bad filepath for folklore icon
[ { "change_type": "MODIFY", "diff": "</div>\n<div *ngIf=\"folkloreId\" [ngClass]=\"{'masterbook':true, 'compact': settings.compactLists}\">\n<img matListAvatar\n- src=\"/assets/FSH_folklore.png\"\n+ src=\"/assets/icons/FSH_folklore.png\"\nmatTooltip=\"{{folkloreId | itemName | i18n}}\"\nmatTooltipPosition=\"above\"\nalt=\"{{folkloreId | itemName | i18n}}\">\n", "new_path": "src/app/modules/item/item/item.component.html", "old_path": "src/app/modules/item/item/item.component.html" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore: fixed bad filepath for folklore icon
1
chore
null
791,723
25.04.2018 10:54:38
25,200
f1997113972f77c4431963bead908cf3ff0289d9
core(lhr): overallSavingsMs, overallSavingsBytes
[ { "change_type": "MODIFY", "diff": "@@ -64,7 +64,7 @@ declare global {\n* 'informative': the audit is an FYI only, and can't be interpreted as pass/fail. Score is null and should be ignored.\n* 'notApplicable': the audit turned out to not apply to the page. Score is null and should be ignored.\n* 'manual': The audit exists only to tell you to review something yourself. Score is null and should be ignored.\n- * 'error': There was an error while running the object (check `errorMessage` for details). Score is null and should be ignored.\n+ * 'error': There was an error while running the audit (check `errorMessage` for details). Score is null and should be ignored.\n*/\nscoreDisplayMode: 'binary' | 'numeric' | 'informative' | 'notApplicable' | 'manual' | 'error';\n/** An explanation of audit-related issues encountered on the test page. */\n@@ -84,8 +84,8 @@ declare global {\nexport interface OpportunityDetails {\ntype: 'opportunity';\n- wastedMs: number\n- wastedBytes?: number\n+ overallSavingsMs: number\n+ overallSavingsBytes?: number\nheadings: ColumnHeading[];\nitems: (WastedBytesDetailsItem | WastedTimeDetailsItem)[];\n}\n", "new_path": "typings/lhr-lite.d.ts", "old_path": "typings/lhr-lite.d.ts" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
core(lhr): overallSavingsMs, overallSavingsBytes (#5035)
1
core
lhr
815,746
25.04.2018 11:11:39
-10,800
ea06c645637a0ca0a1d2318ec8e70522a51a3aa1
fix: remove initial dropdown append logic from updateDropdownPosition
[ { "change_type": "MODIFY", "diff": "@@ -118,6 +118,10 @@ export class NgDropdownPanelComponent implements OnInit, OnChanges, OnDestroy, A\nngAfterContentInit() {\nthis._whenContentReady().then(() => {\n+ if (this.appendTo) {\n+ this._appendDropdown();\n+ this._handleDocumentResize();\n+ }\nthis.updateDropdownPosition();\n});\n}\n@@ -160,11 +164,6 @@ export class NgDropdownPanelComponent implements OnInit, OnChanges, OnDestroy, A\n}\nupdateDropdownPosition() {\n- if (this.appendTo) {\n- this._appendDropdown();\n- this._handleDocumentResize();\n- }\n-\nconst dropdownEl: HTMLElement = this._elementRef.nativeElement;\nthis._currentPosition = this._calculateCurrentPosition(dropdownEl);\nconst selectEl: HTMLElement = this._selectElement;\n", "new_path": "src/ng-select/ng-dropdown-panel.component.ts", "old_path": "src/ng-select/ng-dropdown-panel.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: remove initial dropdown append logic from updateDropdownPosition
1
fix
null
815,746
25.04.2018 11:12:14
-10,800
3ea144dda9fdb540c6f0234e1e319d158c399383
chore(release): 1.2.1
[ { "change_type": "MODIFY", "diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"1.2.1\"></a>\n+## [1.2.1](https://github.com/ng-select/ng-select/compare/v1.2.0...v1.2.1) (2018-04-25)\n+\n+\n+### Bug Fixes\n+\n+* remove initial dropdown append logic from updateDropdownPosition ([ea06c64](https://github.com/ng-select/ng-select/commit/ea06c64))\n+\n+\n+\n<a name=\"1.2.0\"></a>\n# [1.2.0](https://github.com/ng-select/ng-select/compare/v1.1.4...v1.2.0) (2018-04-25)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"$schema\": \"../node_modules/ng-packagr/package.schema.json\",\n\"name\": \"@ng-select/ng-select\",\n- \"version\": \"1.2.0\",\n+ \"version\": \"1.2.1\",\n\"description\": \"Angular ng-select - All in One UI Select, Multiselect and Autocomplete\",\n\"author\": \"@ng-select/ng-select\",\n\"license\": \"MIT\",\n", "new_path": "src/package.json", "old_path": "src/package.json" } ]
TypeScript
MIT License
ng-select/ng-select
chore(release): 1.2.1
1
chore
release
815,751
25.04.2018 11:15:59
18,000
47f2e597bcb182c94a6e42c05d2765ba31be45ff
fix: load items from ng-option async fixes
[ { "change_type": "MODIFY", "diff": "@@ -197,7 +197,7 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\nngAfterViewInit() {\n- if (this.ngOptions.length > 0 && this.items.length === 0) {\n+ if (this.items && this.items.length === 0) {\nthis._setItemsFromNgOptions();\n}\n}\n", "new_path": "src/ng-select/ng-select.component.ts", "old_path": "src/ng-select/ng-select.component.ts" } ]
TypeScript
MIT License
ng-select/ng-select
fix: load items from ng-option async (#489) fixes #479
1
fix
null
791,690
25.04.2018 13:02:47
25,200
1957caec83c57045a57b1353b49f82f29404dcfb
core(tti): update ignorable network requests and use FCP
[ { "change_type": "MODIFY", "diff": "@@ -14,6 +14,11 @@ const LHError = require('../../../lib/errors');\nconst REQUIRED_QUIET_WINDOW = 5000;\nconst ALLOWED_CONCURRENT_REQUESTS = 2;\n+/**\n+ * @fileoverview Computes \"Time To Interactive\", the time at which the page has loaded critical\n+ * resources and is mostly idle.\n+ * @see https://docs.google.com/document/d/1yE4YWsusi5wVXrnwhR61j-QyjK9tzENIzfxrCjA1NAk/edit#heading=h.yozfsuqcgpc4\n+ */\nclass ConsistentlyInteractive extends MetricArtifact {\nget name() {\nreturn 'ConsistentlyInteractive';\n@@ -28,7 +33,13 @@ class ConsistentlyInteractive extends MetricArtifact {\n*/\nstatic _findNetworkQuietPeriods(networkRecords, traceOfTab) {\nconst traceEndTsInMs = traceOfTab.timestamps.traceEnd / 1000;\n- return NetworkRecorder.findNetworkQuietPeriods(networkRecords,\n+ // Ignore records that failed, never finished, or were POST/PUT/etc.\n+ const filteredNetworkRecords = networkRecords.filter(record => {\n+ return record.finished && record.requestMethod === 'GET' && !record.failed &&\n+ // Consider network records that had 4xx/5xx status code as \"failed\"\n+ record.statusCode < 400;\n+ });\n+ return NetworkRecorder.findNetworkQuietPeriods(filteredNetworkRecords,\nALLOWED_CONCURRENT_REQUESTS, traceEndTsInMs);\n}\n@@ -79,11 +90,11 @@ class ConsistentlyInteractive extends MetricArtifact {\n* @return {{cpuQuietPeriod: TimePeriod, networkQuietPeriod: TimePeriod, cpuQuietPeriods: Array<TimePeriod>, networkQuietPeriods: Array<TimePeriod>}}\n*/\nstatic findOverlappingQuietPeriods(longTasks, networkRecords, traceOfTab) {\n- const FMPTsInMs = traceOfTab.timestamps.firstMeaningfulPaint / 1000;\n+ const FcpTsInMs = traceOfTab.timestamps.firstContentfulPaint / 1000;\n/** @type {function(TimePeriod):boolean} */\nconst isLongEnoughQuietPeriod = period =>\n- period.end > FMPTsInMs + REQUIRED_QUIET_WINDOW &&\n+ period.end > FcpTsInMs + REQUIRED_QUIET_WINDOW &&\nperiod.end - period.start >= REQUIRED_QUIET_WINDOW;\nconst networkQuietPeriods = this._findNetworkQuietPeriods(networkRecords, traceOfTab)\n.filter(isLongEnoughQuietPeriod);\n@@ -137,8 +148,8 @@ class ConsistentlyInteractive extends MetricArtifact {\n*/\ncomputeObservedMetric(data) {\nconst {traceOfTab, networkRecords} = data;\n- if (!traceOfTab.timestamps.firstMeaningfulPaint) {\n- throw new LHError(LHError.errors.NO_FMP);\n+ if (!traceOfTab.timestamps.firstContentfulPaint) {\n+ throw new LHError(LHError.errors.NO_FCP);\n}\nif (!traceOfTab.timestamps.domContentLoaded) {\n@@ -157,7 +168,7 @@ class ConsistentlyInteractive extends MetricArtifact {\nconst timestamp = Math.max(\ncpuQuietPeriod.start,\n- traceOfTab.timestamps.firstMeaningfulPaint / 1000,\n+ traceOfTab.timestamps.firstContentfulPaint / 1000,\ntraceOfTab.timestamps.domContentLoaded / 1000\n) * 1000;\nconst timing = (timestamp - traceOfTab.timestamps.navigationStart) / 1000;\n", "new_path": "lighthouse-core/gather/computed/metrics/consistently-interactive.js", "old_path": "lighthouse-core/gather/computed/metrics/consistently-interactive.js" }, { "change_type": "MODIFY", "diff": "@@ -97,7 +97,7 @@ const ERRORS = {\nObject.keys(ERRORS).forEach(code => ERRORS[code].code = code);\n-/** @type {Object<string, LighthouseErrorDefinition>} */\n+/** @type {Object<keyof ERRORS, LighthouseErrorDefinition>} */\nLighthouseError.errors = ERRORS;\nmodule.exports = LighthouseError;\n", "new_path": "lighthouse-core/lib/errors.js", "old_path": "lighthouse-core/lib/errors.js" }, { "change_type": "MODIFY", "diff": "@@ -17,6 +17,9 @@ function generateNetworkRecords(records, navStart) {\nconst navStartInMs = navStart / 1000;\nreturn records.map(item => {\nreturn {\n+ failed: item.failed || false,\n+ statusCode: item.statusCode || 200,\n+ requestMethod: item.requestMethod || 'GET',\nfinished: typeof item.finished === 'undefined' ? true : item.finished,\nstartTime: (item.start + navStartInMs) / 1000,\nendTime: item.end === -1 ? -1 : (item.end + navStartInMs) / 1000,\n@@ -52,9 +55,9 @@ describe('Metrics: TTCI', () => {\ndescribe('#findOverlappingQuietPeriods', () => {\nit('should return entire range when no activity is present', () => {\nconst navigationStart = 220023532;\n- const firstMeaningfulPaint = 2500 * 1000 + navigationStart;\n+ const firstContentfulPaint = 2500 * 1000 + navigationStart;\nconst traceEnd = 10000 * 1000 + navigationStart;\n- const traceOfTab = {timestamps: {navigationStart, firstMeaningfulPaint, traceEnd}};\n+ const traceOfTab = {timestamps: {navigationStart, firstContentfulPaint, traceEnd}};\nconst cpu = [];\nconst network = generateNetworkRecords([], navigationStart);\n@@ -66,9 +69,9 @@ describe('Metrics: TTCI', () => {\nit('should throw when trace ended too soon after FMP', () => {\nconst navigationStart = 220023532;\n- const firstMeaningfulPaint = 2500 * 1000 + navigationStart;\n+ const firstContentfulPaint = 2500 * 1000 + navigationStart;\nconst traceEnd = 5000 * 1000 + navigationStart;\n- const traceOfTab = {timestamps: {navigationStart, firstMeaningfulPaint, traceEnd}};\n+ const traceOfTab = {timestamps: {navigationStart, firstContentfulPaint, traceEnd}};\nconst cpu = [];\nconst network = generateNetworkRecords([], navigationStart);\n@@ -80,9 +83,9 @@ describe('Metrics: TTCI', () => {\nit('should throw when CPU is quiet but network is not', () => {\nconst navigationStart = 220023532;\n- const firstMeaningfulPaint = 2500 * 1000 + navigationStart;\n+ const firstContentfulPaint = 2500 * 1000 + navigationStart;\nconst traceEnd = 10000 * 1000 + navigationStart;\n- const traceOfTab = {timestamps: {navigationStart, firstMeaningfulPaint, traceEnd}};\n+ const traceOfTab = {timestamps: {navigationStart, firstContentfulPaint, traceEnd}};\nconst cpu = [];\nconst network = generateNetworkRecords([\n@@ -99,9 +102,9 @@ describe('Metrics: TTCI', () => {\nit('should throw when network is quiet but CPU is not', () => {\nconst navigationStart = 220023532;\n- const firstMeaningfulPaint = 2500 * 1000 + navigationStart;\n+ const firstContentfulPaint = 2500 * 1000 + navigationStart;\nconst traceEnd = 10000 * 1000 + navigationStart;\n- const traceOfTab = {timestamps: {navigationStart, firstMeaningfulPaint, traceEnd}};\n+ const traceOfTab = {timestamps: {navigationStart, firstContentfulPaint, traceEnd}};\nconst cpu = [\n{start: 3000, end: 8000},\n@@ -115,29 +118,32 @@ describe('Metrics: TTCI', () => {\n}, /NO.*CPU_IDLE_PERIOD/);\n});\n- it('should handle unfinished network requests', () => {\n+ it('should ignore unnecessary network requests', () => {\nconst navigationStart = 220023532;\n- const firstMeaningfulPaint = 2500 * 1000 + navigationStart;\n+ const firstContentfulPaint = 2500 * 1000 + navigationStart;\nconst traceEnd = 10000 * 1000 + navigationStart;\n- const traceOfTab = {timestamps: {navigationStart, firstMeaningfulPaint, traceEnd}};\n+ const traceOfTab = {timestamps: {navigationStart, firstContentfulPaint, traceEnd}};\nconst cpu = [];\n- const network = generateNetworkRecords([\n- {start: 0, end: -1, finished: false},\n- {start: 0, end: -1, finished: false},\n+ let network = generateNetworkRecords([\n{start: 0, end: -1, finished: false},\n+ {start: 0, end: 11000, failed: true},\n+ {start: 0, end: 11000, requestMethod: 'POST'},\n+ {start: 0, end: 11000, statusCode: 500},\n], navigationStart);\n+ // Triple the requests to ensure it's not just the 2-quiet kicking in\n+ network = network.concat(network).concat(network);\n- assert.throws(() => {\n- ConsistentlyInteractive.findOverlappingQuietPeriods(cpu, network, traceOfTab);\n- }, /NO.*NETWORK_IDLE_PERIOD/);\n+ const result = ConsistentlyInteractive.findOverlappingQuietPeriods(cpu, network, traceOfTab);\n+ assert.deepEqual(result.cpuQuietPeriod, {start: 0, end: traceEnd / 1000});\n+ assert.deepEqual(result.networkQuietPeriod, {start: 0, end: traceEnd / 1000});\n});\nit('should find first overlapping quiet period', () => {\nconst navigationStart = 220023532;\n- const firstMeaningfulPaint = 10000 * 1000 + navigationStart;\n+ const firstContentfulPaint = 10000 * 1000 + navigationStart;\nconst traceEnd = 45000 * 1000 + navigationStart;\n- const traceOfTab = {timestamps: {navigationStart, firstMeaningfulPaint, traceEnd}};\n+ const traceOfTab = {timestamps: {navigationStart, firstContentfulPaint, traceEnd}};\nconst cpu = [\n// quiet period before FMP\n", "new_path": "lighthouse-core/test/gather/computed/metrics/consistently-interactive-test.js", "old_path": "lighthouse-core/test/gather/computed/metrics/consistently-interactive-test.js" }, { "change_type": "MODIFY", "diff": "@@ -29,6 +29,7 @@ declare global {\n_resourceSize?: number;\nfinished: boolean;\n+ requestMethod: string;\nstatusCode: number;\nredirectSource?: {\nurl: string;\n", "new_path": "typings/web-inspector.d.ts", "old_path": "typings/web-inspector.d.ts" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
core(tti): update ignorable network requests and use FCP (#5021)
1
core
tti
679,913
25.04.2018 13:20:34
-3,600
c5f36a2d2ed3352c9fa362af36f5adafc3c3ce3a
feat(rstream-query): add addQueryJoin(), add type aliases, update tests
[ { "change_type": "MODIFY", "diff": "+import { IObjectOf } from \"@thi.ng/api/api\";\n+\nexport type Pattern = [any, any, any];\nexport type Triple = Pattern;\n-export type TripleIds = Set<number>\n+export type Triples = Set<Pattern>;\n+\n+export type TripleIds = Set<number>;\n+\n+export type Solutions = Set<IObjectOf<any>>;\nexport const CHOICES = Symbol(\"CHOICES\");\n", "new_path": "packages/rstream-query/src/api.ts", "old_path": "packages/rstream-query/src/api.ts" }, { "change_type": "MODIFY", "diff": "@@ -2,13 +2,16 @@ import { IObjectOf } from \"@thi.ng/api/api\";\nimport { equiv } from \"@thi.ng/api/equiv\";\nimport { illegalArgs } from \"@thi.ng/api/error\";\nimport { intersection } from \"@thi.ng/associative/intersection\";\n+import { join } from \"@thi.ng/associative\";\nimport { Stream, Subscription, sync } from \"@thi.ng/rstream\";\nimport { toDot, walk, DotOpts, IToDot } from \"@thi.ng/rstream-dot\";\nimport { Transducer, Reducer } from \"@thi.ng/transducers/api\";\n+import { comp } from \"@thi.ng/transducers/func/comp\";\nimport { compR } from \"@thi.ng/transducers/func/compr\";\n+import { filter } from \"@thi.ng/transducers/xform/filter\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\n-import { DEBUG, Edit, Triple, TripleIds, Pattern } from \"./api\";\n+import { DEBUG, Edit, Triple, TripleIds, Pattern, Solutions, Triples } from \"./api\";\nimport { qvarResolver } from \"./pattern\";\nimport { isQVar } from \"./qvar\";\n@@ -111,8 +114,8 @@ export class TripleStore implements\n* @param id\n* @param param1\n*/\n- addPatternQuery(id: string, [s, p, o]: Pattern, emitTriples = true): Subscription<TripleIds, TripleIds | Set<Triple>> {\n- let results: Subscription<any, TripleIds | Set<Triple>>;\n+ addPatternQuery(id: string, [s, p, o]: Pattern, emitTriples = true): Subscription<TripleIds, TripleIds | Triples> {\n+ let results: Subscription<any, TripleIds | Triples>;\nif (s == null && p == null && o == null) {\nresults = this.streamAll;\n} else {\n@@ -161,7 +164,7 @@ export class TripleStore implements\n* @param id\n* @param param1\n*/\n- addParamQuery(id: string, [s, p, o]: Pattern) {\n+ addParamQuery(id: string, [s, p, o]: Pattern): Subscription<Triples, Solutions> {\nconst vs = isQVar(s);\nconst vp = isQVar(p);\nconst vo = isQVar(o);\n@@ -175,9 +178,9 @@ export class TripleStore implements\n);\nreturn query.transform(\nmap((triples: Set<Triple>) => {\n- const res = [];\n+ const res = new Set<any>();\nfor (let f of triples) {\n- res.push(resolve(f));\n+ res.add(resolve(f));\n}\nreturn res;\n}),\n@@ -185,6 +188,23 @@ export class TripleStore implements\n);\n}\n+ /**\n+ * Returns a rstream subscription computing the natural join of the\n+ * given input query results. The subscription only produces results\n+ * if there's at least 1 joined result.\n+ *\n+ * @param id\n+ * @param a\n+ * @param b\n+ */\n+ addQueryJoin(id: string, a: Subscription<any, Solutions>, b: Subscription<any, Solutions>): Subscription<Solutions, Solutions> {\n+ return sync<Solutions, Solutions>({\n+ id,\n+ src: { a, b },\n+ xform: comp(map(({ a, b }) => join(a, b)), filter((x) => x.size > 0))\n+ });\n+ }\n+\ntoDot(opts?: Partial<DotOpts>) {\nreturn toDot(walk([this.streamS, this.streamP, this.streamO, this.streamAll]), opts);\n}\n", "new_path": "packages/rstream-query/src/store.ts", "old_path": "packages/rstream-query/src/store.ts" }, { "change_type": "MODIFY", "diff": "@@ -70,37 +70,37 @@ describe(\"rstream-query\", () => {\nit(\"param query (S)\", () => {\nconst res = [];\nstore.addParamQuery(\"q\", [\"a\", \"?p\", \"?o\"]).subscribe({ next: (r) => res.push(r) });\n- assert.deepEqual(res, [[{ p: \"type\", o: \"foo\" }, { p: \"value\", o: 0 }]]);\n+ assert.deepEqual(res, [new Set([{ p: \"type\", o: \"foo\" }, { p: \"value\", o: 0 }])]);\n});\nit(\"param query (P)\", () => {\nconst res = [];\nstore.addParamQuery(\"q\", [\"?s\", \"type\", \"?o\"]).subscribe({ next: (r) => res.push(r) });\n- assert.deepEqual(res, [[{ s: \"a\", o: \"foo\" }, { s: \"b\", o: \"bar\" }, { s: \"c\", o: \"baz\" }]]);\n+ assert.deepEqual(res, [new Set([{ s: \"a\", o: \"foo\" }, { s: \"b\", o: \"bar\" }, { s: \"c\", o: \"baz\" }])]);\n});\nit(\"param query (O)\", () => {\nconst res = [];\nstore.addParamQuery(\"q\", [\"?s\", \"?p\", \"a\"]).subscribe({ next: (r) => res.push(r) });\n- assert.deepEqual(res, [[{ s: \"c\", p: \"friend\" }]]);\n+ assert.deepEqual(res, [new Set([{ s: \"c\", p: \"friend\" }])]);\n});\nit(\"param query (SP)\", () => {\nconst res = [];\nstore.addParamQuery(\"q\", [\"a\", \"value\", \"?o\"]).subscribe({ next: (r) => res.push(r) });\n- assert.deepEqual(res, [[{ o: 0 }]]);\n+ assert.deepEqual(res, [new Set([{ o: 0 }])]);\n});\nit(\"param query (PO)\", () => {\nconst res = [];\nstore.addParamQuery(\"q\", [\"?s\", \"value\", 0]).subscribe({ next: (r) => res.push(r) });\n- assert.deepEqual(res, [[{ s: \"a\" }]]);\n+ assert.deepEqual(res, [new Set([{ s: \"a\" }])]);\n});\nit(\"param query (SO)\", () => {\nconst res = [];\nstore.addParamQuery(\"q\", [\"b\", \"?p\", \"bar\"]).subscribe({ next: (r) => res.push(r) });\n- assert.deepEqual(res, [[{ p: \"type\" }]]);\n+ assert.deepEqual(res, [new Set([{ p: \"type\" }])]);\n});\nit(\"param query (SPO)\", () => {\n@@ -110,13 +110,13 @@ describe(\"rstream-query\", () => {\nit(\"param query (all)\", () => {\nconst res = [];\nstore.addParamQuery(\"q\", [\"?s\", \"?p\", \"?o\"]).subscribe({ next: (r) => res.push(r) });\n- assert.deepEqual(res, [[\n+ assert.deepEqual(res, [new Set([\n{ s: \"a\", p: \"type\", o: \"foo\" },\n{ s: \"b\", p: \"type\", o: \"bar\" },\n{ s: \"c\", p: \"type\", o: \"baz\" },\n{ s: \"a\", p: \"value\", o: 0 },\n{ s: \"b\", p: \"value\", o: 1 },\n{ s: \"c\", p: \"friend\", o: \"a\" },\n- ]]);\n+ ])]);\n});\n});\n", "new_path": "packages/rstream-query/test/index.ts", "old_path": "packages/rstream-query/test/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(rstream-query): add addQueryJoin(), add type aliases, update tests
1
feat
rstream-query
791,723
25.04.2018 14:23:11
25,200
f82680f2497eeaf09b5cc2809c4bb4aeb623dfad
core(lantern): rename Simulation.Result.nodeTiming to be plural
[ { "change_type": "MODIFY", "diff": "@@ -129,8 +129,8 @@ class UnusedBytes extends Audit {\n});\nconst savingsOnTTI = Math.max(\n- ConsistentlyInteractive.getLastLongTaskEndTime(simulationBeforeChanges.nodeTiming) -\n- ConsistentlyInteractive.getLastLongTaskEndTime(simulationAfterChanges.nodeTiming),\n+ ConsistentlyInteractive.getLastLongTaskEndTime(simulationBeforeChanges.nodeTimings) -\n+ ConsistentlyInteractive.getLastLongTaskEndTime(simulationAfterChanges.nodeTimings),\n0\n);\n", "new_path": "lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js", "old_path": "lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js" }, { "change_type": "MODIFY", "diff": "@@ -23,14 +23,14 @@ const WebInspector = require('../../lib/web-inspector');\nconst MINIMUM_WASTED_MS = 50;\n/**\n- * Given a simulation's nodeTiming, return an object with the nodes/timing keyed by network URL\n- * @param {LH.Gatherer.Simulation.Result['nodeTiming']} nodeTimingMap\n+ * Given a simulation's nodeTimings, return an object with the nodes/timing keyed by network URL\n+ * @param {LH.Gatherer.Simulation.Result['nodeTimings']} nodeTimings\n* @return {Object<string, {node: Node, nodeTiming: LH.Gatherer.Simulation.NodeTiming}>}\n*/\n-const getNodesAndTimingByUrl = nodeTimingMap => {\n- const nodes = Array.from(nodeTimingMap.keys());\n+const getNodesAndTimingByUrl = nodeTimings => {\n+ const nodes = Array.from(nodeTimings.keys());\nreturn nodes.reduce((map, node) => {\n- map[node.record && node.record.url] = {node, nodeTiming: nodeTimingMap.get(node)};\n+ map[node.record && node.record.url] = {node, nodeTiming: nodeTimings.get(node)};\nreturn map;\n}, {});\n};\n@@ -70,7 +70,7 @@ class RenderBlockingResources extends Audit {\nconst fcpSimulation = await artifacts.requestFirstContentfulPaint(metricComputationData);\nconst fcpTsInMs = traceOfTab.timestamps.firstContentfulPaint / 1000;\n- const nodesByUrl = getNodesAndTimingByUrl(fcpSimulation.optimisticEstimate.nodeTiming);\n+ const nodesByUrl = getNodesAndTimingByUrl(fcpSimulation.optimisticEstimate.nodeTimings);\nconst results = [];\nconst deferredNodeIds = new Set();\n", "new_path": "lighthouse-core/audits/byte-efficiency/render-blocking-resources.js", "old_path": "lighthouse-core/audits/byte-efficiency/render-blocking-resources.js" }, { "change_type": "MODIFY", "diff": "@@ -71,13 +71,13 @@ class ConsistentlyInteractive extends MetricArtifact {\n* @return {LH.Gatherer.Simulation.Result}\n*/\ngetEstimateFromSimulation(simulationResult, extras) {\n- const lastTaskAt = ConsistentlyInteractive.getLastLongTaskEndTime(simulationResult.nodeTiming);\n+ const lastTaskAt = ConsistentlyInteractive.getLastLongTaskEndTime(simulationResult.nodeTimings);\nconst minimumTime = extras.optimistic\n? extras.fmpResult.optimisticEstimate.timeInMs\n: extras.fmpResult.pessimisticEstimate.timeInMs;\nreturn {\ntimeInMs: Math.max(minimumTime, lastTaskAt),\n- nodeTiming: simulationResult.nodeTiming,\n+ nodeTimings: simulationResult.nodeTimings,\n};\n}\n@@ -94,12 +94,12 @@ class ConsistentlyInteractive extends MetricArtifact {\n}\n/**\n- * @param {Map<Node, {startTime?: number, endTime?: number}>} nodeTiming\n+ * @param {Map<Node, LH.Gatherer.Simulation.NodeTiming>} nodeTimings\n* @return {number}\n*/\n- static getLastLongTaskEndTime(nodeTiming, duration = 50) {\n+ static getLastLongTaskEndTime(nodeTimings, duration = 50) {\n// @ts-ignore TS can't infer how the object invariants change\n- return Array.from(nodeTiming.entries())\n+ return Array.from(nodeTimings.entries())\n.filter(([node, timing]) => {\nif (node.type !== Node.TYPES.CPU) return false;\nif (!timing.endTime || !timing.startTime) return false;\n", "new_path": "lighthouse-core/gather/computed/metrics/lantern-consistently-interactive.js", "old_path": "lighthouse-core/gather/computed/metrics/lantern-consistently-interactive.js" }, { "change_type": "MODIFY", "diff": "@@ -28,20 +28,20 @@ class LanternFirstCPUIdle extends LanternConsistentlyInteractive {\n: extras.fmpResult.pessimisticEstimate.timeInMs;\nreturn {\n- timeInMs: LanternFirstCPUIdle.getFirstCPUIdleWindowStart(simulation.nodeTiming, fmpTimeInMs),\n- nodeTiming: simulation.nodeTiming,\n+ timeInMs: LanternFirstCPUIdle.getFirstCPUIdleWindowStart(simulation.nodeTimings, fmpTimeInMs),\n+ nodeTimings: simulation.nodeTimings,\n};\n}\n/**\n*\n- * @param {Map<Node, LH.Gatherer.Simulation.NodeTiming>} nodeTiming\n+ * @param {Map<Node, LH.Gatherer.Simulation.NodeTiming>} nodeTimings\n* @param {number} fmpTimeInMs\n*/\n- static getFirstCPUIdleWindowStart(nodeTiming, fmpTimeInMs, longTaskLength = 50) {\n+ static getFirstCPUIdleWindowStart(nodeTimings, fmpTimeInMs, longTaskLength = 50) {\n/** @type {Array<{start: number, end: number}>} */\nconst longTasks = [];\n- for (const [node, timing] of nodeTiming.entries()) {\n+ for (const [node, timing] of nodeTimings.entries()) {\nif (node.type !== Node.TYPES.CPU) continue;\nif (!timing.endTime || !timing.startTime) continue;\nif (timing.endTime - timing.startTime < longTaskLength) continue;\n", "new_path": "lighthouse-core/gather/computed/metrics/lantern-first-cpu-idle.js", "old_path": "lighthouse-core/gather/computed/metrics/lantern-first-cpu-idle.js" }, { "change_type": "MODIFY", "diff": "@@ -50,10 +50,10 @@ class SpeedIndex extends MetricArtifact {\nconst fcpTimeInMs = extras.fcpResult.timing;\nconst estimate = extras.optimistic\n? extras.speedline.speedIndex\n- : SpeedIndex.computeLayoutBasedSpeedIndex(simulationResult.nodeTiming, fcpTimeInMs);\n+ : SpeedIndex.computeLayoutBasedSpeedIndex(simulationResult.nodeTimings, fcpTimeInMs);\nreturn {\ntimeInMs: estimate,\n- nodeTiming: simulationResult.nodeTiming,\n+ nodeTimings: simulationResult.nodeTimings,\n};\n}\n@@ -84,14 +84,14 @@ class SpeedIndex extends MetricArtifact {\n* different methods. Read more in the evaluation doc.\n*\n* @see https://docs.google.com/document/d/1qJWXwxoyVLVadezIp_Tgdk867G3tDNkkVRvUJSH3K1E/edit#\n- * @param {Map<Node, LH.Gatherer.Simulation.NodeTiming>} nodeTiming\n+ * @param {Map<Node, LH.Gatherer.Simulation.NodeTiming>} nodeTimings\n* @param {number} fcpTimeInMs\n* @return {number}\n*/\n- static computeLayoutBasedSpeedIndex(nodeTiming, fcpTimeInMs) {\n+ static computeLayoutBasedSpeedIndex(nodeTimings, fcpTimeInMs) {\n/** @type {Array<{time: number, weight: number}>} */\nconst layoutWeights = [];\n- for (const [node, timing] of nodeTiming.entries()) {\n+ for (const [node, timing] of nodeTimings.entries()) {\nif (node.type !== Node.TYPES.CPU) continue;\nif (!timing.startTime || !timing.endTime) continue;\n", "new_path": "lighthouse-core/gather/computed/metrics/lantern-speed-index.js", "old_path": "lighthouse-core/gather/computed/metrics/lantern-speed-index.js" }, { "change_type": "MODIFY", "diff": "@@ -52,7 +52,7 @@ class Simulator {\nthis._layoutTaskMultiplier = this._cpuSlowdownMultiplier * this._options.layoutTaskMultiplier;\n// Properties reset on every `.simulate` call but duplicated here for type checking\n- this._nodeTiming = new Map();\n+ this._nodeTimings = new Map();\nthis._numberInProgressByType = new Map();\nthis._nodes = {};\n// @ts-ignore\n@@ -78,7 +78,7 @@ class Simulator {\n* Initializes the various state data structures such as _nodesReadyToStart and _nodesCompleted.\n*/\n_initializeAuxiliaryData() {\n- this._nodeTiming = new Map();\n+ this._nodeTimings = new Map();\nthis._numberInProgressByType = new Map();\nthis._nodes = {};\n@@ -100,9 +100,9 @@ class Simulator {\n* @param {LH.Gatherer.Simulation.NodeTiming} values\n*/\n_setTimingData(node, values) {\n- const timingData = this._nodeTiming.get(node) || {};\n+ const timingData = this._nodeTimings.get(node) || {};\nObject.assign(timingData, values);\n- this._nodeTiming.set(node, timingData);\n+ this._nodeTimings.set(node, timingData);\n}\n/**\n@@ -195,7 +195,7 @@ class Simulator {\n*/\n_estimateTimeRemaining(node) {\nif (node.type === Node.TYPES.CPU) {\n- const timingData = this._nodeTiming.get(node);\n+ const timingData = this._nodeTimings.get(node);\nconst multiplier = /** @type {CpuNode} */ (node).didPerformLayout()\n? this._layoutTaskMultiplier\n: this._cpuSlowdownMultiplier;\n@@ -211,7 +211,7 @@ class Simulator {\nif (node.type !== Node.TYPES.NETWORK) throw new Error('Unsupported');\nconst record = /** @type {NetworkNode} */ (node).record;\n- const timingData = this._nodeTiming.get(node);\n+ const timingData = this._nodeTimings.get(node);\nconst connection = /** @type {TcpConnection} */ (this._connectionPool.acquire(record));\nconst calculation = connection.simulateDownloadUntil(\nrecord.transferSize - timingData.bytesDownloaded,\n@@ -243,7 +243,7 @@ class Simulator {\n* @param {number} totalElapsedTime\n*/\n_updateProgressMadeInTimePeriod(node, timePeriodLength, totalElapsedTime) {\n- const timingData = this._nodeTiming.get(node);\n+ const timingData = this._nodeTimings.get(node);\nconst isFinished = timingData.estimatedTimeElapsed === timePeriodLength;\nif (node.type === Node.TYPES.CPU) {\n@@ -329,7 +329,7 @@ class Simulator {\nreturn {\ntimeInMs: totalElapsedTime,\n- nodeTiming: this._nodeTiming,\n+ nodeTimings: this._nodeTimings,\n};\n}\n}\n", "new_path": "lighthouse-core/lib/dependency-graph/simulator/simulator.js", "old_path": "lighthouse-core/lib/dependency-graph/simulator/simulator.js" }, { "change_type": "MODIFY", "diff": "@@ -37,8 +37,8 @@ describe('Metrics: TTCI', () => {\nassert.equal(Math.round(result.timing), 5308);\nassert.equal(Math.round(result.optimisticEstimate.timeInMs), 2451);\nassert.equal(Math.round(result.pessimisticEstimate.timeInMs), 2752);\n- assert.equal(result.optimisticEstimate.nodeTiming.size, 19);\n- assert.equal(result.pessimisticEstimate.nodeTiming.size, 79);\n+ assert.equal(result.optimisticEstimate.nodeTimings.size, 19);\n+ assert.equal(result.pessimisticEstimate.nodeTimings.size, 79);\nassert.ok(result.optimisticGraph, 'should have created optimistic graph');\nassert.ok(result.pessimisticGraph, 'should have created pessimistic graph');\n});\n", "new_path": "lighthouse-core/test/gather/computed/metrics/consistently-interactive-test.js", "old_path": "lighthouse-core/test/gather/computed/metrics/consistently-interactive-test.js" }, { "change_type": "MODIFY", "diff": "@@ -22,8 +22,8 @@ describe('Metrics: FCP', () => {\nassert.equal(Math.round(result.timing), 2038);\nassert.equal(Math.round(result.optimisticEstimate.timeInMs), 611);\nassert.equal(Math.round(result.pessimisticEstimate.timeInMs), 611);\n- assert.equal(result.optimisticEstimate.nodeTiming.size, 2);\n- assert.equal(result.pessimisticEstimate.nodeTiming.size, 2);\n+ assert.equal(result.optimisticEstimate.nodeTimings.size, 2);\n+ assert.equal(result.pessimisticEstimate.nodeTimings.size, 2);\nassert.ok(result.optimisticGraph, 'should have created optimistic graph');\nassert.ok(result.pessimisticGraph, 'should have created pessimistic graph');\n});\n", "new_path": "lighthouse-core/test/gather/computed/metrics/first-contentful-paint-test.js", "old_path": "lighthouse-core/test/gather/computed/metrics/first-contentful-paint-test.js" }, { "change_type": "MODIFY", "diff": "@@ -66,8 +66,8 @@ describe('FirstInteractive computed artifact:', () => {\nassert.equal(Math.round(result.timing), 5308);\nassert.equal(Math.round(result.optimisticEstimate.timeInMs), 2451);\nassert.equal(Math.round(result.pessimisticEstimate.timeInMs), 2752);\n- assert.equal(result.optimisticEstimate.nodeTiming.size, 19);\n- assert.equal(result.pessimisticEstimate.nodeTiming.size, 79);\n+ assert.equal(result.optimisticEstimate.nodeTimings.size, 19);\n+ assert.equal(result.pessimisticEstimate.nodeTimings.size, 79);\nassert.ok(result.optimisticGraph, 'should have created optimistic graph');\nassert.ok(result.pessimisticGraph, 'should have created pessimistic graph');\n});\n", "new_path": "lighthouse-core/test/gather/computed/metrics/first-cpu-idle-test.js", "old_path": "lighthouse-core/test/gather/computed/metrics/first-cpu-idle-test.js" }, { "change_type": "MODIFY", "diff": "@@ -42,8 +42,8 @@ describe('Metrics: FMP', () => {\nassert.equal(Math.round(result.timing), 2851);\nassert.equal(Math.round(result.optimisticEstimate.timeInMs), 911);\nassert.equal(Math.round(result.pessimisticEstimate.timeInMs), 1198);\n- assert.equal(result.optimisticEstimate.nodeTiming.size, 4);\n- assert.equal(result.pessimisticEstimate.nodeTiming.size, 7);\n+ assert.equal(result.optimisticEstimate.nodeTimings.size, 4);\n+ assert.equal(result.pessimisticEstimate.nodeTimings.size, 7);\nassert.ok(result.optimisticGraph, 'should have created optimistic graph');\nassert.ok(result.pessimisticGraph, 'should have created pessimistic graph');\n});\n", "new_path": "lighthouse-core/test/gather/computed/metrics/first-meaningful-paint-test.js", "old_path": "lighthouse-core/test/gather/computed/metrics/first-meaningful-paint-test.js" }, { "change_type": "MODIFY", "diff": "@@ -20,8 +20,8 @@ describe('Metrics: Lantern TTCI', () => {\nassert.equal(Math.round(result.timing), 5308);\nassert.equal(Math.round(result.optimisticEstimate.timeInMs), 2451);\nassert.equal(Math.round(result.pessimisticEstimate.timeInMs), 2752);\n- assert.equal(result.optimisticEstimate.nodeTiming.size, 19);\n- assert.equal(result.pessimisticEstimate.nodeTiming.size, 79);\n+ assert.equal(result.optimisticEstimate.nodeTimings.size, 19);\n+ assert.equal(result.pessimisticEstimate.nodeTimings.size, 79);\nassert.ok(result.optimisticGraph, 'should have created optimistic graph');\nassert.ok(result.pessimisticGraph, 'should have created pessimistic graph');\n});\n", "new_path": "lighthouse-core/test/gather/computed/metrics/lantern-consistently-interactive-test.js", "old_path": "lighthouse-core/test/gather/computed/metrics/lantern-consistently-interactive-test.js" }, { "change_type": "MODIFY", "diff": "@@ -20,8 +20,8 @@ describe('Metrics: Lantern FCP', () => {\nassert.equal(Math.round(result.timing), 2038);\nassert.equal(Math.round(result.optimisticEstimate.timeInMs), 611);\nassert.equal(Math.round(result.pessimisticEstimate.timeInMs), 611);\n- assert.equal(result.optimisticEstimate.nodeTiming.size, 2);\n- assert.equal(result.pessimisticEstimate.nodeTiming.size, 2);\n+ assert.equal(result.optimisticEstimate.nodeTimings.size, 2);\n+ assert.equal(result.pessimisticEstimate.nodeTimings.size, 2);\nassert.ok(result.optimisticGraph, 'should have created optimistic graph');\nassert.ok(result.pessimisticGraph, 'should have created pessimistic graph');\n});\n", "new_path": "lighthouse-core/test/gather/computed/metrics/lantern-first-contentful-paint-test.js", "old_path": "lighthouse-core/test/gather/computed/metrics/lantern-first-contentful-paint-test.js" }, { "change_type": "MODIFY", "diff": "@@ -20,8 +20,8 @@ describe('Metrics: Lantern TTFCPUI', () => {\nassert.equal(Math.round(result.timing), 5308);\nassert.equal(Math.round(result.optimisticEstimate.timeInMs), 2451);\nassert.equal(Math.round(result.pessimisticEstimate.timeInMs), 2752);\n- assert.equal(result.optimisticEstimate.nodeTiming.size, 19);\n- assert.equal(result.pessimisticEstimate.nodeTiming.size, 79);\n+ assert.equal(result.optimisticEstimate.nodeTimings.size, 19);\n+ assert.equal(result.pessimisticEstimate.nodeTimings.size, 79);\nassert.ok(result.optimisticGraph, 'should have created optimistic graph');\nassert.ok(result.pessimisticGraph, 'should have created pessimistic graph');\n});\n", "new_path": "lighthouse-core/test/gather/computed/metrics/lantern-first-cpu-idle-test.js", "old_path": "lighthouse-core/test/gather/computed/metrics/lantern-first-cpu-idle-test.js" }, { "change_type": "MODIFY", "diff": "@@ -20,8 +20,8 @@ describe('Metrics: Lantern FMP', () => {\nassert.equal(Math.round(result.timing), 2851);\nassert.equal(Math.round(result.optimisticEstimate.timeInMs), 911);\nassert.equal(Math.round(result.pessimisticEstimate.timeInMs), 1198);\n- assert.equal(result.optimisticEstimate.nodeTiming.size, 4);\n- assert.equal(result.pessimisticEstimate.nodeTiming.size, 7);\n+ assert.equal(result.optimisticEstimate.nodeTimings.size, 4);\n+ assert.equal(result.pessimisticEstimate.nodeTimings.size, 7);\nassert.ok(result.optimisticGraph, 'should have created optimistic graph');\nassert.ok(result.pessimisticGraph, 'should have created pessimistic graph');\n});\n", "new_path": "lighthouse-core/test/gather/computed/metrics/lantern-first-meaningful-paint-test.js", "old_path": "lighthouse-core/test/gather/computed/metrics/lantern-first-meaningful-paint-test.js" }, { "change_type": "MODIFY", "diff": "@@ -40,7 +40,7 @@ describe('DependencyGraph/Simulator', () => {\nconst serverResponseTimeByOrigin = new Map([['http://example.com', 500]]);\nfunction assertNodeTiming(result, node, assertions) {\n- const timing = result.nodeTiming.get(node);\n+ const timing = result.nodeTimings.get(node);\nassert.ok(timing, 'missing node timing information');\nObject.keys(assertions).forEach(key => {\nassert.equal(timing[key], assertions[key]);\n", "new_path": "lighthouse-core/test/lib/dependency-graph/simulator/simulator-test.js", "old_path": "lighthouse-core/test/lib/dependency-graph/simulator/simulator-test.js" }, { "change_type": "MODIFY", "diff": "@@ -61,7 +61,7 @@ declare global {\nexport interface Result {\ntimeInMs: number;\n- nodeTiming: Map<GraphNode, NodeTiming>;\n+ nodeTimings: Map<GraphNode, NodeTiming>;\n}\n}\n}\n", "new_path": "typings/gatherer.d.ts", "old_path": "typings/gatherer.d.ts" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
core(lantern): rename Simulation.Result.nodeTiming to be plural (#5038)
1
core
lantern
679,913
25.04.2018 14:37:06
-3,600
443ff8f6017b66f197774c09d7278f9a65dbdbb7
feat(rstream-query): add removeTriple(), simplify wildcard subqueries add freeID list to reduce store fragmentation remove obsolete allSelections cache fix addQueryJoin() xform to also return empty result sets
[ { "change_type": "MODIFY", "diff": "@@ -6,9 +6,7 @@ import { join } from \"@thi.ng/associative\";\nimport { Stream, Subscription, sync } from \"@thi.ng/rstream\";\nimport { toDot, walk, DotOpts, IToDot } from \"@thi.ng/rstream-dot\";\nimport { Transducer, Reducer } from \"@thi.ng/transducers/api\";\n-import { comp } from \"@thi.ng/transducers/func/comp\";\nimport { compR } from \"@thi.ng/transducers/func/compr\";\n-import { filter } from \"@thi.ng/transducers/xform/filter\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\nimport { DEBUG, Edit, Triple, TripleIds, Pattern, Solutions, Triples } from \"./api\";\n@@ -18,14 +16,14 @@ import { isQVar } from \"./qvar\";\nexport class TripleStore implements\nIToDot {\n- static NEXT_ID = 0;\n+ NEXT_ID: number;\n+ freeIDs: number[];\ntriples: Triple[];\nindexS: Map<any, TripleIds>;\nindexP: Map<any, TripleIds>;\nindexO: Map<any, TripleIds>;\nindexSelections: IObjectOf<Map<any, Subscription<Edit, TripleIds>>>;\n- allSelections: IObjectOf<Subscription<TripleIds, TripleIds>>;\nallIDs: TripleIds;\nstreamAll: Stream<TripleIds>;\n@@ -35,6 +33,7 @@ export class TripleStore implements\nconstructor(triples?: Iterable<Triple>) {\nthis.triples = [];\n+ this.freeIDs = [];\nthis.indexS = new Map();\nthis.indexP = new Map();\nthis.indexO = new Map();\n@@ -48,11 +47,7 @@ export class TripleStore implements\nthis.streamO = new Stream(\"O\");\nthis.streamAll = new Stream(\"ALL\");\nthis.allIDs = new Set<number>();\n- this.allSelections = {\n- \"s\": this.streamAll.subscribe(null, \"s\"),\n- \"p\": this.streamAll.subscribe(null, \"p\"),\n- \"o\": this.streamAll.subscribe(null, \"o\")\n- };\n+ this.NEXT_ID = 0;\nif (triples) {\nthis.addTriples(triples);\n}\n@@ -72,7 +67,7 @@ export class TripleStore implements\nlet p = this.indexP.get(t[1]);\nlet o = this.indexO.get(t[2]);\nif (this.findInIndices(s, p, o, t) !== -1) return false;\n- const id = TripleStore.NEXT_ID++;\n+ const id = this.nextID();\nconst is = s || new Set<number>();\nconst ip = p || new Set<number>();\nconst io = o || new Set<number>();\n@@ -99,6 +94,28 @@ export class TripleStore implements\nreturn ok;\n}\n+ removeTriple(t: Triple) {\n+ let s = this.indexS.get(t[0]);\n+ let p = this.indexP.get(t[1]);\n+ let o = this.indexO.get(t[2]);\n+ const id = this.findInIndices(s, p, o, t);\n+ if (id === -1) return false;\n+ s.delete(id);\n+ !s.size && this.indexS.delete(t[0]);\n+ p.delete(id);\n+ !p.size && this.indexP.delete(t[1]);\n+ o.delete(id);\n+ !o.size && this.indexO.delete(t[2]);\n+ this.allIDs.delete(id);\n+ delete this.triples[id];\n+ this.freeIDs.push(id);\n+ this.streamAll.next(this.allIDs);\n+ this.streamS.next({ index: s, key: t[0] });\n+ this.streamP.next({ index: p, key: t[1] });\n+ this.streamO.next({ index: o, key: t[2] });\n+ return true;\n+ }\n+\n/**\n* Creates a new query subscription from given SPO pattern. Any\n* `null` values in the pattern act as wildcard selectors and any\n@@ -124,11 +141,11 @@ export class TripleStore implements\nconst qo = this.getIndexSelection(this.streamO, o, \"o\");\nresults = sync<TripleIds, TripleIds>({\nid,\n- src: [qs, qp, qo],\n+ src: { s: qs, p: qp, o: qo },\nxform: map(({ s, p, o }) => intersection(intersection(s, p), o)),\nreset: true,\n});\n- const submit = (index: Map<any, Set<number>>, stream: Subscription<any, Set<number>>, key: any) => {\n+ const submit = (index: Map<any, TripleIds>, stream: Subscription<Edit, TripleIds>, key: any) => {\nif (key != null) {\nconst ids = index.get(key);\nids && stream.next({ index: ids, key });\n@@ -172,7 +189,7 @@ export class TripleStore implements\nif (!resolve) {\nillegalArgs(\"at least 1 query variable is required in pattern\");\n}\n- const query = <Subscription<any, Set<Triple>>>this.addPatternQuery(\n+ const query = <Subscription<TripleIds, Triples>>this.addPatternQuery(\nid + \"-raw\",\n[vs ? null : s, vp ? null : p, vo ? null : o],\n);\n@@ -190,8 +207,7 @@ export class TripleStore implements\n/**\n* Returns a rstream subscription computing the natural join of the\n- * given input query results. The subscription only produces results\n- * if there's at least 1 joined result.\n+ * given input query results.\n*\n* @param id\n* @param a\n@@ -201,7 +217,7 @@ export class TripleStore implements\nreturn sync<Solutions, Solutions>({\nid,\nsrc: { a, b },\n- xform: comp(map(({ a, b }) => join(a, b)), filter((x) => x.size > 0))\n+ xform: map(({ a, b }) => join(a, b))\n});\n}\n@@ -209,6 +225,13 @@ export class TripleStore implements\nreturn toDot(walk([this.streamS, this.streamP, this.streamO, this.streamAll]), opts);\n}\n+ protected nextID() {\n+ if (this.freeIDs.length) {\n+ return this.freeIDs.pop();\n+ }\n+ return this.NEXT_ID++;\n+ }\n+\nprotected findInIndices(s: TripleIds, p: TripleIds, o: TripleIds, f: Triple) {\nif (s && p && o) {\nconst triples = this.triples;\n@@ -225,15 +248,15 @@ export class TripleStore implements\n}\nprotected getIndexSelection(stream: Stream<Edit>, key: any, id: string): Subscription<any, TripleIds> {\n- if (key != null) {\n+ if (key == null) {\n+ return this.streamAll;\n+ }\nlet sel = this.indexSelections[id].get(key);\nif (!sel) {\nthis.indexSelections[id].set(key, sel = stream.transform(indexSel(key), id));\n}\nreturn sel;\n}\n- return this.allSelections[id];\n- }\n}\nexport const indexSel = (key: any): Transducer<Edit, TripleIds> =>\n", "new_path": "packages/rstream-query/src/store.ts", "old_path": "packages/rstream-query/src/store.ts" }, { "change_type": "MODIFY", "diff": "@@ -15,7 +15,6 @@ describe(\"rstream-query\", () => {\nlet store: TripleStore;\nbeforeEach(() => {\n- TripleStore.NEXT_ID = 0;\nstore = new TripleStore(triples);\n});\n", "new_path": "packages/rstream-query/test/index.ts", "old_path": "packages/rstream-query/test/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(rstream-query): add removeTriple(), simplify wildcard subqueries - add freeID list to reduce store fragmentation - remove obsolete allSelections cache - fix addQueryJoin() xform to also return empty result sets
1
feat
rstream-query
791,723
25.04.2018 14:45:01
25,200
8186537fba38da5f03d028bda2ddafc6f37d7cf3
report: only appendScoreScale to scoreHeader if it exists
[ { "change_type": "MODIFY", "diff": "@@ -171,8 +171,10 @@ class ReportRenderer {\ncategories.appendChild(renderer.render(category, report.reportGroups));\n}\n+ if (scoreHeader) {\nconst scoreScale = this._dom.cloneTemplate('#tmpl-lh-scorescale', this._templateContext);\nscoreHeader.appendChild(scoreScale);\n+ }\nreportSection.appendChild(this._renderReportFooter(report));\n", "new_path": "lighthouse-core/report/html/renderer/report-renderer.js", "old_path": "lighthouse-core/report/html/renderer/report-renderer.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
report: only appendScoreScale to scoreHeader if it exists (#5040)
1
report
null
679,913
25.04.2018 14:47:12
-3,600
9b5c58ac50c1a7363158f7addf7678fa922759d6
feat(rstream-query): rename TripleStore methods, use Set-like API rename addTriple() => add() rename addTriples() => into() rename removeTriple() => delete() add get() refactor has()
[ { "change_type": "MODIFY", "diff": "@@ -49,20 +49,33 @@ export class TripleStore implements\nthis.allIDs = new Set<number>();\nthis.NEXT_ID = 0;\nif (triples) {\n- this.addTriples(triples);\n+ this.into(triples);\n}\n}\n- has(f: Triple) {\n- return this.findInIndices(\n- this.indexS.get(f[0]),\n- this.indexP.get(f[1]),\n- this.indexO.get(f[2]),\n- f\n- ) !== -1;\n+ *[Symbol.iterator](): IterableIterator<Triple> {\n+ for (let t of this.triples) {\n+ if (t) {\n+ yield t;\n+ }\n+ }\n+ }\n+\n+ has(t: Triple) {\n+ return this.get(t) !== undefined;\n+ }\n+\n+ get(t: Triple, notFound?: any) {\n+ const id = this.findInIndices(\n+ this.indexS.get(t[0]),\n+ this.indexP.get(t[1]),\n+ this.indexO.get(t[2]),\n+ t\n+ );\n+ return id !== -1 ? this.triples[id] : notFound;\n}\n- addTriple(t: Triple) {\n+ add(t: Triple) {\nlet s = this.indexS.get(t[0]);\nlet p = this.indexP.get(t[1]);\nlet o = this.indexO.get(t[2]);\n@@ -86,15 +99,15 @@ export class TripleStore implements\nreturn true;\n}\n- addTriples(triples: Iterable<Triple>) {\n+ into(triples: Iterable<Triple>) {\nlet ok = true;\nfor (let f of triples) {\n- ok = this.addTriple(f) && ok;\n+ ok = this.add(f) && ok;\n}\nreturn ok;\n}\n- removeTriple(t: Triple) {\n+ delete(t: Triple) {\nlet s = this.indexS.get(t[0]);\nlet p = this.indexP.get(t[1]);\nlet o = this.indexO.get(t[2]);\n", "new_path": "packages/rstream-query/src/store.ts", "old_path": "packages/rstream-query/src/store.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(rstream-query): rename TripleStore methods, use Set-like API - rename addTriple() => add() - rename addTriples() => into() - rename removeTriple() => delete() - add get() - refactor has()
1
feat
rstream-query
807,849
25.04.2018 15:39:44
25,200
649048c09a690ade057f0a28a9fd98e1b4abe5c8
fix(publish): Add default description 'npm' for --npm-client
[ { "change_type": "MODIFY", "diff": "@@ -75,6 +75,7 @@ exports.builder = yargs => {\nrequiresArg: true,\n},\n\"npm-client\": {\n+ defaultDescription: \"npm\",\ndescribe: \"Executable used to publish dependencies (npm, yarn, pnpm, ...)\",\ntype: \"string\",\nrequiresArg: true,\n", "new_path": "commands/publish/command.js", "old_path": "commands/publish/command.js" } ]
JavaScript
MIT License
lerna/lerna
fix(publish): Add default description 'npm' for --npm-client
1
fix
publish
724,192
25.04.2018 15:43:29
-7,200
807d3c8110a61e6b505f3e747c956f2f3a29d55e
feat: add `provide` to the global config.
[ { "change_type": "MODIFY", "diff": "@@ -60,3 +60,22 @@ VueTestUtils.config.methods['errors'] = () => {\nany: () => false\n}\n```\n+\n+### `provide`\n+\n+- type: `Object`\n+- default: `{}`\n+\n+Like `stubs` or `mocks`, the values passed to `config.provide` are used by default. Any values passed to the mounting options `provide` object will take priority over the ones declared in `config.provide`. **Please take note that it is not supported to pass a function as `config.provide`.**\n+\n+Example:\n+\n+```js\n+import VueTestUtils from '@vue/test-utils'\n+\n+VueTestUtils.config.provide['$logger'] = {\n+ log: (...args) => {\n+ console.log(...args)\n+ }\n+}\n+```\n", "new_path": "docs/en/api/config.md", "old_path": "docs/en/api/config.md" }, { "change_type": "MODIFY", "diff": "function getOptions (key, options, config) {\nif (options ||\n(config[key] && Object.keys(config[key]).length > 0)) {\n- if (Array.isArray(options)) {\n+ if (options instanceof Function) {\n+ return options\n+ } else if (Array.isArray(options)) {\nreturn [\n...options,\n...Object.keys(config[key] || {})]\n- } else {\n+ } else if (!(config[key] instanceof Function)) {\nreturn {\n...config[key],\n...options\n}\n+ } else {\n+ throw new Error(`Config can't be a Function.`)\n}\n}\n}\n@@ -24,7 +28,8 @@ export function mergeOptions (\n...options,\nstubs: getOptions('stubs', options.stubs, config),\nmocks: getOptions('mocks', options.mocks, config),\n- methods: getOptions('methods', options.methods, config)\n+ methods: getOptions('methods', options.methods, config),\n+ provide: getOptions('provide', options.provide, config)\n}\n}\n", "new_path": "packages/shared/merge-options.js", "old_path": "packages/shared/merge-options.js" }, { "change_type": "MODIFY", "diff": "@@ -7,5 +7,6 @@ export default {\n'transition-group': TransitionGroupStub\n},\nmocks: {},\n- methods: {}\n+ methods: {},\n+ provide: {}\n}\n", "new_path": "packages/test-utils/src/config.js", "old_path": "packages/test-utils/src/config.js" }, { "change_type": "MODIFY", "diff": "+import { config } from '~vue/test-utils'\nimport ComponentWithInject from '~resources/components/component-with-inject.vue'\nimport { injectSupported } from '~resources/utils'\nimport {\n@@ -6,6 +7,17 @@ import {\n} from '~resources/utils'\ndescribeWithMountingMethods('options.provide', (mountingMethod) => {\n+ let configProvideSave\n+\n+ beforeEach(() => {\n+ configProvideSave = config.provide\n+ config.provide = {}\n+ })\n+\n+ afterEach(() => {\n+ config.provide = configProvideSave\n+ })\n+\nitDoNotRunIf(!injectSupported(),\n'provides objects which is injected by mounted component', () => {\nif (!injectSupported()) return\n@@ -44,4 +56,38 @@ describeWithMountingMethods('options.provide', (mountingMethod) => {\nexpect(wrapper.vm.setInBeforeCreate).to.equal('created')\n})\n+\n+ itDoNotRunIf(!injectSupported(), 'injects the provide from the config', () => {\n+ config.provide['fromMount'] = 'globalConfig'\n+\n+ const wrapper = mountingMethod(ComponentWithInject)\n+ const HTML = mountingMethod.name === 'renderToString'\n+ ? wrapper\n+ : wrapper.html()\n+\n+ expect(HTML).to.contain('globalConfig')\n+ })\n+\n+ itDoNotRunIf(!injectSupported(), 'prioritize mounting options over config', () => {\n+ config.provide['fromMount'] = 'globalConfig'\n+\n+ const wrapper = mountingMethod(ComponentWithInject, {\n+ provide: { fromMount: '_' }\n+ })\n+ const HTML = mountingMethod.name === 'renderToString'\n+ ? wrapper\n+ : wrapper.html()\n+\n+ expect(HTML).to.contain('_')\n+ })\n+\n+ itDoNotRunIf(!injectSupported(), 'config with function throws', () => {\n+ config.provide = () => {}\n+\n+ expect(() => {\n+ mountingMethod(ComponentWithInject, {\n+ provide: { fromMount: '_' }\n+ })\n+ }).to.throw()\n+ })\n})\n", "new_path": "test/specs/mounting-options/provide.spec.js", "old_path": "test/specs/mounting-options/provide.spec.js" } ]
JavaScript
MIT License
vuejs/vue-test-utils
feat: add `provide` to the global config. (#555)
1
feat
null
730,414
25.04.2018 16:38:28
14,400
a16c74f6d542cd3ea11eeda95ae394fb49352b5f
refactor(widget-space): condense function calls into equivalent call
[ { "change_type": "MODIFY", "diff": "@@ -21,8 +21,7 @@ export const getToUser = createSelector(\n(conversation, currentUser) => {\nreturn conversation\n.get('participants')\n- .filter((participant) => participant.get('id') !== currentUser.id)\n- .first();\n+ .find((participant) => participant.get('id') !== currentUser.id);\n}\n);\n", "new_path": "packages/node_modules/@ciscospark/widget-space/src/selector.js", "old_path": "packages/node_modules/@ciscospark/widget-space/src/selector.js" } ]
JavaScript
MIT License
webex/react-widgets
refactor(widget-space): condense function calls into equivalent call
1
refactor
widget-space
730,414
25.04.2018 16:51:34
14,400
eb9482f3deff8a4869687f7c9a3d2a0828632d0f
refactor(widget-space): remove eslint exception
[ { "change_type": "MODIFY", "diff": "@@ -10,19 +10,20 @@ const getFeatures = (state) => state.features;\nconst getOwnProps = (state, ownProps) => ownProps;\n/**\n- * Get the other user in a 1:1 conversation.\n+ * Find the other user in a 1:1 conversation.\n* @param {conversation} conversation\n* @param {participant} currentUser\n* @returns {participant}\n*/\n-export const getToUser = createSelector(\n- [getConversation, getCurrentUser],\n- /* eslint arrow-body-style: [0] */\n- (conversation, currentUser) => {\n+function findToUser(conversation, currentUser) {\nreturn conversation\n.get('participants')\n.find((participant) => participant.get('id') !== currentUser.id);\n}\n+\n+export const getToUser = createSelector(\n+ [getConversation, getCurrentUser],\n+ findToUser\n);\nexport const getSpaceDetails = createSelector(\n", "new_path": "packages/node_modules/@ciscospark/widget-space/src/selector.js", "old_path": "packages/node_modules/@ciscospark/widget-space/src/selector.js" } ]
JavaScript
MIT License
webex/react-widgets
refactor(widget-space): remove eslint exception
1
refactor
widget-space
807,849
25.04.2018 17:11:07
25,200
c762aa19f40f985a1592d89eb573d2e0b7d84b24
lint: Re-enable class-methods-use-this with getter whitelist
[ { "change_type": "MODIFY", "diff": "- node\n- prettier\nrules:\n- class-methods-use-this: off\n+ class-methods-use-this:\n+ - error\n+ - exceptMethods:\n+ - defaultOptions\n+ - otherCommandConfigs\n+ - requiresGit\nconsistent-return: off\ncurly:\n- error\n", "new_path": ".eslintrc.yaml", "old_path": ".eslintrc.yaml" }, { "change_type": "MODIFY", "diff": "@@ -26,9 +26,13 @@ class InitCommand extends Command {\nreturn false;\n}\n- // don't do any of this.\n- runValidations() {}\n- runPreparations() {}\n+ runValidations() {\n+ this.logger.verbose(this.name, \"skipping validations\");\n+ }\n+\n+ runPreparations() {\n+ this.logger.verbose(this.name, \"skipping preparations\");\n+ }\ninitialize() {\nthis.exact = this.options.exact;\n", "new_path": "commands/init/index.js", "old_path": "commands/init/index.js" }, { "change_type": "MODIFY", "diff": "@@ -359,6 +359,8 @@ class PublishCommand extends Command {\nreturn chain;\n}\n+ // TODO: extract out of class\n+ // eslint-disable-next-line class-methods-use-this\npromptVersion({ version: currentVersion, name: pkgName }) {\nconst patch = semver.inc(currentVersion, \"patch\");\nconst minor = semver.inc(currentVersion, \"minor\");\n", "new_path": "commands/publish/index.js", "old_path": "commands/publish/index.js" }, { "change_type": "MODIFY", "diff": "+/* eslint-disable class-methods-use-this */\n+\n\"use strict\";\nconst fs = require(\"fs-extra\");\n", "new_path": "core/command/__tests__/command.test.js", "old_path": "core/command/__tests__/command.test.js" }, { "change_type": "MODIFY", "diff": "@@ -250,11 +250,11 @@ class Command {\n}\ninitialize() {\n- throw new Error(\"command.initialize() needs to be implemented.\");\n+ throw new ValidationError(this.name, \"initialize() needs to be implemented.\");\n}\nexecute() {\n- throw new Error(\"command.execute() needs to be implemented.\");\n+ throw new ValidationError(this.name, \"execute() needs to be implemented.\");\n}\n}\n", "new_path": "core/command/index.js", "old_path": "core/command/index.js" } ]
JavaScript
MIT License
lerna/lerna
lint: Re-enable class-methods-use-this with getter whitelist
1
lint
null
730,412
25.04.2018 18:01:07
0
e67f034271d1ebfdccb1a5a2b26e20c328797f1c
chore(release): 0.1.279
[ { "change_type": "MODIFY", "diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.1.279\"></a>\n+## [0.1.279](https://github.com/webex/react-ciscospark/compare/v0.1.278...v0.1.279) (2018-04-25)\n+\n+\n+\n<a name=\"0.1.278\"></a>\n## [0.1.278](https://github.com/webex/react-ciscospark/compare/v0.1.277...v0.1.278) (2018-04-23)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@ciscospark/react-ciscospark\",\n- \"version\": \"0.1.278\",\n+ \"version\": \"0.1.279\",\n\"description\": \"The Cisco Spark for React library allows developers to easily incorporate Spark functionality into an application.\",\n\"scripts\": {\n\"build\": \"./scripts/build/index.js\",\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
MIT License
webex/react-widgets
chore(release): 0.1.279
1
chore
release
791,834
25.04.2018 19:08:08
25,200
4b8b51da41769f85383c1e6a6c534dc2ec5bec5d
tests(viewer): add pptr test for viewer
[ { "change_type": "MODIFY", "diff": "@@ -39,6 +39,7 @@ script:\n- yarn diff:sample-json\n- yarn smoke:silentcoverage\n- yarn test-extension\n+ - yarn test-viewer\n# _JAVA_OPTIONS is breaking parsing of compiler output. See #3338.\n- unset _JAVA_OPTIONS\n# FIXME(paulirish): re-enable after a roll of LH->CDT\n", "new_path": ".travis.yml", "old_path": ".travis.yml" }, { "change_type": "MODIFY", "diff": "@@ -24,17 +24,23 @@ function requestHandler(request, response) {\nconst queryString = requestUrl.search && parseQueryString(requestUrl.search.slice(1));\nlet absoluteFilePath = path.join(__dirname, filePath);\n+ if (filePath.startsWith('/lighthouse-viewer')) {\n+ // Rewrite lighthouse-viewer paths to point to that location.\n+ absoluteFilePath = path.join(__dirname, '/../../../', filePath);\n+ }\n+\nif (filePath === '/zone.js') {\n// evaluateAsync previously had a bug that LH would fail if a page polyfilled Promise.\n// We bring in an aggressive Promise polyfill (zone) to ensure we don't still fail.\nconst zonePath = '../../../node_modules/zone.js';\nabsoluteFilePath = path.join(__dirname, `${zonePath}/dist/zone.js`);\n- }\n-\n- // Disallow file requests outside of LH folder\n- if (!path.parse(absoluteFilePath).dir.startsWith(lhRootDirPath)) {\n+ } else {\n+ // Otherwise, disallow file requests outside of LH folder or from node_modules\n+ const filePathDir = path.parse(absoluteFilePath).dir;\n+ if (!filePathDir.startsWith(lhRootDirPath) || filePathDir.includes('node_modules')) {\nreturn readFileCallback(new Error('Disallowed path'));\n}\n+ }\nfs.exists(absoluteFilePath, fsExistsCallback);\n", "new_path": "lighthouse-cli/test/fixtures/static-server.js", "old_path": "lighthouse-cli/test/fixtures/static-server.js" }, { "change_type": "MODIFY", "diff": "},\n\"scripts\": {\n\"watch\": \"gulp watch\",\n- \"build\": \"gulp\"\n+ \"build\": \"gulp\",\n+ \"pptr-test\": \"mocha test/viewer-test-pptr.js\"\n},\n\"devDependencies\": {\n\"brfs\": \"^1.4.3\",\n", "new_path": "lighthouse-viewer/package.json", "old_path": "lighthouse-viewer/package.json" }, { "change_type": "MODIFY", "diff": "\"start\": \"node ./lighthouse-cli/index.js\",\n\"test\": \"yarn lint --quiet && yarn unit && yarn type-check && yarn closure && yarn diff:sample-json\",\n\"test-extension\": \"cd lighthouse-extension && yarn test\",\n+ \"test-viewer\": \"cd lighthouse-viewer && yarn pptr-test\",\n\"unit-core\": \"mocha --reporter dot \\\"lighthouse-core/test/**/*-test.js\\\"\",\n\"unit-cli\": \"mocha --reporter dot \\\"lighthouse-cli/test/**/*-test.js\\\"\",\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
tests(viewer): add pptr test for viewer (#5025)
1
tests
viewer
217,922
25.04.2018 19:37:51
-7,200
1cf1f7885b3ccbda13aa0625aa8e35c6035afdaf
fix: wiki page fallback to english wasn't working properly
[ { "change_type": "MODIFY", "diff": "@@ -78,14 +78,15 @@ export class WikiComponent implements OnInit {\n})\n.mergeMap(markdownUrl => {\nreturn this.http.get(markdownUrl, {responseType: 'text'})\n- .catch(() => {\n+ .mergeMap(res => {\n+ if (res.indexOf('<!doctype html>') > -1) {\n// If page isn't found, return the english one\n- const englishUrl = markdownUrl.replace(`/${this.translator.currentLang}/`, '/en/');\n- this.notFoundInCurrentLang = true;\n- return this.http.get(englishUrl, {responseType: 'text'}).catch(() => {\n- this.notFound = true;\n- return Observable.of(null);\n- });\n+ // This has to be done because of firebase not handling redirection properly for not found pages.\n+ return this.getEnglishFallback(markdownUrl);\n+ }\n+ })\n+ .catch(() => {\n+ return this.getEnglishFallback(markdownUrl);\n});\n})\n.filter(markdown => markdown !== null)\n@@ -135,6 +136,16 @@ export class WikiComponent implements OnInit {\n});\n}\n+ getEnglishFallback(markdownUrl: string): Observable<string> {\n+ // If page isn't found, return the english one\n+ const englishUrl = markdownUrl.replace(`/${this.translator.currentLang}/`, '/en/');\n+ this.notFoundInCurrentLang = true;\n+ return this.http.get(englishUrl, {responseType: 'text'}).catch(() => {\n+ this.notFound = true;\n+ return Observable.of(null);\n+ });\n+ }\n+\nisMobile(): boolean {\nreturn this.media.isActive('xs') || this.media.isActive('sm');\n}\n", "new_path": "src/app/pages/wiki/wiki/wiki.component.ts", "old_path": "src/app/pages/wiki/wiki/wiki.component.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
fix: wiki page fallback to english wasn't working properly
1
fix
null
730,412
25.04.2018 21:35:25
0
16e6dd26b0abe9fcc6e1c6183ea8700bdec30fad
chore(release): 0.1.280
[ { "change_type": "MODIFY", "diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.1.280\"></a>\n+## [0.1.280](https://github.com/webex/react-ciscospark/compare/v0.1.279...v0.1.280) (2018-04-25)\n+\n+\n+\n<a name=\"0.1.279\"></a>\n## [0.1.279](https://github.com/webex/react-ciscospark/compare/v0.1.278...v0.1.279) (2018-04-25)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@ciscospark/react-ciscospark\",\n- \"version\": \"0.1.279\",\n+ \"version\": \"0.1.280\",\n\"description\": \"The Cisco Spark for React library allows developers to easily incorporate Spark functionality into an application.\",\n\"scripts\": {\n\"build\": \"./scripts/build/index.js\",\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
MIT License
webex/react-widgets
chore(release): 0.1.280
1
chore
release
217,922
26.04.2018 00:15:47
-7,200
6d945533fb9570dcd1ad56f0130546b3f7ba91ea
chore(simulator): first tests and progression implementation
[ { "change_type": "MODIFY", "diff": "@@ -6,6 +6,7 @@ import {AngularFireDatabase} from 'angularfire2/database';\nimport {DiffService} from '../diff/diff.service';\nimport {Observable} from 'rxjs/Observable';\nimport {PendingChangesService} from '../pending-changes/pending-changes.service';\n+import 'rxjs/add/operator/first';\n@Injectable()\nexport class CustomLinksService<T extends CustomLink = CustomLink> extends FirebaseStorage<T> {\n", "new_path": "src/app/core/database/custom-links/custom-links.service.ts", "old_path": "src/app/core/database/custom-links/custom-links.service.ts" }, { "change_type": "MODIFY", "diff": "@@ -4,6 +4,7 @@ import {NgSerializerService} from '@kaiu/ng-serializer';\nimport {Observable} from 'rxjs/Observable';\nimport {ListStore} from './storage/list/list-store';\nimport {Workshop} from '../../model/other/workshop';\n+import 'rxjs/add/operator/catch';\n@Injectable()\nexport class ListService {\n", "new_path": "src/app/core/database/list.service.ts", "old_path": "src/app/core/database/list.service.ts" }, { "change_type": "MODIFY", "diff": "@@ -6,6 +6,7 @@ import {NgSerializerService} from '@kaiu/ng-serializer';\nimport {DiffService} from 'app/core/database/diff/diff.service';\nimport {NgZone} from '@angular/core';\nimport 'rxjs/add/operator/takeWhile';\n+import 'rxjs/add/operator/do';\nimport {PendingChangesService} from '../../pending-changes/pending-changes.service';\nexport abstract class FirebaseStorage<T extends DataModel> extends DataStore<T> {\n", "new_path": "src/app/core/database/storage/firebase/firebase-storage.ts", "old_path": "src/app/core/database/storage/firebase/firebase-storage.ts" }, { "change_type": "MODIFY", "diff": "@@ -12,6 +12,7 @@ import {ReplaySubject} from 'rxjs/ReplaySubject';\nimport {DataResponse} from '../data-response';\nimport 'rxjs/add/operator/mergeMap';\nimport 'rxjs/add/observable/throw';\n+import 'rxjs/add/operator/do';\nimport DocumentReference = firebase.firestore.DocumentReference;\nimport DocumentSnapshot = firebase.firestore.DocumentSnapshot;\nimport {PendingChangesService} from '../../pending-changes/pending-changes.service';\n", "new_path": "src/app/core/database/storage/firebase/firestore-storage.ts", "old_path": "src/app/core/database/storage/firebase/firestore-storage.ts" }, { "change_type": "MODIFY", "diff": "@@ -10,6 +10,10 @@ import {FirebaseStorage} from './storage/firebase/firebase-storage';\nimport {AngularFireDatabase} from 'angularfire2/database';\nimport {DiffService} from './diff/diff.service';\nimport {PendingChangesService} from './pending-changes/pending-changes.service';\n+import 'rxjs/add/operator/catch';\n+import 'rxjs/add/operator/first';\n+import 'rxjs/add/operator/do';\n+import 'rxjs/add/observable/concat';\n@Injectable()\nexport class UserService extends FirebaseStorage<AppUser> {\n", "new_path": "src/app/core/database/user.service.ts", "old_path": "src/app/core/database/user.service.ts" }, { "change_type": "MODIFY", "diff": "@@ -79,12 +79,4 @@ describe('LayoutService', () => {\nexpect(filterChain.filter(mockRows).accepted.length).toEqual(opposedFilterChain.filter(mockRows).rejected.length);\n});\n-\n- it('should be able to provide proper display with default layoutRows', inject([LayoutService], (service: LayoutService) => {\n- const display: LayoutRowDisplay[] = service.getDisplay(mockList);\n- expect(display.length).toBe(3);\n- expect(display[0].title).toBe('Gathering');\n- expect(display[1].title).toBe('Other');\n- expect(display[2].title).toBe('Pre_crafts');\n- }));\n});\n", "new_path": "src/app/core/layout/layout.service.spec.ts", "old_path": "src/app/core/layout/layout.service.spec.ts" }, { "change_type": "MODIFY", "diff": "@@ -9,10 +9,12 @@ export interface Craft {\nquality: number;\nprogress: number;\nlvl: number;\n- stars: number;\n- controlReq: number;\n- craftsmanshipReq: number;\n- unlockId: number;\n+ stars?: number;\n+ hq: 1 | 0;\n+ quickSynth: 1 | 0;\n+ controlReq?: number;\n+ craftsmanshipReq?: number;\n+ unlockId?: number;\ningredients: Ingredient[];\ncomplexity: Complexity;\nfc?: number;\n", "new_path": "src/app/model/garland-tools/craft.ts", "old_path": "src/app/model/garland-tools/craft.ts" }, { "change_type": "MODIFY", "diff": "export interface Ingredient {\nid: number;\namount: number;\n- quality: number;\n+ quality?: number;\nstepid?: string;\npart?: string;\nphase?: number\n", "new_path": "src/app/model/garland-tools/ingredient.ts", "old_path": "src/app/model/garland-tools/ingredient.ts" }, { "change_type": "MODIFY", "diff": "import {CraftingAction} from './crafting-action';\nimport {Simulation} from '../../simulation/simulation';\nimport {EffectiveBuff} from '../effective-buff';\n+import {Buff} from '../buff.enum';\nexport abstract class BuffAction extends CraftingAction {\n- protected abstract getAppliedBuff(simulationState: Simulation): EffectiveBuff;\n+ private getAppliedBuff(): EffectiveBuff {\n+ return {\n+ duration: this.getDuration(),\n+ tick: this.getTick(),\n+ stacks: this.getInitialStacks(),\n+ buff: this.getBuff()\n+ }\n+ }\n+\n+ protected abstract getDuration(): number;\n+\n+ protected abstract getBuff(): Buff;\n+\n+ protected abstract getInitialStacks(): number;\n+\n+ protected abstract getTick(): (simulation: Simulation) => void;\nexecute(simulation: Simulation): void {\n- simulation.buffs.push(this.getAppliedBuff(simulation));\n+ simulation.buffs.push(this.getAppliedBuff());\n}\ncanBeUsed(simulationState: Simulation): boolean {\n// You can't use a buff twice\n- return !simulationState.hasBuff(this.getAppliedBuff(simulationState).buff);\n+ return !simulationState.hasBuff(this.getBuff());\n}\ngetDurabilityCost(simulationState: Simulation): number {\n", "new_path": "src/app/pages/simulator/model/actions/buff-action.ts", "old_path": "src/app/pages/simulator/model/actions/buff-action.ts" }, { "change_type": "ADD", "diff": "+import {BuffAction} from '../buff-action';\n+import {Simulation} from '../../../simulation/simulation';\n+import {Buff} from '../../buff.enum';\n+\n+export class SteadyHandII extends BuffAction {\n+\n+ protected getBuff(): Buff {\n+ return Buff.STEADY_HAND_II;\n+ }\n+\n+ getCPCost(simulationState: Simulation): number {\n+ return 25;\n+ }\n+\n+ protected getDuration(): number {\n+ return 5;\n+ }\n+\n+ getIds(): number[] {\n+ return [281];\n+ }\n+\n+ protected getInitialStacks(): number {\n+ return 5;\n+ }\n+\n+ // Steady hand has no tick.\n+ protected getTick(): (simulation: Simulation) => void {\n+ return undefined;\n+ }\n+\n+\n+}\n", "new_path": "src/app/pages/simulator/model/actions/buff/steady-hand-ii.ts", "old_path": null }, { "change_type": "ADD", "diff": "+import {BuffAction} from '../buff-action';\n+import {Simulation} from '../../../simulation/simulation';\n+import {Buff} from '../../buff.enum';\n+\n+export class SteadyHand extends BuffAction {\n+\n+ protected getBuff(): Buff {\n+ return Buff.STEADY_HAND;\n+ }\n+\n+ getCPCost(simulationState: Simulation): number {\n+ return 22;\n+ }\n+\n+ protected getDuration(): number {\n+ return 5;\n+ }\n+\n+ getIds(): number[] {\n+ return [244, 245, 246, 247, 248, 249, 250, 251];\n+ }\n+\n+ protected getInitialStacks(): number {\n+ return 5;\n+ }\n+\n+ // Steady hand has no tick.\n+ protected getTick(): (simulation: Simulation) => void {\n+ return undefined;\n+ }\n+\n+\n+}\n", "new_path": "src/app/pages/simulator/model/actions/buff/steady-hand.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "import {Simulation} from '../../simulation/simulation';\nimport {GeneralAction} from './general-action';\n+import {CrafterStats} from '../crafter-stats';\n+import {Buff} from '../buff.enum';\nexport abstract class ProgressAction extends GeneralAction {\n+ // source: https://github.com/Ermad/ffxiv-craft-opt-web/blob/master/app/js/ffxivcraftmodel.js#L1823\n+ private static readonly LEVEL_TABLE = {\n+ 51: 120, // 120\n+ 52: 125, // 125\n+ 53: 130, // 130\n+ 54: 133, // 133\n+ 55: 136, // 136\n+ 56: 139, // 139\n+ 57: 142, // 142\n+ 58: 145, // 145\n+ 59: 148, // 148\n+ 60: 150, // 150\n+ 61: 260,\n+ 62: 265,\n+ 63: 270,\n+ 64: 273,\n+ 65: 276,\n+ 66: 279,\n+ 67: 282,\n+ 68: 285,\n+ 69: 288,\n+ 70: 290\n+ };\n+\n+ // source: https://github.com/Ermad/ffxiv-craft-opt-web/blob/master/app/js/ffxivcraftmodel.js#L1956\n+ private static readonly PROGRESS_PENALTY_TABLE = {\n+ 180: -0.02,\n+ 210: -0.035,\n+ 220: -0.035,\n+ 250: -0.04,\n+ 320: -0.02,\n+ 350: -0.035,\n+ };\n+\n+ // source: https://github.com/Ermad/ffxiv-craft-opt-web/blob/master/app/js/ffxivcraftmodel.js#L1846\n+ private static readonly INGENUITY_RLVL_TABLE = {\n+ 40: 36,\n+ 41: 36,\n+ 42: 37,\n+ 43: 38,\n+ 44: 39,\n+ 45: 40,\n+ 46: 41,\n+ 47: 42,\n+ 48: 43,\n+ 49: 44,\n+ 50: 45,\n+ 55: 50, // 50_1star *** unverified\n+ 70: 51, // 50_2star *** unverified\n+ 90: 58, // 50_3star *** unverified\n+ 110: 59, // 50_4star *** unverified\n+ 115: 100, // 51 @ 169/339 difficulty\n+ 120: 101, // 51 @ 210/410 difficulty\n+ 125: 102, // 52\n+ 130: 110, // 53\n+ 133: 111, // 54\n+ 136: 112, // 55\n+ 139: 126, // 56\n+ 142: 131, // 57\n+ 145: 134, // 58\n+ 148: 137, // 59\n+ 150: 140, // 60\n+ 160: 151, // 60_1star\n+ 180: 152, // 60_2star\n+ 210: 153, // 60_3star\n+ 220: 153, // 60_3star\n+ 250: 154, // 60_4star\n+ 255: 238, // 61 @ 558/1116 difficulty\n+ 260: 240, // 61 @ 700/1400 difficulty\n+ 265: 242, // 62\n+ 270: 250, // 63\n+ 273: 251, // 64\n+ 276: 252, // 65\n+ 279: 266, // 66\n+ 282: 271, // 67\n+ 285: 274, // 68\n+ 288: 277, // 69\n+ 290: 280, // 70\n+ 300: 291, // 70_1star\n+ 320: 292, // 70_2star\n+ 350: 293, // 70_3star\n+ };\n+\n+ // source: https://github.com/Ermad/ffxiv-craft-opt-web/blob/master/app/js/ffxivcraftmodel.js#L1894\n+ private static readonly INGENUITY_II_RLVL_TABLE = {\n+ 40: 33,\n+ 41: 34,\n+ 42: 35,\n+ 43: 36,\n+ 44: 37,\n+ 45: 38,\n+ 46: 39,\n+ 47: 40,\n+ 48: 40,\n+ 49: 41,\n+ 50: 42,\n+ 55: 47, // 50_1star *** unverified\n+ 70: 48, // 50_2star *** unverified\n+ 90: 56, // 50_3star *** unverified\n+ 110: 57, // 50_4star *** unverified\n+ 115: 97, // 51 @ 169/339 difficulty\n+ 120: 99, // 51 @ 210/410 difficulty\n+ 125: 101, // 52\n+ 130: 109, // 53\n+ 133: 110, // 54\n+ 136: 111, // 55\n+ 139: 125, // 56\n+ 142: 130, // 57\n+ 145: 133, // 58\n+ 148: 136, // 59\n+ 150: 139, // 60\n+ 160: 150, // 60_1star\n+ 180: 151, // 60_2star\n+ 210: 152, // 60_3star\n+ 220: 152, // 60_3star\n+ 250: 153, // 60_4star\n+ 255: 237, // 61 @ 558/1116 difficulty\n+ 260: 239, // 61 @ 700/1400 difficulty\n+ 265: 241, // 62\n+ 270: 249, // 63\n+ 273: 250, // 64\n+ 276: 251, // 65\n+ 279: 265, // 66\n+ 282: 270, // 67\n+ 285: 273, // 68\n+ 288: 276, // 69\n+ 290: 279, // 70\n+ 300: 290, // 70_1star\n+ 320: 291, // 70_2star\n+ 350: 292, // 70_3star\n+ };\n+\n+ /**\n+ * Gets base progression, implementation is from ermad's fork\n+ * (https://github.com/Ermad/ffxiv-craft-opt-web/blob/master/app/js/ffxivcraftmodel.js)\n+ * @param {Simulation} simulation\n+ * @returns {number}\n+ */\n+ private getBaseProgression(simulation: Simulation): number {\n+ let recipeLevel = simulation.recipe.rlvl;\n+ const stats: CrafterStats = simulation.crafterStats;\n+ const crafterLevel = ProgressAction.LEVEL_TABLE[stats.level] || stats.level;\n+ // If ingenuity\n+ if (simulation.hasBuff(Buff.INGENUITY)) {\n+ recipeLevel = ProgressAction.INGENUITY_RLVL_TABLE[simulation.recipe.rlvl] || simulation.recipe.rlvl - 5;\n+ } else if (simulation.hasBuff(Buff.INGENUITY_II)) {\n+ recipeLevel = ProgressAction.INGENUITY_II_RLVL_TABLE[simulation.recipe.rlvl] || simulation.recipe.rlvl - 5;\n+ }\n+ const levelDifference = Math.max(crafterLevel - recipeLevel, -6);\n+ let baseProgress = 0;\n+ let levelCorrectionFactor = 0;\n+ let recipeLevelPenalty = 0;\n+\n+ if (crafterLevel > 60) {\n+ baseProgress = 1.834712812e-5 * stats.craftsmanship * stats.craftsmanship + 1.904074773e-1 * stats.craftsmanship + 1.544103837;\n+ } else if (crafterLevel > 50) {\n+ baseProgress = 2.09860e-5 * stats.craftsmanship * stats.craftsmanship + 0.196184 * stats.craftsmanship + 2.68452;\n+ } else {\n+ baseProgress = 0.214959 * stats.craftsmanship + 1.6;\n+ }\n+\n+ // Level boost for recipes below crafter level\n+ if (levelDifference > 0) {\n+ levelCorrectionFactor += (0.25 / 5) * Math.min(levelDifference, 5);\n+ }\n+ if (levelDifference > 5) {\n+ levelCorrectionFactor += (0.10 / 5) * Math.min(levelDifference - 5, 10);\n+ }\n+ if (levelDifference > 15) {\n+ levelCorrectionFactor += (0.05 / 5) * Math.min(levelDifference - 15, 5);\n+ }\n+ if (levelDifference > 20) {\n+ levelCorrectionFactor += 0.0006 * (levelDifference - 20);\n+ }\n+\n+ // Level penalty for recipes above crafter level\n+ if (levelDifference < 0) {\n+ levelCorrectionFactor += 0.025 * Math.max(levelDifference, -10);\n+ if (ProgressAction.PROGRESS_PENALTY_TABLE[recipeLevel] !== undefined) {\n+ recipeLevelPenalty += ProgressAction.PROGRESS_PENALTY_TABLE[recipeLevel];\n+ }\n+ }\n+\n+ // Level factor is rounded to nearest percent\n+ levelCorrectionFactor = Math.floor(levelCorrectionFactor * 100) / 100;\n+\n+ return baseProgress * (1 + levelCorrectionFactor) * (1 + recipeLevelPenalty);\n+ }\n+\nexecute(simulation: Simulation): void {\n- // TODO\n+ simulation.progression += Math.floor(this.getBaseProgression(simulation) * this.getPotency() / 100);\n}\n}\n", "new_path": "src/app/pages/simulator/model/actions/progress-action.ts", "old_path": "src/app/pages/simulator/model/actions/progress-action.ts" }, { "change_type": "MODIFY", "diff": "@@ -2,6 +2,17 @@ import {Simulation} from '../../simulation/simulation';\nimport {GeneralAction} from './general-action';\nexport abstract class QualityAction extends GeneralAction {\n+ private static QUALITY_PENALTY_TABLE = {\n+ 0: -0.02,\n+ 90: -0.03,\n+ 160: -0.05,\n+ 180: -0.06,\n+ 200: -0.07,\n+ 245: -0.08,\n+ 300: -0.09,\n+ 310: -0.10,\n+ 340: -0.11,\n+ };\nexecute(simulation: Simulation): void {\n// TODO\n", "new_path": "src/app/pages/simulator/model/actions/quality-action.ts", "old_path": "src/app/pages/simulator/model/actions/quality-action.ts" }, { "change_type": "MODIFY", "diff": "import {Buff} from './buff.enum';\nimport {Simulation} from '../simulation/simulation';\n-export abstract class EffectiveBuff {\n+export interface EffectiveBuff {\nduration: number;\nstacks: number;\nbuff: Buff;\n- abstract tick(simulationState: Simulation): void;\n+ tick: (simulationState: Simulation) => void;\n}\n", "new_path": "src/app/pages/simulator/model/effective-buff.ts", "old_path": "src/app/pages/simulator/model/effective-buff.ts" }, { "change_type": "ADD", "diff": "+import {Simulation} from './simulation/simulation';\n+import {Craft} from '../../model/garland-tools/craft';\n+import {CrafterStats} from './model/crafter-stats';\n+import {BasicSynthesis} from './model/actions/progression/basic-synthesis';\n+import {SteadyHand} from './model/actions/buff/steady-hand';\n+\n+const infusionOfMind_Recipe: Craft = {\n+ 'id': '3595',\n+ 'job': 14,\n+ 'rlvl': 288,\n+ 'durability': 80,\n+ 'quality': 12913,\n+ 'progress': 2854,\n+ 'lvl': 69,\n+ 'yield': 3,\n+ 'hq': 1,\n+ 'quickSynth': 1,\n+ 'ingredients': [\n+ {\n+ 'id': 19872,\n+ 'amount': 1,\n+ 'quality': 1244\n+ },\n+ {\n+ 'id': 19907,\n+ 'amount': 1,\n+ 'quality': 1313\n+ },\n+ {\n+ 'id': 19915,\n+ 'amount': 2,\n+ 'quality': 1313\n+ },\n+ {\n+ 'id': 20013,\n+ 'amount': 1,\n+ 'quality': 1272\n+ },\n+ {\n+ 'id': 19,\n+ 'amount': 2\n+ },\n+ {\n+ 'id': 18,\n+ 'amount': 1\n+ }\n+ ],\n+ 'complexity': {\n+ 'nq': 155,\n+ 'hq': 160\n+ }\n+};\n+\n+const alc_70_350_stats: CrafterStats = {\n+ jobId: 14,\n+ level: 70,\n+ control: 1450,\n+ cp: 474,\n+ craftsmanship: 1468,\n+ specialist: true,\n+};\n+\n+describe('Craft simulator tests', () => {\n+\n+ it('should be able to predict correct progression on action', () => {\n+ const simulation = new Simulation(infusionOfMind_Recipe, [new SteadyHand(), new BasicSynthesis()], alc_70_350_stats);\n+ simulation.run();\n+ expect(simulation.progression).toBeCloseTo(352, 10);\n+ });\n+\n+ it('should have a good probability system', () => {\n+ const results = [];\n+ // Run simulation 100k times, to be sure with probability\n+ for (let i = 0; i < 100000; i++) {\n+ // Basic Synthesis has 90% success rate\n+ const simulation = new Simulation(infusionOfMind_Recipe, [new BasicSynthesis()], alc_70_350_stats);\n+ simulation.run();\n+ results.push(simulation.steps[0].success);\n+ }\n+ // Expect around 10k failure, with a 100 precision.\n+ expect(results.filter(res => !res).length).toBeCloseTo(10000, -2);\n+ });\n+\n+ it('should be able to apply steady hand buff properly', () => {\n+ const results = [];\n+ // Run simulation 10k times, to be sure with probability\n+ for (let i = 0; i < 10000; i++) {\n+ const simulation = new Simulation(infusionOfMind_Recipe, [new SteadyHand(), new BasicSynthesis()], alc_70_350_stats);\n+ simulation.run();\n+ results.push(simulation.steps[1].success);\n+ }\n+ // Expect no failures, as steady hand ensures 100% success with a 90% skill.\n+ expect(results.filter(res => !res).length).toBe(0);\n+ });\n+});\n", "new_path": "src/app/pages/simulator/simulation.spec.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -23,7 +23,7 @@ export class Simulation {\npublic steps: ActionResult[] = [];\n- constructor(private recipe: Craft, private actions: CraftingAction[], private _crafterStats: CrafterStats,\n+ constructor(public readonly recipe: Craft, private actions: CraftingAction[], private _crafterStats: CrafterStats,\nhqIngredients: { id: number, amount: number }[] = []) {\nthis.solidity = recipe.durability;\nthis.availableCP = this._crafterStats.cp;\n@@ -41,7 +41,7 @@ export class Simulation {\npublic run(): ActionResult[] {\nfor (const action of this.actions) {\n// If we can use the action\n- if (this.success === undefined && action.getCPCost(this) >= this.availableCP && action.canBeUsed(this)) {\n+ if (this.success === undefined && action.getCPCost(this) <= this.availableCP && action.canBeUsed(this)) {\n// The roll for the current action's success rate\nconst probabilityRoll = Math.random() * 100;\nconst qualityBefore = this.quality;\n@@ -86,7 +86,10 @@ export class Simulation {\nprivate tickBuffs(): void {\nfor (const effectiveBuff of this.buffs) {\n+ // If the buff has something to do, let it do it\n+ if (effectiveBuff.tick !== undefined) {\neffectiveBuff.tick(this);\n+ }\neffectiveBuff.duration--;\n}\nthis.buffs = this.buffs.filter(buff => buff.duration > 0);\n", "new_path": "src/app/pages/simulator/simulation/simulation.ts", "old_path": "src/app/pages/simulator/simulation/simulation.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore(simulator): first tests and progression implementation
1
chore
simulator
679,913
26.04.2018 01:27:32
-3,600
679c4e084344e0b5ea44d23bccda78f0a01c0a0f
feat(rstream-query): add path query, multi-joins, pattern query reuse add addPathQuery() add addMultiJoin() rename addQueryJoin() => addJoin() update query ID arg order add type aliases add pattern query cache add patternVars() helper
[ { "change_type": "MODIFY", "diff": "import { IObjectOf } from \"@thi.ng/api/api\";\n+import { ISubscribable } from \"@thi.ng/rstream/api\";\nexport type Pattern = [any, any, any];\n+export type PathPattern = [any, any[], any];\n+\nexport type Triple = Pattern;\nexport type Triples = Set<Pattern>;\n@@ -10,13 +13,7 @@ export type TripleIds = Set<number>;\nexport type Solutions = Set<IObjectOf<any>>;\n-export const CHOICES = Symbol(\"CHOICES\");\n-\n-export enum EditOp {\n- ADD,\n- DELETE,\n- UPDATE\n-}\n+export type QuerySolution = ISubscribable<Solutions>;\nexport interface Edit {\nindex: Set<number>;\n", "new_path": "packages/rstream-query/src/api.ts", "old_path": "packages/rstream-query/src/api.ts" }, { "change_type": "MODIFY", "diff": "import { repeatedly } from \"@thi.ng/transducers/iter/repeatedly\";\n-import { Triple, Pattern } from \"./api\";\n+import { Pattern, PathPattern } from \"./api\";\nimport { isQVar, autoQVar, qvarName } from \"./qvar\";\nexport const patternVarCount = (p: Pattern) => {\n@@ -11,11 +11,20 @@ export const patternVarCount = (p: Pattern) => {\nreturn n;\n};\n+export const patternVars = ([s, p, o]: Pattern) => {\n+ const vars = [];\n+ isQVar(s) && vars.push(qvarName(s));\n+ isQVar(p) && vars.push(qvarName(p));\n+ isQVar(o) && vars.push(qvarName(o));\n+ return vars;\n+};\n+\n/**\n* Takes a path triple pattern and max depth. The pattern's predicate\n* must be a seq of preds. Returns a 2-elem vector [patterns vars],\n- * where `patterns` is a seq of query patterns with injected temp qvars\n- * for in between patterns and`vars` the autogenerated qvars themselves.\n+ * where `patterns` is a list of generated sub-query patterns with\n+ * injected temp qvars for in between patterns and `vars` are the temp\n+ * qvars themselves.\n*\n* Example:\n*\n@@ -28,12 +37,12 @@ export const patternVarCount = (p: Pattern) => {\n* ```\n*\n* @param pattern\n- * @param maxd\n+ * @param maxLen\n*/\n-export const resolvePathPattern = ([s, p, o], maxd = p.length) => {\n+export const resolvePathPattern = ([s, p, o]: PathPattern, maxLen = p.length): [Pattern[], string[]] => {\nconst res = [];\n- const avars = [...repeatedly(autoQVar, maxd - 1)];\n- for (let i = 0; i < maxd; i++) {\n+ const avars = [...repeatedly(autoQVar, maxLen - 1)];\n+ for (let i = 0; i < maxLen; i++) {\nres.push([s, p[i % p.length], s = avars[i]]);\n}\nres[res.length - 1][2] = o;\n@@ -42,43 +51,3 @@ export const resolvePathPattern = ([s, p, o], maxd = p.length) => {\nexport const sortPatterns = (patterns: Pattern[]) =>\npatterns.sort((a, b) => patternVarCount(a) - patternVarCount(b));\n-\n-/**\n- * Returns an optimized query variable solution extractor function based\n- * on given pattern type. `vs`, `vp`, `vo` are flags to indicate if `s`,\n- * `p` and/or `o` pattern items are query variables. The returned fn\n- * will be optimized to 1 of the 8 possible case and accepts a single\n- * fact to extract the respective variables from.\n- *\n- * @param vs\n- * @param vp\n- * @param vo\n- * @param s\n- * @param p\n- * @param o\n- */\n-export const qvarResolver = (vs: boolean, vp: boolean, vo: boolean, s, p, o) => {\n- const type = ((<any>vs) << 2) | ((<any>vp) << 1) | (<any>vo);\n- let ss: any = vs && qvarName(s);\n- let pp: any = vp && qvarName(p);\n- let oo: any = vo && qvarName(o);\n- switch (type) {\n- case 0:\n- default:\n- return;\n- case 1:\n- return (f: Triple) => ({ [oo]: f[2] });\n- case 2:\n- return (f: Triple) => ({ [pp]: f[1] });\n- case 3:\n- return (f: Triple) => ({ [pp]: f[1], [oo]: f[2] });\n- case 4:\n- return (f: Triple) => ({ [ss]: f[0] });\n- case 5:\n- return (f: Triple) => ({ [ss]: f[0], [oo]: f[2] });\n- case 6:\n- return (f: Triple) => ({ [ss]: f[0], [pp]: f[1] });\n- case 7:\n- return (f: Triple) => ({ [ss]: f[0], [pp]: f[1], [oo]: f[2] });\n- }\n-};\n", "new_path": "packages/rstream-query/src/pattern.ts", "old_path": "packages/rstream-query/src/pattern.ts" }, { "change_type": "MODIFY", "diff": "import { isString } from \"@thi.ng/checks/is-string\";\n+import { Triple } from \"./api\";\n+\nconst AUTO_QVAR_PREFIX = \"?__q\";\nlet AUTO_QVAR_ID = 0;\n@@ -14,3 +16,43 @@ export const autoQVar = () =>\nexport const qvarName = (x: string) =>\nx.substr(1);\n+\n+/**\n+* Returns an optimized query variable solution extractor function based\n+* on given pattern type. `vs`, `vp`, `vo` are flags to indicate if `s`,\n+* `p` and/or `o` pattern items are query variables. The returned fn\n+* will be optimized to 1 of the 8 possible case and accepts a single\n+* fact to extract the respective variables from.\n+*\n+* @param vs\n+* @param vp\n+* @param vo\n+* @param s\n+* @param p\n+* @param o\n+*/\n+export const qvarResolver = (vs: boolean, vp: boolean, vo: boolean, s, p, o) => {\n+ const type = ((<any>vs) << 2) | ((<any>vp) << 1) | (<any>vo);\n+ let ss: any = vs && qvarName(s);\n+ let pp: any = vp && qvarName(p);\n+ let oo: any = vo && qvarName(o);\n+ switch (type) {\n+ case 0:\n+ default:\n+ return;\n+ case 1:\n+ return (f: Triple) => ({ [oo]: f[2] });\n+ case 2:\n+ return (f: Triple) => ({ [pp]: f[1] });\n+ case 3:\n+ return (f: Triple) => ({ [pp]: f[1], [oo]: f[2] });\n+ case 4:\n+ return (f: Triple) => ({ [ss]: f[0] });\n+ case 5:\n+ return (f: Triple) => ({ [ss]: f[0], [oo]: f[2] });\n+ case 6:\n+ return (f: Triple) => ({ [ss]: f[0], [pp]: f[1] });\n+ case 7:\n+ return (f: Triple) => ({ [ss]: f[0], [pp]: f[1], [oo]: f[2] });\n+ }\n+};\n", "new_path": "packages/rstream-query/src/qvar.ts", "old_path": "packages/rstream-query/src/qvar.ts" }, { "change_type": "MODIFY", "diff": "@@ -3,17 +3,27 @@ import { equiv } from \"@thi.ng/api/equiv\";\nimport { illegalArgs } from \"@thi.ng/api/error\";\nimport { intersection } from \"@thi.ng/associative/intersection\";\nimport { join } from \"@thi.ng/associative\";\n-import { Stream, Subscription, sync } from \"@thi.ng/rstream\";\n+import { ISubscribable } from \"@thi.ng/rstream/api\";\n+import { Stream } from \"@thi.ng/rstream/stream\";\n+import { sync } from \"@thi.ng/rstream/stream-sync\";\n+import { Subscription } from \"@thi.ng/rstream/subscription\";\nimport { toDot, walk, DotOpts, IToDot } from \"@thi.ng/rstream-dot\";\nimport { Transducer, Reducer } from \"@thi.ng/transducers/api\";\n+import { iterator } from \"@thi.ng/transducers/iterator\";\n+import { transduce } from \"@thi.ng/transducers/transduce\";\n+import { keySelector } from \"@thi.ng/transducers/func/key-selector\";\n+import { comp } from \"@thi.ng/transducers/func/comp\";\nimport { compR } from \"@thi.ng/transducers/func/compr\";\n+import { assocObj } from \"@thi.ng/transducers/rfn/assoc-obj\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\n+import { mapIndexed } from \"@thi.ng/transducers/xform/map-indexed\";\n-import { DEBUG, Edit, Triple, TripleIds, Pattern, Solutions, Triples } from \"./api\";\n-import { qvarResolver } from \"./pattern\";\n-import { isQVar } from \"./qvar\";\n+import { DEBUG, Edit, Triple, TripleIds, Pattern, Solutions, Triples, PathPattern, QuerySolution } from \"./api\";\n+import { resolvePathPattern, patternVars } from \"./pattern\";\n+import { isQVar, qvarResolver } from \"./qvar\";\nexport class TripleStore implements\n+ Iterable<Triple>,\nIToDot {\nNEXT_ID: number;\n@@ -24,6 +34,7 @@ export class TripleStore implements\nindexP: Map<any, TripleIds>;\nindexO: Map<any, TripleIds>;\nindexSelections: IObjectOf<Map<any, Subscription<Edit, TripleIds>>>;\n+ queries: Map<string, ISubscribable<TripleIds>>;\nallIDs: TripleIds;\nstreamAll: Stream<TripleIds>;\n@@ -34,6 +45,7 @@ export class TripleStore implements\nconstructor(triples?: Iterable<Triple>) {\nthis.triples = [];\nthis.freeIDs = [];\n+ this.queries = new Map();\nthis.indexS = new Map();\nthis.indexP = new Map();\nthis.indexO = new Map();\n@@ -66,7 +78,7 @@ export class TripleStore implements\n}\nget(t: Triple, notFound?: any) {\n- const id = this.findInIndices(\n+ const id = this.findTriple(\nthis.indexS.get(t[0]),\nthis.indexP.get(t[1]),\nthis.indexO.get(t[2]),\n@@ -79,7 +91,7 @@ export class TripleStore implements\nlet s = this.indexS.get(t[0]);\nlet p = this.indexP.get(t[1]);\nlet o = this.indexO.get(t[2]);\n- if (this.findInIndices(s, p, o, t) !== -1) return false;\n+ if (this.findTriple(s, p, o, t) !== -1) return false;\nconst id = this.nextID();\nconst is = s || new Set<number>();\nconst ip = p || new Set<number>();\n@@ -92,10 +104,7 @@ export class TripleStore implements\n!s && this.indexS.set(t[0], is);\n!p && this.indexP.set(t[1], ip);\n!o && this.indexO.set(t[2], io);\n- this.streamAll.next(this.allIDs);\n- this.streamS.next({ index: is, key: t[0] });\n- this.streamP.next({ index: ip, key: t[1] });\n- this.streamO.next({ index: io, key: t[2] });\n+ this.broadcastTriple(is, ip, io, t);\nreturn true;\n}\n@@ -111,7 +120,7 @@ export class TripleStore implements\nlet s = this.indexS.get(t[0]);\nlet p = this.indexP.get(t[1]);\nlet o = this.indexO.get(t[2]);\n- const id = this.findInIndices(s, p, o, t);\n+ const id = this.findTriple(s, p, o, t);\nif (id === -1) return false;\ns.delete(id);\n!s.size && this.indexS.delete(t[0]);\n@@ -122,13 +131,24 @@ export class TripleStore implements\nthis.allIDs.delete(id);\ndelete this.triples[id];\nthis.freeIDs.push(id);\n- this.streamAll.next(this.allIDs);\n- this.streamS.next({ index: s, key: t[0] });\n- this.streamP.next({ index: p, key: t[1] });\n- this.streamO.next({ index: o, key: t[2] });\n+ this.broadcastTriple(s, p, o, t);\nreturn true;\n}\n+ /**\n+ * Replaces triple `a` with `b`, *iff* `a` is actually in the store.\n+ * Else does nothing.\n+ *\n+ * @param a\n+ * @param b\n+ */\n+ replace(a: Triple, b: Triple) {\n+ if (this.delete(a)) {\n+ return this.add(b);\n+ }\n+ return false;\n+ }\n+\n/**\n* Creates a new query subscription from given SPO pattern. Any\n* `null` values in the pattern act as wildcard selectors and any\n@@ -144,11 +164,16 @@ export class TripleStore implements\n* @param id\n* @param param1\n*/\n- addPatternQuery(id: string, [s, p, o]: Pattern, emitTriples = true): Subscription<TripleIds, TripleIds | Triples> {\n- let results: Subscription<any, TripleIds | Triples>;\n+ addPatternQuery(pattern: Pattern, id?: string): ISubscribable<Triples>;\n+ addPatternQuery(pattern: Pattern, id?: string, emitTriples?: boolean): ISubscribable<TripleIds | Triples>;\n+ addPatternQuery(pattern: Pattern, id?: string, emitTriples = true) {\n+ let results: ISubscribable<TripleIds | Triples>;\n+ const [s, p, o] = pattern;\nif (s == null && p == null && o == null) {\nresults = this.streamAll;\n} else {\n+ const key = JSON.stringify(pattern);\n+ if (!(results = this.queries.get(key))) {\nconst qs = this.getIndexSelection(this.streamS, s, \"s\");\nconst qp = this.getIndexSelection(this.streamP, p, \"p\");\nconst qo = this.getIndexSelection(this.streamO, o, \"o\");\n@@ -158,18 +183,14 @@ export class TripleStore implements\nxform: map(({ s, p, o }) => intersection(intersection(s, p), o)),\nreset: true,\n});\n- const submit = (index: Map<any, TripleIds>, stream: Subscription<Edit, TripleIds>, key: any) => {\n- if (key != null) {\n- const ids = index.get(key);\n- ids && stream.next({ index: ids, key });\n- }\n- };\n+ this.queries.set(key, <ISubscribable<TripleIds>>results);\nsubmit(this.indexS, qs, s);\nsubmit(this.indexP, qp, p);\nsubmit(this.indexO, qo, o);\n}\n+ }\nreturn emitTriples ?\n- results.transform(asTriples(this)) :\n+ results.subscribe(asTriples(this)) :\nresults;\n}\n@@ -179,7 +200,7 @@ export class TripleStore implements\n* rest of the string is considered the variable name.\n*\n* ```\n- * g.addParamQuery(\"id\", [\"?a\", \"friend\", \"?b\"]);\n+ * g.addParamQuery([\"?a\", \"friend\", \"?b\"]);\n* ```\n*\n* Internally, the query pattern is translated into a basic param\n@@ -194,7 +215,7 @@ export class TripleStore implements\n* @param id\n* @param param1\n*/\n- addParamQuery(id: string, [s, p, o]: Pattern): Subscription<Triples, Solutions> {\n+ addParamQuery([s, p, o]: Pattern, id?: string): QuerySolution {\nconst vs = isQVar(s);\nconst vp = isQVar(p);\nconst vo = isQVar(o);\n@@ -202,12 +223,13 @@ export class TripleStore implements\nif (!resolve) {\nillegalArgs(\"at least 1 query variable is required in pattern\");\n}\n+ id || (id = `query-${Subscription.NEXT_ID++}`);\nconst query = <Subscription<TripleIds, Triples>>this.addPatternQuery(\n- id + \"-raw\",\n[vs ? null : s, vp ? null : p, vo ? null : o],\n+ id + \"-raw\"\n);\nreturn query.transform(\n- map((triples: Set<Triple>) => {\n+ map((triples) => {\nconst res = new Set<any>();\nfor (let f of triples) {\nres.add(resolve(f));\n@@ -219,6 +241,28 @@ export class TripleStore implements\n}\n/**\n+ * Converts the given path pattern into a number of sub-queries and\n+ * return a rstream subscription of re-joined result solutions. If\n+ * `maxLen` is given and greater than the number of actual path\n+ * predicates, the predicates are repeated.\n+ *\n+ * @param path\n+ * @param maxDepth\n+ * @param id\n+ */\n+ addPathQuery(path: PathPattern, len = path[1].length, id?: string): QuerySolution {\n+ return this.addMultiJoin(\n+ iterator(\n+ map<Pattern, QuerySolution>((q) => this.addParamQuery(q)),\n+ resolvePathPattern(path, len)[0]\n+ ),\n+ patternVars(path),\n+ id\n+ );\n+ }\n+\n+ /**\n+ * Like `addMultiJoin()`, but optimized for only two input queries.\n* Returns a rstream subscription computing the natural join of the\n* given input query results.\n*\n@@ -226,7 +270,7 @@ export class TripleStore implements\n* @param a\n* @param b\n*/\n- addQueryJoin(id: string, a: Subscription<any, Solutions>, b: Subscription<any, Solutions>): Subscription<Solutions, Solutions> {\n+ addJoin(a: QuerySolution, b: QuerySolution, id?: string): QuerySolution {\nreturn sync<Solutions, Solutions>({\nid,\nsrc: { a, b },\n@@ -234,6 +278,19 @@ export class TripleStore implements\n});\n}\n+ addMultiJoin(queries: Iterable<QuerySolution>, keepVars?: Iterable<string>, id?: string): QuerySolution {\n+ const src = transduce(\n+ mapIndexed<QuerySolution, [string, QuerySolution]>(\n+ (i, q) => [String(i), q]\n+ ),\n+ assocObj(),\n+ queries\n+ );\n+ let xform = joinSolutions(Object.keys(src).length);\n+ keepVars && (xform = comp(xform, filterSolutions(keepVars)));\n+ return sync({ id, src, xform });\n+ }\n+\ntoDot(opts?: Partial<DotOpts>) {\nreturn toDot(walk([this.streamS, this.streamP, this.streamO, this.streamAll]), opts);\n}\n@@ -245,7 +302,14 @@ export class TripleStore implements\nreturn this.NEXT_ID++;\n}\n- protected findInIndices(s: TripleIds, p: TripleIds, o: TripleIds, f: Triple) {\n+ private broadcastTriple(s: TripleIds, p: TripleIds, o: TripleIds, t: Triple) {\n+ this.streamAll.next(this.allIDs);\n+ this.streamS.next({ index: s, key: t[0] });\n+ this.streamP.next({ index: p, key: t[1] });\n+ this.streamO.next({ index: o, key: t[2] });\n+ }\n+\n+ protected findTriple(s: TripleIds, p: TripleIds, o: TripleIds, f: Triple) {\nif (s && p && o) {\nconst triples = this.triples;\nconst index = s.size < p.size ?\n@@ -272,7 +336,15 @@ export class TripleStore implements\n}\n}\n-export const indexSel = (key: any): Transducer<Edit, TripleIds> =>\n+\n+const submit = (index: Map<any, TripleIds>, stream: Subscription<Edit, TripleIds>, key: any) => {\n+ if (key != null) {\n+ const ids = index.get(key);\n+ ids && stream.next({ index: ids, key });\n+ }\n+};\n+\n+const indexSel = (key: any): Transducer<Edit, TripleIds> =>\n(rfn: Reducer<any, TripleIds>) => {\nconst r = rfn[2];\nreturn compR(rfn,\n@@ -286,10 +358,30 @@ export const indexSel = (key: any): Transducer<Edit, TripleIds> =>\n);\n};\n-export const asTriples = (graph: TripleStore) =>\n+const asTriples = (graph: TripleStore) =>\nmap<TripleIds, Set<Triple>>(\n(ids) => {\nconst res = new Set<Triple>();\nfor (let id of ids) res.add(graph.triples[id]);\nreturn res;\n});\n+\n+const joinSolutions = (n: number) =>\n+ map<IObjectOf<Solutions>, Solutions>((src) => {\n+ let res: Solutions = src[0];\n+ for (let i = 1; i < n && res.size; i++) {\n+ res = join(res, src[i]);\n+ }\n+ return res;\n+ });\n+\n+const filterSolutions = (qvars: Iterable<string>) => {\n+ const filterVars = keySelector([...qvars]);\n+ return map((sol: Solutions) => {\n+ const res: Solutions = new Set();\n+ for (let s of sol) {\n+ res.add(filterVars(s));\n+ }\n+ return res;\n+ });\n+};\n\\ No newline at end of file\n", "new_path": "packages/rstream-query/src/store.ts", "old_path": "packages/rstream-query/src/store.ts" }, { "change_type": "MODIFY", "diff": "@@ -20,95 +20,95 @@ describe(\"rstream-query\", () => {\nit(\"pattern query (S)\", () => {\nconst res = [];\n- store.addPatternQuery(\"q\", [\"a\", null, null], false).subscribe({ next: (r) => res.push(r) });\n+ store.addPatternQuery([\"a\", null, null], \"q\", false).subscribe({ next: (r) => res.push(r) });\nassert.deepEqual(res, [new Set([0, 3])]);\n});\nit(\"pattern query (P)\", () => {\nconst res = [];\n- store.addPatternQuery(\"q\", [null, \"type\", null], false).subscribe({ next: (r) => res.push(r) });\n+ store.addPatternQuery([null, \"type\", null], \"q\", false).subscribe({ next: (r) => res.push(r) });\nassert.deepEqual(res, [new Set([0, 1, 2])]);\n});\nit(\"pattern query (O)\", () => {\nconst res = [];\n- store.addPatternQuery(\"q\", [null, null, \"a\"], false).subscribe({ next: (r) => res.push(r) });\n+ store.addPatternQuery([null, null, \"a\"], \"q\", false).subscribe({ next: (r) => res.push(r) });\nassert.deepEqual(res, [new Set([5])]);\n});\nit(\"pattern query (SP)\", () => {\nconst res = [];\n- store.addPatternQuery(\"q\", [\"a\", \"value\", null], false).subscribe({ next: (r) => res.push(r) });\n+ store.addPatternQuery([\"a\", \"value\", null], \"q\", false).subscribe({ next: (r) => res.push(r) });\nassert.deepEqual(res, [new Set([3])]);\n});\nit(\"pattern query (PO)\", () => {\nconst res = [];\n- store.addPatternQuery(\"q\", [null, \"value\", 0], false).subscribe({ next: (r) => res.push(r) });\n+ store.addPatternQuery([null, \"value\", 0], \"q\", false).subscribe({ next: (r) => res.push(r) });\nassert.deepEqual(res, [new Set([3])]);\n});\nit(\"pattern query (SO)\", () => {\nconst res = [];\n- store.addPatternQuery(\"q\", [\"b\", null, \"bar\"], false).subscribe({ next: (r) => res.push(r) });\n+ store.addPatternQuery([\"b\", null, \"bar\"], \"q\", false).subscribe({ next: (r) => res.push(r) });\nassert.deepEqual(res, [new Set([1])]);\n});\nit(\"pattern query (SPO)\", () => {\nconst res = [];\n- store.addPatternQuery(\"q\", [\"c\", \"type\", \"baz\"], false).subscribe({ next: (r) => res.push(r) });\n+ store.addPatternQuery([\"c\", \"type\", \"baz\"], \"q\", false).subscribe({ next: (r) => res.push(r) });\nassert.deepEqual(res, [new Set([2])]);\n});\nit(\"pattern query (all)\", () => {\nconst res = [];\n- store.addPatternQuery(\"q\", [null, null, null], false).subscribe({ next: (r) => res.push(r) });\n+ store.addPatternQuery([null, null, null], \"q\", false).subscribe({ next: (r) => res.push(r) });\nassert.deepEqual(res, [new Set([0, 1, 2, 3, 4, 5])]);\n});\nit(\"param query (S)\", () => {\nconst res = [];\n- store.addParamQuery(\"q\", [\"a\", \"?p\", \"?o\"]).subscribe({ next: (r) => res.push(r) });\n+ store.addParamQuery([\"a\", \"?p\", \"?o\"]).subscribe({ next: (r) => res.push(r) });\nassert.deepEqual(res, [new Set([{ p: \"type\", o: \"foo\" }, { p: \"value\", o: 0 }])]);\n});\nit(\"param query (P)\", () => {\nconst res = [];\n- store.addParamQuery(\"q\", [\"?s\", \"type\", \"?o\"]).subscribe({ next: (r) => res.push(r) });\n+ store.addParamQuery([\"?s\", \"type\", \"?o\"]).subscribe({ next: (r) => res.push(r) });\nassert.deepEqual(res, [new Set([{ s: \"a\", o: \"foo\" }, { s: \"b\", o: \"bar\" }, { s: \"c\", o: \"baz\" }])]);\n});\nit(\"param query (O)\", () => {\nconst res = [];\n- store.addParamQuery(\"q\", [\"?s\", \"?p\", \"a\"]).subscribe({ next: (r) => res.push(r) });\n+ store.addParamQuery([\"?s\", \"?p\", \"a\"]).subscribe({ next: (r) => res.push(r) });\nassert.deepEqual(res, [new Set([{ s: \"c\", p: \"friend\" }])]);\n});\nit(\"param query (SP)\", () => {\nconst res = [];\n- store.addParamQuery(\"q\", [\"a\", \"value\", \"?o\"]).subscribe({ next: (r) => res.push(r) });\n+ store.addParamQuery([\"a\", \"value\", \"?o\"]).subscribe({ next: (r) => res.push(r) });\nassert.deepEqual(res, [new Set([{ o: 0 }])]);\n});\nit(\"param query (PO)\", () => {\nconst res = [];\n- store.addParamQuery(\"q\", [\"?s\", \"value\", 0]).subscribe({ next: (r) => res.push(r) });\n+ store.addParamQuery([\"?s\", \"value\", 0]).subscribe({ next: (r) => res.push(r) });\nassert.deepEqual(res, [new Set([{ s: \"a\" }])]);\n});\nit(\"param query (SO)\", () => {\nconst res = [];\n- store.addParamQuery(\"q\", [\"b\", \"?p\", \"bar\"]).subscribe({ next: (r) => res.push(r) });\n+ store.addParamQuery([\"b\", \"?p\", \"bar\"]).subscribe({ next: (r) => res.push(r) });\nassert.deepEqual(res, [new Set([{ p: \"type\" }])]);\n});\nit(\"param query (SPO)\", () => {\n- assert.throws(() => store.addParamQuery(\"q\", [\"c\", \"type\", \"baz\"]));\n+ assert.throws(() => store.addParamQuery([\"c\", \"type\", \"baz\"]));\n});\nit(\"param query (all)\", () => {\nconst res = [];\n- store.addParamQuery(\"q\", [\"?s\", \"?p\", \"?o\"]).subscribe({ next: (r) => res.push(r) });\n+ store.addParamQuery([\"?s\", \"?p\", \"?o\"]).subscribe({ next: (r) => res.push(r) });\nassert.deepEqual(res, [new Set([\n{ s: \"a\", p: \"type\", o: \"foo\" },\n{ s: \"b\", p: \"type\", o: \"bar\" },\n", "new_path": "packages/rstream-query/test/index.ts", "old_path": "packages/rstream-query/test/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(rstream-query): add path query, multi-joins, pattern query reuse - add addPathQuery() - add addMultiJoin() - rename addQueryJoin() => addJoin() - update query ID arg order - add type aliases - add pattern query cache - add patternVars() helper
1
feat
rstream-query
730,414
26.04.2018 09:45:28
14,400
83667a3e3fffe85f9ef239e911c9b9f236613975
refactor(widget-space): move declared function to anonymous
[ { "change_type": "MODIFY", "diff": "@@ -10,20 +10,17 @@ const getFeatures = (state) => state.features;\nconst getOwnProps = (state, ownProps) => ownProps;\n/**\n- * Find the other user in a 1:1 conversation.\n+ * Get the other user in a 1:1 conversation.\n* @param {conversation} conversation\n* @param {participant} currentUser\n- * @returns {participant}\n+ * @returns {reselect.Selector}\n*/\n-function findToUser(conversation, currentUser) {\n- return conversation\n- .get('participants')\n- .find((participant) => participant.get('id') !== currentUser.id);\n-}\n-\nexport const getToUser = createSelector(\n[getConversation, getCurrentUser],\n- findToUser\n+ (conversation, currentUser) =>\n+ conversation\n+ .get('participants')\n+ .find((participant) => participant.get('id') !== currentUser.id)\n);\nexport const getSpaceDetails = createSelector(\n", "new_path": "packages/node_modules/@ciscospark/widget-space/src/selector.js", "old_path": "packages/node_modules/@ciscospark/widget-space/src/selector.js" } ]
JavaScript
MIT License
webex/react-widgets
refactor(widget-space): move declared function to anonymous
1
refactor
widget-space
815,745
26.04.2018 10:47:56
-10,800
38c27dcd16beb028b99a15709165e2a7510e6fd3
feat: support item navigation while not searchable * feat: support item navigation while not searchable closes
[ { "change_type": "MODIFY", "diff": "@@ -119,6 +119,14 @@ export class ItemsList {\n}\n}\n+ findByLabel(term: string) {\n+ term = searchHelper.stripSpecialChars(term).toLocaleLowerCase();\n+ return this.filteredItems.find(item => {\n+ const label = searchHelper.stripSpecialChars(item.label).toLocaleLowerCase();\n+ return label.substr(0, term.length) === term;\n+ });\n+ }\n+\nfilter(term: string) {\nif (!term) {\nthis.resetItems();\n", "new_path": "src/ng-select/items-list.ts", "old_path": "src/ng-select/items-list.ts" }, { "change_type": "MODIFY", "diff": "@@ -1120,6 +1120,33 @@ describe('NgSelectComponent', function () {\nexpect(select.selectedItems).toEqual(result);\n}));\n});\n+\n+ describe('key presses', () => {\n+ beforeEach(() => {\n+ select.searchable = false;\n+ select.ngOnInit();\n+ });\n+\n+ it('should select item using key while not opened', fakeAsync(() => {\n+ triggerKeyDownEvent(getNgSelectElement(fixture), 97, 'v');\n+ tick(200);\n+\n+ expect(fixture.componentInstance.selectedCity.name).toBe('Vilnius');\n+ }));\n+\n+ it('should mark item using key while opened', fakeAsync(() => {\n+ const findByLabel = spyOn(select.itemsList, 'findByLabel');\n+ triggerKeyDownEvent(getNgSelectElement(fixture), KeyCode.Space);\n+ triggerKeyDownEvent(getNgSelectElement(fixture), 97, 'v');\n+ triggerKeyDownEvent(getNgSelectElement(fixture), 97, 'i');\n+ triggerKeyDownEvent(getNgSelectElement(fixture), 97, 'l');\n+ tick(200);\n+\n+ expect(fixture.componentInstance.selectedCity).toBeUndefined();\n+ expect(select.itemsList.markedItem.label).toBe('Vilnius')\n+ expect(findByLabel).toHaveBeenCalledWith('vil')\n+ }));\n+ });\n});\ndescribe('Outside click', () => {\n", "new_path": "src/ng-select/ng-select.component.spec.ts", "old_path": "src/ng-select/ng-select.component.spec.ts" }, { "change_type": "MODIFY", "diff": "-import { Subject } from 'rxjs/Subject';\n-import { merge } from 'rxjs/observable/merge';\n-import { takeUntil, startWith } from 'rxjs/operators';\n-import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport {\nComponent,\nOnDestroy,\n@@ -28,6 +24,10 @@ import {\nNgZone,\nAttribute\n} from '@angular/core';\n+import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n+import { takeUntil, startWith, tap, debounceTime, map, filter } from 'rxjs/operators';\n+import { merge } from 'rxjs/observable/merge';\n+import { Subject } from 'rxjs/Subject';\nimport {\nNgOptionTemplateDirective,\n@@ -41,13 +41,13 @@ import {\nNgMultiLabelTemplateDirective\n} from './ng-templates.directive';\n-import { NgOption, KeyCode, NgSelectConfig } from './ng-select.types';\n-import { ItemsList } from './items-list';\n-import { NgOptionComponent } from './ng-option.component';\n-import { NgDropdownPanelComponent } from './ng-dropdown-panel.component';\n-import { isDefined, isFunction, isPromise, isObject } from './value-utils';\nimport { ConsoleService } from './console.service';\n+import { isDefined, isFunction, isPromise, isObject } from './value-utils';\n+import { ItemsList } from './items-list';\n+import { NgOption, KeyCode, NgSelectConfig } from './ng-select.types';\nimport { newId } from './id';\n+import { NgDropdownPanelComponent } from './ng-dropdown-panel.component';\n+import { NgOptionComponent } from './ng-option.component';\nimport { WindowService } from './window.service';\nexport const NG_SELECT_DEFAULT_CONFIG = new InjectionToken<NgSelectConfig>('ng-select-default-options');\n@@ -152,9 +152,11 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nprivate _defaultLabel = 'label';\nprivate _primitive: boolean;\n+ private _pressedKeys: string[] = [];\nprivate _compareWith: CompareWithFn;\nprivate readonly _destroy$ = new Subject<void>();\n+ private readonly _keyPress$ = new Subject<string>();\nprivate _onChange = (_: NgOption) => { };\nprivate _onTouched = () => { };\n@@ -187,6 +189,10 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nreturn this.selectedItems.length > 0;\n}\n+ ngOnInit() {\n+ this._handleKeyPresses();\n+ }\n+\nngOnChanges(changes: SimpleChanges) {\nif (changes.multiple) {\nthis.itemsList.clearSelected();\n@@ -233,6 +239,8 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\nthis._handleBackspace();\nbreak;\n}\n+ } else if ($event.key && $event.key.length === 1) {\n+ this._keyPress$.next($event.key.toLocaleLowerCase());\n}\n}\n@@ -573,7 +581,30 @@ export class NgSelectComponent implements OnDestroy, OnChanges, AfterViewInit, C\n}\n}\n+ _handleKeyPresses() {\n+ if (this.searchable) {\n+ return;\n+ }\n+ this._keyPress$\n+ .pipe(takeUntil(this._destroy$),\n+ tap(letter => this._pressedKeys.push(letter)),\n+ debounceTime(200),\n+ filter(() => this._pressedKeys.length > 0),\n+ map(() => this._pressedKeys.join('')))\n+ .subscribe(term => {\n+ const item = this.itemsList.findByLabel(term);\n+ if (item) {\n+ if (this.isOpen) {\n+ this.itemsList.markItem(item);\n+ this._cd.markForCheck();\n+ } else {\n+ this.select(item);\n+ }\n+ }\n+ this._pressedKeys = [];\n+ });\n+ }\nprivate _updateNgModel() {\nconst model = [];\n", "new_path": "src/ng-select/ng-select.component.ts", "old_path": "src/ng-select/ng-select.component.ts" }, { "change_type": "MODIFY", "diff": "@@ -26,9 +26,10 @@ export function getNgSelectElement(fixture: ComponentFixture<any>): DebugElement\nreturn fixture.debugElement.query(By.css('ng-select'));\n}\n-export function triggerKeyDownEvent(element: DebugElement, key: number): void {\n+export function triggerKeyDownEvent(element: DebugElement, which: number, key = ''): void {\nelement.triggerEventHandler('keydown', {\n- which: key,\n+ which: which,\n+ key: key,\npreventDefault: () => { },\nstopPropagation: () => { }\n});\n", "new_path": "src/testing/helpers.ts", "old_path": "src/testing/helpers.ts" } ]
TypeScript
MIT License
ng-select/ng-select
feat: support item navigation while not searchable (#499) * feat: support item navigation while not searchable closes #117
1
feat
null
730,414
26.04.2018 14:20:57
14,400
19e398a7ca2110ed5b99c474c7345b438ed63e1f
chore(npm publish): fix publishing
[ { "change_type": "MODIFY", "diff": "@@ -197,7 +197,10 @@ ansiColor('xterm') {\nstring(credentialsId: 'NPM_TOKEN', variable: 'NPM_TOKEN')\n]) {\ntry {\n- sh 'echo \\'//registry.npmjs.org/:_authToken=${NPM_TOKEN}\\' >> .npmrc'\n+ // Back up .npmrc\n+ sh '[[ -f $HOME/.npmrc ]] && mv $HOME/.npmrc $HOME/.npmrc.bak'\n+ // Publish\n+ sh 'echo \\'//registry.npmjs.org/:_authToken=${NPM_TOKEN}\\' > $HOME/.npmrc'\necho ''\necho 'Reminder: E403 errors below are normal. They occur for any package that has no updates to publish'\necho ''\n@@ -205,8 +208,9 @@ ansiColor('xterm') {\nsource ~/.nvm/nvm.sh\nnvm use v8.9.1\nnpm run publish:components\n- git checkout .npmrc\n'''\n+ // Restore .npmrc\n+ sh '[[ -f $HOME/.npmrc.bak ]] && mv $HOME/.npmrc.bak $HOME/.npmrc'\n}\ncatch (error) {\nwarn(\"failed to publish to npm ${error.toString()}\")\n", "new_path": "Jenkinsfile", "old_path": "Jenkinsfile" } ]
JavaScript
MIT License
webex/react-widgets
chore(npm publish): fix publishing
1
chore
npm publish
679,913
26.04.2018 14:32:33
-3,600
76f00c36b3f3bdcf29546086cb81db1951810aad
refactor(rstream): update ISubscribable (add IDeref parent)
[ { "change_type": "MODIFY", "diff": "-import { IID } from \"@thi.ng/api/api\";\n+import { IID, IDeref } from \"@thi.ng/api/api\";\nimport { Transducer } from \"@thi.ng/transducers/api\";\nimport { Subscription } from \"./subscription\";\n@@ -21,7 +21,10 @@ export interface ISubscriber<T> {\n[id: string]: any;\n}\n-export interface ISubscribable<T> extends IID<string> {\n+export interface ISubscribable<T> extends\n+ IDeref<T>,\n+ IID<string> {\n+\nsubscribe<C>(xform: Transducer<T, C>, id?: string): Subscription<T, C>;\nsubscribe<C>(sub: Partial<ISubscriber<T>>, xform: Transducer<T, C>, id?: string): Subscription<T, C>;\nsubscribe(sub: Partial<ISubscriber<T>>, id?: string): Subscription<T, T>;\n", "new_path": "packages/rstream/src/api.ts", "old_path": "packages/rstream/src/api.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(rstream): update ISubscribable (add IDeref parent)
1
refactor
rstream
679,913
26.04.2018 14:42:15
-3,600
d057d95465e91be715674a2ff0c9416e440df903
feat(rstream-dot): add option to include stream values in diag add DotOpts.values option update walk() to accept optional DotOpts arg update dotNode()
[ { "change_type": "MODIFY", "diff": "@@ -16,6 +16,7 @@ export interface Node {\nlabel: string;\ntype: string;\nxform: boolean;\n+ body: string;\n}\nexport interface WalkState {\n@@ -25,6 +26,7 @@ export interface WalkState {\n}\nexport interface DotOpts {\n+ values: boolean;\ndir: string;\nfont: string;\nfontsize: string;\n", "new_path": "packages/rstream-dot/src/api.ts", "old_path": "packages/rstream-dot/src/api.ts" }, { "change_type": "MODIFY", "diff": "@@ -17,18 +17,21 @@ const getNodeType = (sub: ISubscribable<any>) => {\n}\nconst dotNode = (s: Node, opts: DotOpts) => {\n- let res = `s${s.id}[label=`;\n+ let res = `s${s.id}[label=\"`;\nif (s.type) {\n- res += `\"${s.label}\\\\n(${s.type})\"`;\n+ res += `${s.label}\\\\n(${s.type})`;\n} else {\n- res += `\"${s.label}\"`;\n+ res += `${s.label}`;\n}\n- res += \", color=\";\n+ if (s.body !== undefined) {\n+ res += `\\\\n${s.body.replace(/\"/g, `'`).replace(/\\n/g, \"\\\\n\")}`;\n+ }\n+ res += `\", color=\"`;\nres += (s.type && opts.color[s.type.toLowerCase()]) ||\n(s.label === \"<noid>\" ?\nopts.color.noid :\nopts.color.default);\n- return res + \"];\"\n+ return res + `\"];`\n};\nconst dotEdge = (a: Node, b: Node, _: DotOpts) => {\n@@ -39,12 +42,19 @@ const dotEdge = (a: Node, b: Node, _: DotOpts) => {\nreturn res + \";\"\n};\n-export const walk = (subs: ISubscribable<any>[], state?: WalkState) => {\n+export const walk = (subs: ISubscribable<any>[], opts?: Partial<DotOpts>, state?: WalkState) => {\n+ opts || (opts = {});\nstate || (state = { id: 0, subs: new Map(), rels: [] });\nfor (let sub of subs) {\nif (state.subs.get(sub)) return state;\nconst id = state.id;\n- const desc: Node = { id, label: sub.id || \"<noid>\", type: getNodeType(sub), xform: !!(<any>sub).xform };\n+ const desc: Node = {\n+ id,\n+ label: sub.id || \"<noid>\",\n+ type: getNodeType(sub),\n+ xform: !!(<any>sub).xform,\n+ body: opts.values && sub.deref ? JSON.stringify(sub.deref()) : undefined\n+ };\nstate.subs.set(sub, desc);\nstate.id++;\nconst children = (<any>sub).subs ||\n@@ -52,7 +62,7 @@ export const walk = (subs: ISubscribable<any>[], state?: WalkState) => {\n[(<any>sub).__owner] :\nundefined);\nif (children) {\n- walk(children, state);\n+ walk(children, opts, state);\nfor (let c of children) {\nstate.rels.push([desc, state.subs.get(c)]);\n}\n", "new_path": "packages/rstream-dot/src/index.ts", "old_path": "packages/rstream-dot/src/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(rstream-dot): add option to include stream values in diag - add DotOpts.values option - update walk() to accept optional DotOpts arg - update dotNode()
1
feat
rstream-dot
791,723
26.04.2018 15:02:56
25,200
55a9a69364b69fdb3091960a16b1253510752444
tests: bump bundlesize threshold
[ { "change_type": "MODIFY", "diff": "\"bundlesize\": [\n{\n\"path\": \"./lighthouse-extension/dist/scripts/lighthouse-background.js\",\n- \"threshold\": \"400 Kb\"\n+ \"threshold\": \"426 Kb\"\n},\n{\n\"path\": \"./lighthouse-viewer/dist/src/viewer.js\",\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
tests: bump bundlesize threshold (#5050)
1
tests
null
679,913
26.04.2018 15:29:44
-3,600
a865f62befe3819208603dadd59f602db204633f
feat(checks): add date, map, nan, set checks
[ { "change_type": "MODIFY", "diff": "@@ -13,6 +13,7 @@ export * from \"./is-arraylike\";\nexport * from \"./is-blob\";\nexport * from \"./is-boolean\";\nexport * from \"./is-chrome\";\n+export * from \"./is-date\";\nexport * from \"./is-even\";\nexport * from \"./is-false\";\nexport * from \"./is-file\";\n@@ -22,7 +23,9 @@ export * from \"./is-ie\";\nexport * from \"./is-in-range\";\nexport * from \"./is-int32\";\nexport * from \"./is-iterable\";\n+export * from \"./is-map\";\nexport * from \"./is-mobile\";\n+export * from \"./is-nan\";\nexport * from \"./is-negative\";\nexport * from \"./is-node\";\nexport * from \"./is-null\";\n@@ -35,6 +38,7 @@ export * from \"./is-promise\";\nexport * from \"./is-promiselike\";\nexport * from \"./is-regexp\";\nexport * from \"./is-safari\";\n+export * from \"./is-set\";\nexport * from \"./is-string\";\nexport * from \"./is-symbol\";\nexport * from \"./is-transferable\";\n", "new_path": "packages/checks/src/index.ts", "old_path": "packages/checks/src/index.ts" }, { "change_type": "ADD", "diff": "+export function isDate(x: any): x is Date {\n+ return x instanceof Date;\n+}\n", "new_path": "packages/checks/src/is-date.ts", "old_path": null }, { "change_type": "ADD", "diff": "+export function isMap(x: any): x is Set<any> {\n+ return x instanceof Map;\n+}\n", "new_path": "packages/checks/src/is-map.ts", "old_path": null }, { "change_type": "ADD", "diff": "+export function isNaN(x: any) {\n+ return x !== x;\n+}\n", "new_path": "packages/checks/src/is-nan.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "*\n* @param x\n*/\n-export function isPlainObject(x: any): x is Object {\n+export function isPlainObject(x: any): x is object {\nlet proto;\nreturn Object.prototype.toString.call(x) === \"[object Object]\" &&\n(proto = Object.getPrototypeOf(x), proto === null || proto === Object.getPrototypeOf({}));\n", "new_path": "packages/checks/src/is-plain-object.ts", "old_path": "packages/checks/src/is-plain-object.ts" }, { "change_type": "ADD", "diff": "+export function isSet(x: any): x is Set<any> {\n+ return x instanceof Set;\n+}\n", "new_path": "packages/checks/src/is-set.ts", "old_path": null } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(checks): add date, map, nan, set checks
1
feat
checks
217,922
26.04.2018 15:36:09
-7,200
13c422ac5be1dc7b70fbbab0e43671b7fe2e6a57
chore(simulator): implemented all basic progression actions (all but element brands for now)
[ { "change_type": "MODIFY", "diff": "+import {CraftingAction} from './actions/crafting-action';\n+\nexport interface ActionResult {\n+ // Action used\n+ action: CraftingAction;\n+ // Did the success hit?\nsuccess: boolean;\n// Amount of progression added to the craft\naddedProgression: number;\n", "new_path": "src/app/pages/simulator/model/action-result.ts", "old_path": "src/app/pages/simulator/model/action-result.ts" }, { "change_type": "MODIFY", "diff": "@@ -13,7 +13,7 @@ export class MakersMark extends BuffAction {\n}\nprotected getDuration(simulation: Simulation): number {\n- return Math.round(simulation.recipe.progress / 200);\n+ return Math.round(simulation.recipe.progress / 100);\n}\ngetIds(): number[] {\n", "new_path": "src/app/pages/simulator/model/actions/buff/makers-mark.ts", "old_path": "src/app/pages/simulator/model/actions/buff/makers-mark.ts" }, { "change_type": "MODIFY", "diff": "import {Simulation} from '../../simulation/simulation';\nimport {Buff} from '../buff.enum';\n+/**\n+ * This is the parent class of all actions in the simulator.\n+ */\nexport abstract class CraftingAction {\nabstract getIds(): number[];\n@@ -28,4 +31,8 @@ export abstract class CraftingAction {\nabstract getDurabilityCost(simulationState: Simulation): number;\nabstract execute(simulation: Simulation): void;\n+\n+ public getName(): string {\n+ return this.constructor.name;\n+ }\n}\n", "new_path": "src/app/pages/simulator/model/actions/crafting-action.ts", "old_path": "src/app/pages/simulator/model/actions/crafting-action.ts" }, { "change_type": "ADD", "diff": "+import {ProgressAction} from '../progress-action';\n+import {Simulation} from '../../../simulation/simulation';\n+\n+export class CarefulSynthesisII extends ProgressAction {\n+\n+ canBeUsed(simulationState: Simulation): boolean {\n+ return true;\n+ }\n+\n+ getBaseCPCost(simulationState: Simulation): number {\n+ return 0;\n+ }\n+\n+ getBaseDurabilityCost(simulationState: Simulation): number {\n+ return 10;\n+ }\n+\n+ getBaseSuccessRate(simulationState: Simulation): number {\n+ return 100;\n+ }\n+\n+ getIds(): number[] {\n+ return [100069];\n+ }\n+\n+ getPotency(): number {\n+ return 120;\n+ }\n+\n+}\n", "new_path": "src/app/pages/simulator/model/actions/progression/careful-synthesis-II.ts", "old_path": null }, { "change_type": "ADD", "diff": "+import {ProgressAction} from '../progress-action';\n+import {Simulation} from '../../../simulation/simulation';\n+\n+export class CarefulSynthesisIII extends ProgressAction {\n+\n+ canBeUsed(simulationState: Simulation): boolean {\n+ return true;\n+ }\n+\n+ getBaseCPCost(simulationState: Simulation): number {\n+ return 7;\n+ }\n+\n+ getBaseDurabilityCost(simulationState: Simulation): number {\n+ return 10;\n+ }\n+\n+ getBaseSuccessRate(simulationState: Simulation): number {\n+ return 100;\n+ }\n+\n+ getIds(): number[] {\n+ return [100203, 100204, 100205, 100206, 100207, 100208, 100209, 100210];\n+ }\n+\n+ getPotency(): number {\n+ return 150;\n+ }\n+\n+}\n", "new_path": "src/app/pages/simulator/model/actions/progression/careful-synthesis-III.ts", "old_path": null }, { "change_type": "ADD", "diff": "+import {ProgressAction} from '../progress-action';\n+import {Simulation} from '../../../simulation/simulation';\n+\n+export class CarefulSynthesis extends ProgressAction {\n+\n+ canBeUsed(simulationState: Simulation): boolean {\n+ return true;\n+ }\n+\n+ getBaseCPCost(simulationState: Simulation): number {\n+ return 0;\n+ }\n+\n+ getBaseDurabilityCost(simulationState: Simulation): number {\n+ return 10;\n+ }\n+\n+ getBaseSuccessRate(simulationState: Simulation): number {\n+ return 100;\n+ }\n+\n+ getIds(): number[] {\n+ return [100063];\n+ }\n+\n+ getPotency(): number {\n+ return 90;\n+ }\n+\n+}\n", "new_path": "src/app/pages/simulator/model/actions/progression/careful-synthesis.ts", "old_path": null }, { "change_type": "ADD", "diff": "+import {ProgressAction} from '../progress-action';\n+import {Simulation} from '../../../simulation/simulation';\n+\n+export class FocusedSynthesis extends ProgressAction {\n+\n+ canBeUsed(simulationState: Simulation): boolean {\n+ return true;\n+ }\n+\n+ getBaseCPCost(simulationState: Simulation): number {\n+ return 5;\n+ }\n+\n+ getBaseDurabilityCost(simulationState: Simulation): number {\n+ return 10;\n+ }\n+\n+ getBaseSuccessRate(simulationState: Simulation): number {\n+ return simulationState.lastStep.action.getName() === 'Observe' ? 100 : 50;\n+ }\n+\n+ getIds(): number[] {\n+ return [100235, 100236, 100237, 100238, 100239, 100240, 100241, 100242];\n+ }\n+\n+ getPotency(): number {\n+ return 200;\n+ }\n+\n+}\n", "new_path": "src/app/pages/simulator/model/actions/progression/focused-synthesis.ts", "old_path": null }, { "change_type": "ADD", "diff": "+import {ProgressAction} from '../progress-action';\n+import {Simulation} from '../../../simulation/simulation';\n+\n+export class RapidSynthesisII extends ProgressAction {\n+\n+ canBeUsed(simulationState: Simulation): boolean {\n+ return true;\n+ }\n+\n+ getBaseCPCost(simulationState: Simulation): number {\n+ return 12;\n+ }\n+\n+ getBaseDurabilityCost(simulationState: Simulation): number {\n+ return 10;\n+ }\n+\n+ getBaseSuccessRate(simulationState: Simulation): number {\n+ return 60;\n+ }\n+\n+ getIds(): number[] {\n+ return [100211, 100212, 100213, 100214, 100215, 100216, 100217, 100218];\n+ }\n+\n+ getPotency(): number {\n+ return 300;\n+ }\n+\n+}\n", "new_path": "src/app/pages/simulator/model/actions/progression/rapid-synthesis-ii.ts", "old_path": null }, { "change_type": "ADD", "diff": "+import {ProgressAction} from '../progress-action';\n+import {Simulation} from '../../../simulation/simulation';\n+\n+export class RapidSynthesis extends ProgressAction {\n+\n+ canBeUsed(simulationState: Simulation): boolean {\n+ return true;\n+ }\n+\n+ getBaseCPCost(simulationState: Simulation): number {\n+ return 0;\n+ }\n+\n+ getBaseDurabilityCost(simulationState: Simulation): number {\n+ return 10;\n+ }\n+\n+ getBaseSuccessRate(simulationState: Simulation): number {\n+ return 50;\n+ }\n+\n+ getIds(): number[] {\n+ return [100033];\n+ }\n+\n+ getPotency(): number {\n+ return 250;\n+ }\n+\n+}\n", "new_path": "src/app/pages/simulator/model/actions/progression/rapid-synthesis.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -14,6 +14,8 @@ import {WasteNotII} from './model/actions/buff/waste-not-ii';\nimport {Ingenuity} from './model/actions/buff/ingenuity';\nimport {IngenuityII} from './model/actions/buff/ingenuity-ii';\nimport {InitialPreparations} from './model/actions/buff/initial-preparations';\n+import {MakersMark} from './model/actions/buff/makers-mark';\n+import {FlawlessSynthesis} from './model/actions/progression/flawless-synthesis';\nconst infusionOfMind_Recipe: Craft = {\n'id': '3595',\n@@ -214,6 +216,27 @@ describe('Craft simulator tests', () => {\nexpect(results.filter(res => res).length).toBeLessThan(2100);\n});\n});\n+\n+ describe('Maker\\'s Mark', () => {\n+ it('should compute correct stacks amount', () => {\n+ const simulation = new Simulation(infusionOfMind_Recipe,\n+ [new MakersMark()],\n+ alc_70_350_stats);\n+ simulation.run();\n+ expect(simulation.getBuff(Buff.MAKERS_MARK).duration).toBe(29);\n+ });\n+\n+ it('should affect Flawless Synthesis as it has to', () => {\n+ const simulation = new Simulation(infusionOfMind_Recipe,\n+ [new MakersMark(), new SteadyHand(), new FlawlessSynthesis()],\n+ alc_70_350_stats);\n+ simulation.run();\n+ expect(simulation.getBuff(Buff.MAKERS_MARK).duration).toBe(27);\n+ expect(simulation.progression).toBe(40);\n+ expect(simulation.availableCP).toBe(447);\n+ expect(simulation.solidity).toBe(80);\n+ });\n+ });\n});\ndescribe('Other tests', () => {\n", "new_path": "src/app/pages/simulator/simulation.spec.ts", "old_path": "src/app/pages/simulator/simulation.spec.ts" }, { "change_type": "MODIFY", "diff": "@@ -68,6 +68,7 @@ export class Simulation {\nthis.availableCP -= action.getCPCost(this);\n// Push the result to the result array\nthis.steps.push({\n+ action: action,\nsuccess: action.getSuccessRate(this) >= probabilityRoll,\naddedQuality: this.quality - qualityBefore,\naddedProgression: this.progression - progressionBefore,\n@@ -82,6 +83,7 @@ export class Simulation {\n} else {\n// If we can't, add the step to the result but skip it.\nthis.steps.push({\n+ action: action,\nsuccess: null,\naddedQuality: 0,\naddedProgression: 0,\n@@ -108,6 +110,10 @@ export class Simulation {\nthis.buffs = this.buffs.filter(row => row.buff !== buff);\n}\n+ public get lastStep(): ActionResult {\n+ return this.steps[this.steps.length - 1];\n+ }\n+\nprivate tickBuffs(): void {\nfor (const effectiveBuff of this.buffs) {\n// We are checking the appliedStep because ticks only happen at the beginning of the second turn after the application,\n", "new_path": "src/app/pages/simulator/simulation/simulation.ts", "old_path": "src/app/pages/simulator/simulation/simulation.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore(simulator): implemented all basic progression actions (all but element brands for now)
1
chore
simulator
679,913
26.04.2018 15:36:42
-3,600
2ac8bff3d1afe21e3536d03abb1f3550dc190864
feat(api): support more types in equiv(), add tests add equivSetLike() for ES6 Set/Map add checks for Date, RegExp & NaN
[ { "change_type": "MODIFY", "diff": "import { isArrayLike } from \"@thi.ng/checks/is-arraylike\";\n+import { isDate } from \"@thi.ng/checks/is-date\";\n+import { isMap } from \"@thi.ng/checks/is-map\";\nimport { isPlainObject } from \"@thi.ng/checks/is-plain-object\";\n+import { isRegExp } from \"@thi.ng/checks/is-regexp\";\n+import { isSet } from \"@thi.ng/checks/is-set\";\nexport function equiv(a, b): boolean {\nif (a === b) {\n@@ -28,7 +32,17 @@ export function equiv(a, b): boolean {\nif (isArrayLike(a) && isArrayLike(b)) {\nreturn equivArrayLike(a, b);\n}\n- return false;\n+ if ((isSet(a) && isSet(b)) || (isMap(a) && isMap(b))) {\n+ return equivSetLike(a, b);\n+ }\n+ if (isDate(a) && isDate(b)) {\n+ return a.getTime() === b.getTime();\n+ }\n+ if (isRegExp(a) && isRegExp(b)) {\n+ return a.toString() === b.toString();\n+ }\n+ // NaN\n+ return (a !== a && b !== b);\n}\nfunction equivArrayLike(a: ArrayLike<any>, b: ArrayLike<any>) {\n@@ -39,6 +53,11 @@ function equivArrayLike(a: ArrayLike<any>, b: ArrayLike<any>) {\nreturn l < 0;\n}\n+function equivSetLike(a: Set<any>, b: Set<any>) {\n+ if (a.size !== b.size) return false;\n+ return equiv([...a].sort(), [...b].sort());\n+}\n+\nfunction equivObject(a, b) {\nconst keys = new Set(Object.keys(a).concat(Object.keys(b)));\nfor (let k of keys) {\n", "new_path": "packages/api/src/equiv.ts", "old_path": "packages/api/src/equiv.ts" }, { "change_type": "MODIFY", "diff": "@@ -89,4 +89,30 @@ describe(\"equiv\", () => {\nassert(!equiv(new A(1), 2));\n});\n+ it(\"set\", () => {\n+ const a = new Set([1, 2, 3]);\n+ assert(equiv(a, a));\n+ assert(equiv(a, new Set([3, 2, 1])));\n+ assert(equiv(new Set([{ a: 1 }, new Set([{ b: 2 }, [3]])]), new Set([new Set([[3], { b: 2 }]), { a: 1 }])));\n+ assert(!equiv(a, new Set([3, 2, 0])));\n+ assert(!equiv(a, [3, 2, 0]));\n+ assert(!equiv(a, new Map([[3, 3], [2, 2], [1, 1]])));\n+ assert(!equiv(a, null));\n+ assert(!equiv(null, a));\n+ });\n+\n+ it(\"date\", () => {\n+ const a = new Date(123456);\n+ assert(equiv(a, a));\n+ assert(equiv(a, new Date(123456)));\n+ assert(!equiv(a, new Date(123)));\n+ });\n+\n+ it(\"regexp\", () => {\n+ const a = /(\\w+)/g;\n+ assert(equiv(a, a));\n+ assert(equiv(a, /(\\w+)/g));\n+ assert(!equiv(a, /(\\w+)/));\n+ assert(!equiv(a, /(\\w*)/g));\n+ });\n});\n", "new_path": "packages/api/test/index.ts", "old_path": "packages/api/test/index.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(api): support more types in equiv(), add tests - add equivSetLike() for ES6 Set/Map - add checks for Date, RegExp & NaN
1
feat
api
679,913
26.04.2018 15:54:09
-3,600
d093a5c825ba109f7f4889be9ad3fca235259f71
feat(rstream-query): add query spec types, addQueryFromSpec(), dedupe xforms
[ { "change_type": "MODIFY", "diff": "import { IObjectOf } from \"@thi.ng/api/api\";\nimport { ISubscribable } from \"@thi.ng/rstream/api\";\n+export let DEBUG = false;\n+\nexport type Pattern = [any, any, any];\nexport type PathPattern = [any, any[], any];\n@@ -11,13 +13,38 @@ export type Triples = Set<Pattern>;\nexport type TripleIds = Set<number>;\n-export type Solutions = Set<IObjectOf<any>>;\n+export type Solution = IObjectOf<any>;\n+\n+export type Solutions = Set<Solution>;\nexport type QuerySolution = ISubscribable<Solutions>;\n+export type BindFn = (s: Solution) => any;\n+\nexport interface Edit {\nindex: Set<number>;\nkey: any;\n}\n-export let DEBUG = false;\n+export interface QuerySpec {\n+ q: SubQuerySpec[];\n+ select?: string[];\n+ order?: string;\n+ bind?: IObjectOf<BindFn>;\n+ limit?: number;\n+}\n+\n+export type SubQuerySpec = WhereQuerySpec | PathQuerySpec;\n+\n+export interface WhereQuerySpec {\n+ where: Pattern[];\n+}\n+\n+export interface PathQuerySpec {\n+ path: PathPattern;\n+}\n+\n+export interface JoinOpts {\n+ limit: number;\n+ select: string[];\n+}\n\\ No newline at end of file\n", "new_path": "packages/rstream-query/src/api.ts", "old_path": "packages/rstream-query/src/api.ts" }, { "change_type": "MODIFY", "diff": "@@ -15,10 +15,11 @@ import { keySelector } from \"@thi.ng/transducers/func/key-selector\";\nimport { comp } from \"@thi.ng/transducers/func/comp\";\nimport { compR } from \"@thi.ng/transducers/func/compr\";\nimport { assocObj } from \"@thi.ng/transducers/rfn/assoc-obj\";\n+import { dedupe } from \"@thi.ng/transducers/xform/dedupe\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\nimport { mapIndexed } from \"@thi.ng/transducers/xform/map-indexed\";\n-import { DEBUG, Edit, Triple, TripleIds, Pattern, Solutions, Triples, PathPattern, QuerySolution } from \"./api\";\n+import { DEBUG, Edit, Triple, TripleIds, Pattern, Solutions, Triples, PathPattern, QuerySolution, QuerySpec, SubQuerySpec, WhereQuerySpec, PathQuerySpec, BindFn } from \"./api\";\nimport { resolvePathPattern, patternVars } from \"./pattern\";\nimport { isQVar, qvarResolver } from \"./qvar\";\n@@ -180,7 +181,7 @@ export class TripleStore implements\nresults = sync<TripleIds, TripleIds>({\nid,\nsrc: { s: qs, p: qp, o: qo },\n- xform: map(({ s, p, o }) => intersection(intersection(s, p), o)),\n+ xform: comp(map(({ s, p, o }) => intersection(intersection(s, p), o)), dedupe(equiv)),\nreset: true,\n});\nthis.queries.set(key, <ISubscribable<TripleIds>>results);\n@@ -236,10 +237,18 @@ export class TripleStore implements\n}\nreturn res;\n}),\n+ dedupe(equiv),\nid\n);\n}\n+ addParamQueries(patterns: Iterable<Pattern>) {\n+ return iterator(\n+ map<Pattern, QuerySolution>((q) => this.addParamQuery(q)),\n+ patterns\n+ );\n+ }\n+\n/**\n* Converts the given path pattern into a number of sub-queries and\n* return a rstream subscription of re-joined result solutions. If\n@@ -252,10 +261,7 @@ export class TripleStore implements\n*/\naddPathQuery(path: PathPattern, len = path[1].length, id?: string): QuerySolution {\nreturn this.addMultiJoin(\n- iterator(\n- map<Pattern, QuerySolution>((q) => this.addParamQuery(q)),\n- resolvePathPattern(path, len)[0]\n- ),\n+ this.addParamQueries(resolvePathPattern(path, len)[0]),\npatternVars(path),\nid\n);\n@@ -274,25 +280,60 @@ export class TripleStore implements\nreturn sync<Solutions, Solutions>({\nid,\nsrc: { a, b },\n- xform: map(({ a, b }) => join(a, b))\n+ xform: comp(map(({ a, b }) => join(a, b)), dedupe(equiv)),\n+ reset: false,\n});\n}\naddMultiJoin(queries: Iterable<QuerySolution>, keepVars?: Iterable<string>, id?: string): QuerySolution {\nconst src = transduce(\n- mapIndexed<QuerySolution, [string, QuerySolution]>(\n- (i, q) => [String(i), q]\n- ),\n+ mapIndexed<QuerySolution, [string, QuerySolution]>((i, q) => [String(i), q]),\nassocObj(),\nqueries\n);\n- let xform = joinSolutions(Object.keys(src).length);\n- keepVars && (xform = comp(xform, filterSolutions(keepVars)));\n- return sync({ id, src, xform });\n+ let xforms: Transducer<any, any>[] = [joinSolutions(Object.keys(src).length), dedupe(equiv)];\n+ keepVars && (xforms.push(filterSolutions(keepVars)));\n+ return sync({ id, src, xform: <Transducer<any, any>>comp.apply(null, xforms), reset: false });\n+ }\n+\n+ /**\n+ * Compiles given query spec into a number of sub-queries and result\n+ * transformations. Returns rstream subscription of final result\n+ * sets. See `QuerySpec` docs for further details.\n+ *\n+ * @param spec\n+ */\n+ addQueryFromSpec(spec: QuerySpec): QuerySolution {\n+ let query: QuerySolution;\n+ let curr: QuerySolution;\n+ for (let q of spec.q) {\n+ if (isWhereQuery(q)) {\n+ curr = this.addMultiJoin(this.addParamQueries(q.where));\n+ query && (curr = this.addJoin(query, curr));\n+ } else if (isPathQuery(q)) {\n+ curr = this.addPathQuery(q.path);\n+ query && (curr = this.addJoin(query, curr));\n+ }\n+ query = curr;\n+ }\n+ let xforms: Transducer<any, any>[] = [];\n+ if (spec.limit) {\n+ xforms.push(limitSolutions(spec.limit));\n+ }\n+ if (spec.bind) {\n+ xforms.push(bindVars(spec.bind));\n+ }\n+ if (spec.select) {\n+ xforms.push(filterSolutions(spec.select));\n+ }\n+ if (xforms.length) {\n+ query = <ISubscribable<any>>query.subscribe(comp.apply(null, xforms));\n+ }\n+ return query;\n}\ntoDot(opts?: Partial<DotOpts>) {\n- return toDot(walk([this.streamS, this.streamP, this.streamO, this.streamAll]), opts);\n+ return toDot(walk([this.streamS, this.streamP, this.streamO, this.streamAll], opts), opts);\n}\nprotected nextID() {\n@@ -336,7 +377,6 @@ export class TripleStore implements\n}\n}\n-\nconst submit = (index: Map<any, TripleIds>, stream: Subscription<Edit, TripleIds>, key: any) => {\nif (key != null) {\nconst ids = index.get(key);\n@@ -385,3 +425,30 @@ const filterSolutions = (qvars: Iterable<string>) => {\nreturn res;\n});\n};\n+\n+const limitSolutions = (n: number) =>\n+ map((sol: Solutions) => {\n+ if (sol.size <= n) {\n+ return sol;\n+ }\n+ const res: Solutions = new Set();\n+ let m = n;\n+ for (let s of sol) {\n+ res.add(s);\n+ if (--m <= 0) break;\n+ }\n+ return res;\n+ });\n+\n+const bindVars = (bindings: IObjectOf<BindFn>) =>\n+ map((sol: Solutions) => {\n+ for (let s of sol) {\n+ for (let b in bindings) {\n+ s[b] = bindings[b](s);\n+ }\n+ }\n+ return sol;\n+ });\n+\n+const isWhereQuery = (q: SubQuerySpec): q is WhereQuerySpec => !!(<any>q).where;\n+const isPathQuery = (q: SubQuerySpec): q is PathQuerySpec => !!(<any>q).path;\n", "new_path": "packages/rstream-query/src/store.ts", "old_path": "packages/rstream-query/src/store.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(rstream-query): add query spec types, addQueryFromSpec(), dedupe xforms
1
feat
rstream-query
791,690
26.04.2018 15:54:40
25,200
03c275394e92e57ce4629f07d0579028d4211f2a
core(scoring): tweak scoring thresholds based on HTTPArchive data
[ { "change_type": "MODIFY", "diff": "@@ -37,9 +37,11 @@ class CacheHeaders extends Audit {\n*/\nstatic get defaultOptions() {\nreturn {\n- // see https://www.desmos.com/calculator/zokzso8umm\n+ // 50th and 75th percentiles HTTPArchive -> 50 and 75\n+ // https://bigquery.cloud.google.com/table/httparchive:lighthouse.2018_04_01_mobile?pli=1\n+ // see https://www.desmos.com/calculator/8meohdnjbl\nscorePODR: 4 * 1024,\n- scoreMedian: 768 * 1024,\n+ scoreMedian: 128 * 1024,\n};\n}\n", "new_path": "lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js", "old_path": "lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js" }, { "change_type": "MODIFY", "diff": "@@ -35,9 +35,11 @@ class ConsistentlyInteractiveMetric extends Audit {\n*/\nstatic get defaultOptions() {\nreturn {\n- // see https://www.desmos.com/calculator/uti67afozh\n- scorePODR: 1700,\n- scoreMedian: 10000,\n+ // 75th and 90th percentiles HTTPArchive -> 50 and 75\n+ // https://bigquery.cloud.google.com/table/httparchive:lighthouse.2018_04_01_mobile?pli=1\n+ // see https://www.desmos.com/calculator/dohd3b0sbr\n+ scorePODR: 1200,\n+ scoreMedian: 7300,\n};\n}\n", "new_path": "lighthouse-core/audits/consistently-interactive.js", "old_path": "lighthouse-core/audits/consistently-interactive.js" }, { "change_type": "MODIFY", "diff": "@@ -48,9 +48,11 @@ class DOMSize extends Audit {\n*/\nstatic get defaultOptions() {\nreturn {\n- // see https://www.desmos.com/calculator/9cyxpm5qgp\n- scorePODR: 2400,\n- scoreMedian: 3000,\n+ // 25th and 50th percentiles HTTPArchive -> 50 and 75\n+ // https://bigquery.cloud.google.com/table/httparchive:lighthouse.2018_04_01_mobile?pli=1\n+ // see https://www.desmos.com/calculator/vqot3wci4g\n+ scorePODR: 700,\n+ scoreMedian: 1400,\n};\n}\n", "new_path": "lighthouse-core/audits/dobetterweb/dom-size.js", "old_path": "lighthouse-core/audits/dobetterweb/dom-size.js" }, { "change_type": "MODIFY", "diff": "@@ -28,8 +28,10 @@ class FirstContentfulPaint extends Audit {\n*/\nstatic get defaultOptions() {\nreturn {\n- // see https://www.desmos.com/calculator/joz3pqttdq\n- scorePODR: 1600,\n+ // 75th and 90th percentiles HTTPArchive -> 50 and 75\n+ // https://bigquery.cloud.google.com/table/httparchive:lighthouse.2018_04_01_mobile?pli=1\n+ // see https://www.desmos.com/calculator/trv2goqvsd\n+ scorePODR: 1400,\nscoreMedian: 4000,\n};\n}\n", "new_path": "lighthouse-core/audits/first-contentful-paint.js", "old_path": "lighthouse-core/audits/first-contentful-paint.js" }, { "change_type": "MODIFY", "diff": "@@ -29,9 +29,11 @@ class FirstCPUIdle extends Audit {\n*/\nstatic get defaultOptions() {\nreturn {\n- // see https://www.desmos.com/calculator/uti67afozh\n- scorePODR: 1700,\n- scoreMedian: 10000,\n+ // 75th and 90th percentiles HTTPArchive -> 50 and 75\n+ // https://bigquery.cloud.google.com/table/httparchive:lighthouse.2018_04_01_mobile?pli=1\n+ // see https://www.desmos.com/calculator/cwuavnclzj\n+ scorePODR: 1400,\n+ scoreMedian: 6500,\n};\n}\n", "new_path": "lighthouse-core/audits/first-cpu-idle.js", "old_path": "lighthouse-core/audits/first-cpu-idle.js" }, { "change_type": "MODIFY", "diff": "@@ -28,8 +28,10 @@ class FirstMeaningfulPaint extends Audit {\n*/\nstatic get defaultOptions() {\nreturn {\n- // see https://www.desmos.com/calculator/joz3pqttdq\n- scorePODR: 1600,\n+ // 75th and 90th percentiles HTTPArchive -> 50 and 75\n+ // https://bigquery.cloud.google.com/table/httparchive:lighthouse.2018_04_01_mobile?pli=1\n+ // see https://www.desmos.com/calculator/trv2goqvsd\n+ scorePODR: 1400,\nscoreMedian: 4000,\n};\n}\n", "new_path": "lighthouse-core/audits/first-meaningful-paint.js", "old_path": "lighthouse-core/audits/first-meaningful-paint.js" }, { "change_type": "MODIFY", "diff": "@@ -28,9 +28,11 @@ class SpeedIndex extends Audit {\n*/\nstatic get defaultOptions() {\nreturn {\n- // see https://www.desmos.com/calculator/mdgjzchijg\n- scorePODR: 1250,\n- scoreMedian: 5500,\n+ // 75th and 90th percentiles HTTPArchive -> 50 and 75\n+ // https://bigquery.cloud.google.com/table/httparchive:lighthouse.2018_04_01_mobile?pli=1\n+ // see https://www.desmos.com/calculator/y1bg8ij7ti\n+ scorePODR: 1700,\n+ scoreMedian: 5800,\n};\n}\n", "new_path": "lighthouse-core/audits/speed-index.js", "old_path": "lighthouse-core/audits/speed-index.js" }, { "change_type": "MODIFY", "diff": "@@ -166,7 +166,7 @@ describe('Cache headers audit', () => {\nit('ignores potentially uncacheable records', () => {\nnetworkRecords = [\nnetworkRecord({statusCode: 500}),\n- networkRecord({url: 'https://example.com/dynamic.js?userId=crazy'}),\n+ networkRecord({url: 'https://example.com/dynamic.js?userId=crazy', transferSize: 10}),\nnetworkRecord({url: 'data:image/jpeg;base64,what'}),\nnetworkRecord({resourceType: WebInspector.resourceTypes.XHR}),\n];\n", "new_path": "lighthouse-core/test/audits/byte-efficiency/uses-long-cache-ttl-test.js", "old_path": "lighthouse-core/test/audits/byte-efficiency/uses-long-cache-ttl-test.js" }, { "change_type": "MODIFY", "diff": "@@ -31,7 +31,7 @@ describe('Performance: consistently-interactive audit', () => {\nconst settings = {throttlingMethod: 'provided'};\nreturn ConsistentlyInteractive.audit(artifacts, {options, settings}).then(output => {\n- assert.equal(output.score, 0.99);\n+ assert.equal(output.score, 0.97);\nassert.equal(Math.round(output.rawValue), 1582);\nassert.equal(output.displayValue, '1,580\\xa0ms');\n});\n@@ -49,7 +49,7 @@ describe('Performance: consistently-interactive audit', () => {\nconst settings = {throttlingMethod: 'provided'};\nreturn ConsistentlyInteractive.audit(artifacts, {options, settings}).then(output => {\n- assert.equal(output.score, 0.95);\n+ assert.equal(output.score, 0.89);\nassert.equal(Math.round(output.rawValue), 2712);\nassert.equal(output.displayValue, '2,710\\xa0ms');\n});\n", "new_path": "lighthouse-core/test/audits/consistently-interactive-test.js", "old_path": "lighthouse-core/test/audits/consistently-interactive-test.js" }, { "change_type": "MODIFY", "diff": "@@ -21,9 +21,9 @@ describe('Num DOM nodes audit', () => {\n},\n};\n- it('calculates score hitting top of distribution', () => {\n+ it('calculates score hitting mid distribution', () => {\nconst auditResult = DOMSize.audit(artifact, {options});\n- assert.equal(auditResult.score, 1);\n+ assert.equal(auditResult.score, 0.43);\nassert.equal(auditResult.rawValue, numNodes);\nassert.equal(auditResult.displayValue, `${numNodes.toLocaleString()} nodes`);\nassert.equal(auditResult.details.items[0].totalNodes, numNodes.toLocaleString());\n@@ -31,9 +31,9 @@ describe('Num DOM nodes audit', () => {\nassert.equal(auditResult.details.items[0].width, '2');\n});\n- it('calculates score hitting mid distribution', () => {\n- artifact.DOMStats.totalDOMNodes = 3100;\n- assert.equal(DOMSize.audit(artifact, {options}).score, 0.43);\n+ it('calculates score hitting top distribution', () => {\n+ artifact.DOMStats.totalDOMNodes = 400;\n+ assert.equal(DOMSize.audit(artifact, {options}).score, 1);\n});\nit('calculates score hitting bottom of distribution', () => {\n", "new_path": "lighthouse-core/test/audits/dobetterweb/dom-size-test.js", "old_path": "lighthouse-core/test/audits/dobetterweb/dom-size-test.js" }, { "change_type": "MODIFY", "diff": "@@ -38,7 +38,7 @@ describe('Performance: first-meaningful-paint audit', () => {\nconst context = {options, settings: {throttlingMethod: 'simulate'}};\nconst fmpResult = await FMPAudit.audit(artifacts, context);\n- assert.equal(fmpResult.score, 0.75);\n+ assert.equal(fmpResult.score, 0.73);\nassert.equal(fmpResult.displayValue, '2,850\\xa0ms');\nassert.equal(Math.round(fmpResult.rawValue), 2851);\n});\n", "new_path": "lighthouse-core/test/audits/first-meaningful-paint-test.js", "old_path": "lighthouse-core/test/audits/first-meaningful-paint-test.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
core(scoring): tweak scoring thresholds based on HTTPArchive data (#5022)
1
core
scoring
730,414
26.04.2018 16:11:37
14,400
c7f78c033541f07218c33a79af16b93382ee7731
chore(npm publish): remove bash-specific conditional
[ { "change_type": "MODIFY", "diff": "@@ -198,7 +198,7 @@ ansiColor('xterm') {\n]) {\ntry {\n// Back up .npmrc\n- sh '[[ -f $HOME/.npmrc ]] && mv $HOME/.npmrc $HOME/.npmrc.bak'\n+ sh '[ -f $HOME/.npmrc ] && mv $HOME/.npmrc $HOME/.npmrc.bak'\n// Publish\nsh 'echo \\'//registry.npmjs.org/:_authToken=${NPM_TOKEN}\\' > $HOME/.npmrc'\necho ''\n@@ -210,7 +210,7 @@ ansiColor('xterm') {\nnpm run publish:components\n'''\n// Restore .npmrc\n- sh '[[ -f $HOME/.npmrc.bak ]] && mv $HOME/.npmrc.bak $HOME/.npmrc'\n+ sh '[ -f $HOME/.npmrc.bak ] && mv $HOME/.npmrc.bak $HOME/.npmrc'\n}\ncatch (error) {\nwarn(\"failed to publish to npm ${error.toString()}\")\n", "new_path": "Jenkinsfile", "old_path": "Jenkinsfile" } ]
JavaScript
MIT License
webex/react-widgets
chore(npm publish): remove bash-specific conditional
1
chore
npm publish
679,913
26.04.2018 17:56:10
-3,600
75f2af2ee111c148f6ec3a18f4eb83782536fb79
perf(rstream-query): optimize pattern queries, fix bindVars() using only single intersection if 2 null terms in pattern query update bindVars() to create shallow copy (else dedupe fails)
[ { "change_type": "MODIFY", "diff": "@@ -178,12 +178,36 @@ export class TripleStore implements\nconst qs = this.getIndexSelection(this.streamS, s, \"s\");\nconst qp = this.getIndexSelection(this.streamP, p, \"p\");\nconst qo = this.getIndexSelection(this.streamO, o, \"o\");\n+ // optimize cases with 2 null terms (only needs single intersection w/ streamAll)\n+ if (s == null && p == null) {\n+ results = sync<TripleIds, TripleIds>({\n+ id,\n+ src: { a: qo, b: qs },\n+ xform: comp(map(({ a, b }) => intersection(a, b)), dedupe(equiv)),\n+ reset: true,\n+ });\n+ } else if (s == null && o == null) {\n+ results = sync<TripleIds, TripleIds>({\n+ id,\n+ src: { a: qp, b: qs },\n+ xform: comp(map(({ a, b }) => intersection(a, b)), dedupe(equiv)),\n+ reset: true,\n+ });\n+ } else if (p == null && o == null) {\n+ results = sync<TripleIds, TripleIds>({\n+ id,\n+ src: { a: qs, b: qp },\n+ xform: comp(map(({ a, b }) => intersection(a, b)), dedupe(equiv)),\n+ reset: true,\n+ });\n+ } else {\nresults = sync<TripleIds, TripleIds>({\nid,\nsrc: { s: qs, p: qp, o: qo },\nxform: comp(map(({ s, p, o }) => intersection(intersection(s, p), o)), dedupe(equiv)),\nreset: true,\n});\n+ }\nthis.queries.set(key, <ISubscribable<TripleIds>>results);\nsubmit(this.indexS, qs, s);\nsubmit(this.indexP, qp, p);\n@@ -442,12 +466,15 @@ const limitSolutions = (n: number) =>\nconst bindVars = (bindings: IObjectOf<BindFn>) =>\nmap((sol: Solutions) => {\n+ const res: Solutions = new Set();\nfor (let s of sol) {\n+ s = { ...s };\n+ res.add(s);\nfor (let b in bindings) {\ns[b] = bindings[b](s);\n}\n}\n- return sol;\n+ return res;\n});\nconst isWhereQuery = (q: SubQuerySpec): q is WhereQuerySpec => !!(<any>q).where;\n", "new_path": "packages/rstream-query/src/store.ts", "old_path": "packages/rstream-query/src/store.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
perf(rstream-query): optimize pattern queries, fix bindVars() - using only single intersection if 2 null terms in pattern query - update bindVars() to create shallow copy (else dedupe fails)
1
perf
rstream-query
730,412
26.04.2018 17:57:58
0
bcc85f68295aa48f436eabb88906899865acfe64
chore(release): 0.1.281
[ { "change_type": "MODIFY", "diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.1.281\"></a>\n+## [0.1.281](https://github.com/webex/react-ciscospark/compare/v0.1.280...v0.1.281) (2018-04-26)\n+\n+\n+### Features\n+\n+* **widget-space:** add selector for other user ([e84436a](https://github.com/webex/react-ciscospark/commit/e84436a))\n+\n+\n+\n<a name=\"0.1.280\"></a>\n## [0.1.280](https://github.com/webex/react-ciscospark/compare/v0.1.279...v0.1.280) (2018-04-25)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@ciscospark/react-ciscospark\",\n- \"version\": \"0.1.280\",\n+ \"version\": \"0.1.281\",\n\"description\": \"The Cisco Spark for React library allows developers to easily incorporate Spark functionality into an application.\",\n\"scripts\": {\n\"build\": \"./scripts/build/index.js\",\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
MIT License
webex/react-widgets
chore(release): 0.1.281
1
chore
release
679,913
26.04.2018 18:01:01
-3,600
2ab5af5d2c40e2ecc2f215389c0876f64d102b22
build: update/add upload scripts
[ { "change_type": "MODIFY", "diff": "#!/bin/sh\n-readonly modules=\"packages/*\"\n+if [ $# == 1 ]; then\n+ modules=\"packages/$1/\"\n+else\n+ modules=\"packages/*/\"\n+fi\nfor m in $modules; do\nname=$(echo $m | cut -d '/' -f 2)\n", "new_path": "scripts/upload-docs", "old_path": "scripts/upload-docs" }, { "change_type": "ADD", "diff": "+#!/bin/sh\n+\n+if [ $# == 1 ]; then\n+ modules=\"examples/$1/\"\n+else\n+ modules=\"examples/*/\"\n+fi\n+\n+for m in $modules; do\n+ name=$(echo $m | cut -d '/' -f 2)\n+ echo \"processing $name...\"\n+ gzip -f $m/bundle.js\n+ echo \"uploading $m...\"\n+ aws s3 cp $m/bundle.js.gz s3://demo.thi.ng/umbrella/$name/bundle.js --profile toxi-s3 --acl public-read --content-type application/javascript --content-encoding gzip\n+ aws s3 cp $m/index.html s3://demo.thi.ng/umbrella/$name/ --profile toxi-s3 --acl public-read\n+done\n", "new_path": "scripts/upload-examples", "old_path": null } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
build: update/add upload scripts
1
build
null
730,412
26.04.2018 19:56:11
0
17a4821d3c4ea8a62aaba5b85177822771da2651
chore(release): 0.1.282
[ { "change_type": "MODIFY", "diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.1.282\"></a>\n+## [0.1.282](https://github.com/webex/react-ciscospark/compare/v0.1.281...v0.1.282) (2018-04-26)\n+\n+\n+\n<a name=\"0.1.281\"></a>\n## [0.1.281](https://github.com/webex/react-ciscospark/compare/v0.1.280...v0.1.281) (2018-04-26)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@ciscospark/react-ciscospark\",\n- \"version\": \"0.1.281\",\n+ \"version\": \"0.1.282\",\n\"description\": \"The Cisco Spark for React library allows developers to easily incorporate Spark functionality into an application.\",\n\"scripts\": {\n\"build\": \"./scripts/build/index.js\",\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
MIT License
webex/react-widgets
chore(release): 0.1.282
1
chore
release
730,429
26.04.2018 21:17:00
14,400
ab8a0de2adbfb0cc10a978b0ea3399f6d2ee0ce8
feat(samples): added samples section
[ { "change_type": "MODIFY", "diff": "\"serve\": \"npm run start\",\n\"stylelint\": \"stylelint \\\"./packages/node_modules/**/*.css\\\"\",\n\"start\": \"cross-env NODE_ENV=${NODE_ENV:-development} ./scripts/start/index.js\",\n+ \"start:samples\": \"npm run start samples\",\n\"start:package\": \"npm run start package\",\n\"publish\": \"cross-env-shell NODE_ENV='' ./scripts/publish/index.js\",\n\"publish:components\": \"npm run build:components && npm run build:packagejson && npm run publish components\",\n", "new_path": "package.json", "old_path": "package.json" }, { "change_type": "ADD", "diff": "+import React from 'react';\n+\n+function Main() {\n+ return (\n+ <div>\n+ React Samples\n+ </div>\n+ );\n+}\n+\n+export default Main;\n", "new_path": "samples/Main.js", "old_path": null }, { "change_type": "ADD", "diff": "+<!DOCTYPE html>\n+<html>\n+ <head>\n+ <title>Widget Samples</title>\n+ <style>\n+ body {\n+ margin: 0;\n+ }\n+ </style>\n+ </head>\n+ <body>\n+ <div id=\"main\"></div>\n+ </body>\n+</html>\n", "new_path": "samples/index.html", "old_path": null }, { "change_type": "ADD", "diff": "+\n+import React from 'react';\n+import ReactDOM from 'react-dom';\n+\n+import Main from './Main';\n+\n+ReactDOM.render(\n+ <Main />,\n+ document.getElementById('main')\n+);\n", "new_path": "samples/index.js", "old_path": null }, { "change_type": "ADD", "diff": "+const path = require('path');\n+\n+const {execSync} = require('../../utils/exec');\n+\n+module.exports = {\n+ command: 'samples',\n+ desc: 'Start the samples',\n+ builder: {},\n+ handler: () => {\n+ console.info('Starting the samples ...');\n+ const command = `webpack-dev-server --config scripts/webpack/webpack.dev.babel.js --hot --inline --history-api-fallback --context ${path.resolve('./samples')}`;\n+ execSync(command)\n+ .catch((error) => {\n+ console.error(error.stdout);\n+ throw new Error('Error when running start samples', error);\n+ });\n+ }\n+};\n", "new_path": "scripts/start/commands/samples.js", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -59,7 +59,8 @@ export default (options) => {\ntest: /\\.js$/,\ninclude: [\npath.resolve(__dirname, '..', '..', 'packages', 'node_modules'),\n- path.resolve(__dirname, '..', '..', 'src')\n+ path.resolve(__dirname, '..', '..', 'src'),\n+ path.resolve(__dirname, '..', '..', 'samples')\n],\nexclude: [\n'/__fixtures__/',\n", "new_path": "scripts/webpack/webpack.base.babel.js", "old_path": "scripts/webpack/webpack.base.babel.js" } ]
JavaScript
MIT License
webex/react-widgets
feat(samples): added samples section
1
feat
samples
679,913
26.04.2018 22:01:35
-3,600
d36a5eaf524bb8eadc11691ca4f014c5977584e3
refactor(rstream-query): simplify case selection in addPatternQuery()
[ { "change_type": "MODIFY", "diff": "import { IObjectOf } from \"@thi.ng/api/api\";\nimport { equiv } from \"@thi.ng/api/equiv\";\nimport { illegalArgs } from \"@thi.ng/api/error\";\n-import { intersection } from \"@thi.ng/associative/intersection\";\nimport { join } from \"@thi.ng/associative\";\n+import { intersection } from \"@thi.ng/associative/intersection\";\n+import { toDot, walk, DotOpts, IToDot } from \"@thi.ng/rstream-dot\";\nimport { ISubscribable } from \"@thi.ng/rstream/api\";\nimport { Stream } from \"@thi.ng/rstream/stream\";\nimport { sync } from \"@thi.ng/rstream/stream-sync\";\nimport { Subscription } from \"@thi.ng/rstream/subscription\";\n-import { toDot, walk, DotOpts, IToDot } from \"@thi.ng/rstream-dot\";\nimport { Transducer, Reducer } from \"@thi.ng/transducers/api\";\n-import { iterator } from \"@thi.ng/transducers/iterator\";\n-import { transduce } from \"@thi.ng/transducers/transduce\";\n-import { keySelector } from \"@thi.ng/transducers/func/key-selector\";\nimport { comp } from \"@thi.ng/transducers/func/comp\";\nimport { compR } from \"@thi.ng/transducers/func/compr\";\n+import { keySelector } from \"@thi.ng/transducers/func/key-selector\";\n+import { iterator } from \"@thi.ng/transducers/iterator\";\nimport { assocObj } from \"@thi.ng/transducers/rfn/assoc-obj\";\n+import { transduce } from \"@thi.ng/transducers/transduce\";\nimport { dedupe } from \"@thi.ng/transducers/xform/dedupe\";\nimport { map } from \"@thi.ng/transducers/xform/map\";\nimport { mapIndexed } from \"@thi.ng/transducers/xform/map-indexed\";\n@@ -178,36 +178,20 @@ export class TripleStore implements\nconst qs = this.getIndexSelection(this.streamS, s, \"s\");\nconst qp = this.getIndexSelection(this.streamP, p, \"p\");\nconst qo = this.getIndexSelection(this.streamO, o, \"o\");\n+ let src: IObjectOf<Subscription<any, TripleIds>>;\n+ let xform = intersect2;\n// optimize cases with 2 null terms (only needs single intersection w/ streamAll)\nif (s == null && p == null) {\n- results = sync<TripleIds, TripleIds>({\n- id,\n- src: { a: qo, b: qs },\n- xform: comp(map(({ a, b }) => intersection(a, b)), dedupe(equiv)),\n- reset: true,\n- });\n+ src = { a: qo, b: qs };\n} else if (s == null && o == null) {\n- results = sync<TripleIds, TripleIds>({\n- id,\n- src: { a: qp, b: qs },\n- xform: comp(map(({ a, b }) => intersection(a, b)), dedupe(equiv)),\n- reset: true,\n- });\n+ src = { a: qp, b: qs };\n} else if (p == null && o == null) {\n- results = sync<TripleIds, TripleIds>({\n- id,\n- src: { a: qs, b: qp },\n- xform: comp(map(({ a, b }) => intersection(a, b)), dedupe(equiv)),\n- reset: true,\n- });\n+ src = { a: qs, b: qp };\n} else {\n- results = sync<TripleIds, TripleIds>({\n- id,\n- src: { s: qs, p: qp, o: qo },\n- xform: comp(map(({ s, p, o }) => intersection(intersection(s, p), o)), dedupe(equiv)),\n- reset: true,\n- });\n+ src = { s: qs, p: qp, o: qo };\n+ xform = intersect3;\n}\n+ results = sync<TripleIds, TripleIds>({ id, src, xform, reset: true });\nthis.queries.set(key, <ISubscribable<TripleIds>>results);\nsubmit(this.indexS, qs, s);\nsubmit(this.indexP, qp, p);\n@@ -266,13 +250,6 @@ export class TripleStore implements\n);\n}\n- addParamQueries(patterns: Iterable<Pattern>) {\n- return iterator(\n- map<Pattern, QuerySolution>((q) => this.addParamQuery(q)),\n- patterns\n- );\n- }\n-\n/**\n* Converts the given path pattern into a number of sub-queries and\n* return a rstream subscription of re-joined result solutions. If\n@@ -399,6 +376,13 @@ export class TripleStore implements\n}\nreturn sel;\n}\n+\n+ protected addParamQueries(patterns: Iterable<Pattern>) {\n+ return iterator(\n+ map<Pattern, QuerySolution>((q) => this.addParamQuery(q)),\n+ patterns\n+ );\n+ }\n}\nconst submit = (index: Map<any, TripleIds>, stream: Subscription<Edit, TripleIds>, key: any) => {\n@@ -408,6 +392,12 @@ const submit = (index: Map<any, TripleIds>, stream: Subscription<Edit, TripleIds\n}\n};\n+const intersect2: Transducer<IObjectOf<TripleIds>, TripleIds> =\n+ comp(map(({ a, b }) => intersection(a, b)), dedupe(equiv));\n+\n+const intersect3: Transducer<IObjectOf<TripleIds>, TripleIds> =\n+ comp(map(({ s, p, o }) => intersection(intersection(s, p), o)), dedupe(equiv));\n+\nconst indexSel = (key: any): Transducer<Edit, TripleIds> =>\n(rfn: Reducer<any, TripleIds>) => {\nconst r = rfn[2];\n", "new_path": "packages/rstream-query/src/store.ts", "old_path": "packages/rstream-query/src/store.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
refactor(rstream-query): simplify case selection in addPatternQuery()
1
refactor
rstream-query
730,412
26.04.2018 22:17:03
0
f6a0fee19e7fba7412598f0a45a84613376901c9
chore(release): 0.1.283
[ { "change_type": "MODIFY", "diff": "All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n+<a name=\"0.1.283\"></a>\n+## [0.1.283](https://github.com/webex/react-ciscospark/compare/v0.1.282...v0.1.283) (2018-04-26)\n+\n+\n+\n<a name=\"0.1.282\"></a>\n## [0.1.282](https://github.com/webex/react-ciscospark/compare/v0.1.281...v0.1.282) (2018-04-26)\n", "new_path": "CHANGELOG.md", "old_path": "CHANGELOG.md" }, { "change_type": "MODIFY", "diff": "{\n\"name\": \"@ciscospark/react-ciscospark\",\n- \"version\": \"0.1.282\",\n+ \"version\": \"0.1.283\",\n\"description\": \"The Cisco Spark for React library allows developers to easily incorporate Spark functionality into an application.\",\n\"scripts\": {\n\"build\": \"./scripts/build/index.js\",\n", "new_path": "package.json", "old_path": "package.json" } ]
JavaScript
MIT License
webex/react-widgets
chore(release): 0.1.283
1
chore
release
807,849
27.04.2018 09:36:29
25,200
d11526abd30b38e6ffa898d79b717c9c9dfd52e2
lint: fix default-case error in a way prettier doesn't mangle
[ { "change_type": "MODIFY", "diff": "@@ -32,7 +32,7 @@ function parseField(input, key) {\nreturn true;\n}\n- switch (field) { // eslint-disable-line default-case\n+ switch (field) {\ncase \"true\": {\nreturn true;\n}\n@@ -48,6 +48,8 @@ function parseField(input, key) {\ncase \"undefined\": {\nreturn undefined;\n}\n+\n+ // no default\n}\nfield = envReplace(field);\n", "new_path": "utils/npm-conf/lib/parse-field.js", "old_path": "utils/npm-conf/lib/parse-field.js" } ]
JavaScript
MIT License
lerna/lerna
lint: fix default-case error in a way prettier doesn't mangle
1
lint
null
791,690
27.04.2018 10:57:35
25,200
85b2fbcf1e44f9521dce728a7b2dd2f4e3eaa5bf
core(metrics): add lantern EIL
[ { "change_type": "MODIFY", "diff": "const Audit = require('./audit');\nconst Util = require('../report/html/renderer/util');\n-const TracingProcessor = require('../lib/traces/tracing-processor');\n-const LHError = require('../lib/errors');\n-const ROLLING_WINDOW_SIZE = 5000;\n-\n-/**\n- * @fileOverview This audit determines the largest 90 percentile EQT value of all 5s windows between\n- * FMP and the end of the trace.\n- * @see https://docs.google.com/document/d/1b9slyaB9yho91YTOkAQfpCdULFkZM9LqsipcX3t7He8/preview\n- */\nclass EstimatedInputLatency extends Audit {\n/**\n* @return {!AuditMeta}\n@@ -45,57 +36,29 @@ class EstimatedInputLatency extends Audit {\n};\n}\n- static calculate(tabTrace, context) {\n- const startTime = tabTrace.timings.firstMeaningfulPaint;\n- if (!startTime) {\n- throw new LHError(LHError.errors.NO_FMP);\n- }\n-\n- const events = TracingProcessor.getMainThreadTopLevelEvents(tabTrace, startTime)\n- .filter(evt => evt.duration >= 1);\n-\n- const candidateStartEvts = events.filter(evt => evt.duration >= 10);\n-\n- let worst90thPercentileLatency = 16;\n- for (const startEvt of candidateStartEvts) {\n- const latencyPercentiles = TracingProcessor.getRiskToResponsiveness(\n- events,\n- startEvt.start,\n- startEvt.start + ROLLING_WINDOW_SIZE,\n- [0.9]\n- );\n-\n- worst90thPercentileLatency = Math.max(\n- latencyPercentiles[0].time,\n- worst90thPercentileLatency\n- );\n- }\n-\n- const score = Audit.computeLogNormalScore(\n- worst90thPercentileLatency,\n- context.options.scorePODR,\n- context.options.scoreMedian\n- );\n-\n- return {\n- score,\n- rawValue: worst90thPercentileLatency,\n- displayValue: Util.formatMilliseconds(worst90thPercentileLatency, 1),\n- };\n- }\n-\n/**\n* Audits the page to estimate input latency.\n* @see https://github.com/GoogleChrome/lighthouse/issues/28\n- * @param {!Artifacts} artifacts The artifacts from the gather phase.\n+ *\n+ * @param {LH.Artifacts} artifacts\n* @param {LH.Audit.Context} context\n- * @return {!Promise<!AuditResult>} The score from the audit, ranging from 0-100.\n+ * @return {Promise<LH.Audit.Product>}\n*/\n- static audit(artifacts, context) {\n- const trace = artifacts.traces[this.DEFAULT_PASS];\n+ static async audit(artifacts, context) {\n+ const trace = artifacts.traces[Audit.DEFAULT_PASS];\n+ const devtoolsLog = artifacts.devtoolsLogs[Audit.DEFAULT_PASS];\n+ const metricComputationData = {trace, devtoolsLog, settings: context.settings};\n+ const metricResult = await artifacts.requestEstimatedInputLatency(metricComputationData);\n- return artifacts.requestTraceOfTab(trace)\n- .then(traceOfTab => EstimatedInputLatency.calculate(traceOfTab, context));\n+ return {\n+ score: Audit.computeLogNormalScore(\n+ metricResult.timing,\n+ context.options.scorePODR,\n+ context.options.scoreMedian\n+ ),\n+ rawValue: metricResult.timing,\n+ displayValue: Util.formatMilliseconds(metricResult.timing, 1),\n+ };\n}\n}\n", "new_path": "lighthouse-core/audits/estimated-input-latency.js", "old_path": "lighthouse-core/audits/estimated-input-latency.js" }, { "change_type": "MODIFY", "diff": "@@ -37,6 +37,7 @@ class Metrics extends Audit {\nconst firstCPUIdle = await artifacts.requestFirstCPUIdle(metricComputationData);\nconst timeToInteractive = await artifacts.requestConsistentlyInteractive(metricComputationData);\nconst speedIndex = await artifacts.requestSpeedIndex(metricComputationData);\n+ const estimatedInputLatency = await artifacts.requestEstimatedInputLatency(metricComputationData); // eslint-disable-line max-len\nconst metrics = [];\n// Include the simulated/observed performance metrics\n@@ -46,6 +47,7 @@ class Metrics extends Audit {\nfirstCPUIdle,\ntimeToInteractive,\nspeedIndex,\n+ estimatedInputLatency,\n};\nfor (const [metricName, values] of Object.entries(metricsMap)) {\n", "new_path": "lighthouse-core/audits/metrics.js", "old_path": "lighthouse-core/audits/metrics.js" }, { "change_type": "MODIFY", "diff": "@@ -41,6 +41,7 @@ class PredictivePerf extends Audit {\nconst ttci = await artifacts.requestLanternConsistentlyInteractive({trace, devtoolsLog});\nconst ttfcpui = await artifacts.requestLanternFirstCPUIdle({trace, devtoolsLog});\nconst si = await artifacts.requestLanternSpeedIndex({trace, devtoolsLog});\n+ const eil = await artifacts.requestLanternEstimatedInputLatency({trace, devtoolsLog});\nconst values = {\nroughEstimateOfFCP: fcp.timing,\n@@ -62,6 +63,10 @@ class PredictivePerf extends Audit {\nroughEstimateOfSI: si.timing,\noptimisticSI: si.optimisticEstimate.timeInMs,\npessimisticSI: si.pessimisticEstimate.timeInMs,\n+\n+ roughEstimateOfEIL: eil.timing,\n+ optimisticEIL: eil.optimisticEstimate.timeInMs,\n+ pessimisticEIL: eil.pessimisticEstimate.timeInMs,\n};\nconst score = Audit.computeLogNormalScore(\n", "new_path": "lighthouse-core/audits/predictive-perf.js", "old_path": "lighthouse-core/audits/predictive-perf.js" }, { "change_type": "ADD", "diff": "+/**\n+ * @license Copyright 2018 Google Inc. All Rights Reserved.\n+ * 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\n+ * 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 limitations under the License.\n+ */\n+'use strict';\n+\n+const MetricArtifact = require('./metric');\n+const LHError = require('../../../lib/errors');\n+const TracingProcessor = require('../../../lib/traces/tracing-processor');\n+\n+const ROLLING_WINDOW_SIZE = 5000;\n+\n+/**\n+ * @fileoverview This audit determines the largest 90 percentile EQT value of all 5s windows between\n+ * FMP and the end of the trace.\n+ * @see https://docs.google.com/document/d/1b9slyaB9yho91YTOkAQfpCdULFkZM9LqsipcX3t7He8/preview\n+ */\n+class EstimatedInputLatency extends MetricArtifact {\n+ get name() {\n+ return 'EstimatedInputLatency';\n+ }\n+\n+ /**\n+ * @param {Array<{start: number, end: number, duration: number}>} events\n+ * @return {number}\n+ */\n+ static calculateRollingWindowEIL(events) {\n+ const candidateStartEvts = events.filter(evt => evt.duration >= 10);\n+\n+ let worst90thPercentileLatency = 16;\n+ for (const startEvt of candidateStartEvts) {\n+ const latencyPercentiles = TracingProcessor.getRiskToResponsiveness(\n+ events,\n+ startEvt.start,\n+ startEvt.start + ROLLING_WINDOW_SIZE,\n+ [0.9]\n+ );\n+\n+ worst90thPercentileLatency = Math.max(latencyPercentiles[0].time, worst90thPercentileLatency);\n+ }\n+\n+ return worst90thPercentileLatency;\n+ }\n+\n+ /**\n+ * @param {LH.Artifacts.MetricComputationData} data\n+ * @return {Promise<LH.Artifacts.Metric>}\n+ */\n+ computeObservedMetric(data) {\n+ const {firstMeaningfulPaint} = data.traceOfTab.timings;\n+ if (!firstMeaningfulPaint) {\n+ throw new LHError(LHError.errors.NO_FMP);\n+ }\n+\n+ const events = TracingProcessor.getMainThreadTopLevelEvents(\n+ data.traceOfTab,\n+ firstMeaningfulPaint\n+ ).filter(evt => evt.duration >= 1);\n+\n+ return Promise.resolve({\n+ timing: EstimatedInputLatency.calculateRollingWindowEIL(events),\n+ });\n+ }\n+}\n+\n+module.exports = EstimatedInputLatency;\n", "new_path": "lighthouse-core/gather/computed/metrics/estimated-input-latency.js", "old_path": null }, { "change_type": "ADD", "diff": "+/**\n+ * @license Copyright 2018 Google Inc. All Rights Reserved.\n+ * 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\n+ * 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 limitations under the License.\n+ */\n+'use strict';\n+\n+const LanternMetricArtifact = require('./lantern-metric');\n+const Node = require('../../../lib/dependency-graph/node');\n+const EstimatedInputLatency = require('./estimated-input-latency');\n+\n+class LanternEstimatedInputLatency extends LanternMetricArtifact {\n+ get name() {\n+ return 'LanternEstimatedInputLatency';\n+ }\n+\n+ /**\n+ * @return {LH.Gatherer.Simulation.MetricCoefficients}\n+ */\n+ get COEFFICIENTS() {\n+ return {\n+ intercept: 0,\n+ optimistic: 0.4,\n+ pessimistic: 0.4,\n+ };\n+ }\n+\n+ /**\n+ * @param {Node} dependencyGraph\n+ * @return {Node}\n+ */\n+ getOptimisticGraph(dependencyGraph) {\n+ return dependencyGraph;\n+ }\n+\n+ /**\n+ * @param {Node} dependencyGraph\n+ * @return {Node}\n+ */\n+ getPessimisticGraph(dependencyGraph) {\n+ return dependencyGraph;\n+ }\n+\n+ /**\n+ * @param {LH.Gatherer.Simulation.Result} simulation\n+ * @param {Object} extras\n+ * @return {LH.Gatherer.Simulation.Result}\n+ */\n+ getEstimateFromSimulation(simulation, extras) {\n+ // Intentionally use the opposite FMP estimate, a more pessimistic FMP means that more tasks\n+ // are excluded from the EIL computation, so a higher FMP means lower EIL for same work.\n+ const fmpTimeInMs = extras.optimistic\n+ ? extras.fmpResult.pessimisticEstimate.timeInMs\n+ : extras.fmpResult.optimisticEstimate.timeInMs;\n+\n+ const events = LanternEstimatedInputLatency.getEventsAfterFMP(\n+ simulation.nodeTimings,\n+ fmpTimeInMs\n+ );\n+\n+ return {\n+ timeInMs: EstimatedInputLatency.calculateRollingWindowEIL(events),\n+ nodeTimings: simulation.nodeTimings,\n+ };\n+ }\n+\n+ /**\n+ * @param {LH.Artifacts.MetricComputationData} data\n+ * @param {Object} artifacts\n+ * @return {Promise<LH.Artifacts.LanternMetric>}\n+ */\n+ async compute_(data, artifacts) {\n+ const fmpResult = await artifacts.requestLanternFirstMeaningfulPaint(data, artifacts);\n+ return this.computeMetricWithGraphs(data, artifacts, {fmpResult});\n+ }\n+\n+ /**\n+ * @param {LH.Gatherer.Simulation.Result['nodeTimings']} nodeTimings\n+ * @param {number} fmpTimeInMs\n+ */\n+ static getEventsAfterFMP(nodeTimings, fmpTimeInMs) {\n+ /** @type {Array<{start: number, end: number, duration: number}>} */\n+ const events = [];\n+ for (const [node, timing] of nodeTimings.entries()) {\n+ if (node.type !== Node.TYPES.CPU) continue;\n+ if (!timing.endTime || !timing.startTime) continue;\n+ if (timing.endTime < fmpTimeInMs) continue;\n+\n+ events.push({\n+ start: timing.startTime,\n+ end: timing.endTime,\n+ duration: timing.endTime - timing.startTime,\n+ });\n+ }\n+\n+ return events;\n+ }\n+}\n+\n+module.exports = LanternEstimatedInputLatency;\n", "new_path": "lighthouse-core/gather/computed/metrics/lantern-estimated-input-latency.js", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -10,16 +10,14 @@ const Runner = require('../../runner');\nconst assert = require('assert');\nconst options = Audit.defaultOptions;\n-const TracingProcessor = require('../../lib/traces/tracing-processor');\nconst pwaTrace = require('../fixtures/traces/progressive-app-m60.json');\nconst computedArtifacts = Runner.instantiateComputedArtifacts();\nfunction generateArtifactsWithTrace(trace) {\nreturn Object.assign({\n- traces: {\n- [Audit.DEFAULT_PASS]: trace,\n- },\n+ traces: {[Audit.DEFAULT_PASS]: trace},\n+ devtoolsLogs: {[Audit.DEFAULT_PASS]: []},\n}, computedArtifacts);\n}\n/* eslint-env mocha */\n@@ -27,74 +25,12 @@ function generateArtifactsWithTrace(trace) {\ndescribe('Performance: estimated-input-latency audit', () => {\nit('evaluates valid input correctly', () => {\nconst artifacts = generateArtifactsWithTrace(pwaTrace);\n- return Audit.audit(artifacts, {options}).then(output => {\n+ const settings = {throttlingMethod: 'provided'};\n+ return Audit.audit(artifacts, {options, settings}).then(output => {\nassert.equal(output.debugString, undefined);\nassert.equal(Math.round(output.rawValue * 10) / 10, 17.1);\nassert.equal(output.displayValue, '17\\xa0ms');\nassert.equal(output.score, 1);\n});\n});\n-\n- describe('#audit', () => {\n- let firstMeaningfulPaint;\n- let traceEnd;\n- let artifacts;\n- let origGetMainThreadEventsFn;\n- let mainThreadEvtsMock;\n-\n- beforeEach(() => {\n- firstMeaningfulPaint = 0.00001;\n- traceEnd = 1e20;\n- artifacts = {\n- traces: {},\n- requestTraceOfTab() {\n- const timings = {firstMeaningfulPaint, traceEnd};\n- return Promise.resolve({timings});\n- },\n- };\n-\n- origGetMainThreadEventsFn = TracingProcessor.getMainThreadTopLevelEvents;\n- TracingProcessor.getMainThreadTopLevelEvents = () => mainThreadEvtsMock(arguments);\n- });\n-\n- afterEach(() => {\n- TracingProcessor.getMainThreadTopLevelEvents = origGetMainThreadEventsFn;\n- });\n-\n- it('uses a 5s rolling window, not traceEnd', async () => {\n- mainThreadEvtsMock = () => [\n- {start: 7500, end: 10000, duration: 2500},\n- {start: 10000, end: 15000, duration: 5000},\n- ];\n-\n- const result = await Audit.audit(artifacts, {options});\n- assert.equal(result.rawValue, 4516);\n- assert.equal(result.score, 0);\n- });\n-\n- it('handles continuous tasks', async () => {\n- const events = [];\n- const longTaskDuration = 100;\n- const longTaskNumber = 1000;\n- const shortTaskDuration = 1.1;\n- const shortTaskNumber = 10000;\n-\n- for (let i = 0; i < longTaskNumber; i++) {\n- const start = i * longTaskDuration;\n- events.push({start: start, end: start + longTaskDuration, duration: longTaskDuration});\n- }\n-\n- const baseline = events[events.length - 1].end;\n- for (let i = 0; i < shortTaskNumber; i++) {\n- const start = i * shortTaskDuration + baseline;\n- events.push({start: start, end: start + shortTaskDuration, duration: shortTaskDuration});\n- }\n-\n- mainThreadEvtsMock = () => events;\n-\n- const result = await Audit.audit(artifacts, {options});\n- assert.equal(result.rawValue, 106);\n- assert.equal(result.score, 0.44);\n- });\n- });\n});\n", "new_path": "lighthouse-core/test/audits/estimated-input-latency-test.js", "old_path": "lighthouse-core/test/audits/estimated-input-latency-test.js" }, { "change_type": "MODIFY", "diff": "@@ -43,6 +43,7 @@ describe('Performance: metrics', () => {\nfirstCPUIdle: 5308,\ntimeToInteractive: 5308,\nspeedIndex: 2063,\n+ estimatedInputLatency: 104,\nobservedNavigationStart: 0,\nobservedFirstPaint: 499,\n", "new_path": "lighthouse-core/test/audits/metrics-test.js", "old_path": "lighthouse-core/test/audits/metrics-test.js" }, { "change_type": "ADD", "diff": "+/**\n+ * @license Copyright 2018 Google Inc. All Rights Reserved.\n+ * 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\n+ * 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 limitations under the License.\n+ */\n+'use strict';\n+\n+const Runner = require('../../../../runner');\n+const EstimatedInputLatency = require('../../../../gather/computed/metrics/estimated-input-latency'); // eslint-disable-line\n+const assert = require('assert');\n+\n+const trace = require('../../../fixtures/traces/progressive-app-m60.json');\n+const devtoolsLog = require('../../../fixtures/traces/progressive-app-m60.devtools.log.json');\n+\n+/* eslint-env mocha */\n+\n+describe('Metrics: EIL', () => {\n+ it('should compute a simulated value', async () => {\n+ const artifacts = Runner.instantiateComputedArtifacts();\n+ const settings = {throttlingMethod: 'simulate'};\n+ const result = await artifacts.requestEstimatedInputLatency({trace, devtoolsLog, settings});\n+\n+ assert.equal(Math.round(result.timing), 104);\n+ assert.equal(Math.round(result.optimisticEstimate.timeInMs), 101);\n+ assert.equal(Math.round(result.pessimisticEstimate.timeInMs), 158);\n+ });\n+\n+ it('should compute an observed value', async () => {\n+ const artifacts = Runner.instantiateComputedArtifacts();\n+ const settings = {throttlingMethod: 'provided'};\n+ const result = await artifacts.requestEstimatedInputLatency({trace, devtoolsLog, settings});\n+\n+ assert.equal(Math.round(result.timing * 10) / 10, 17.1);\n+ });\n+\n+\n+ describe('#calculateRollingWindowEIL', () => {\n+ it('uses a 5s rolling window', async () => {\n+ const events = [\n+ {start: 7500, end: 10000, duration: 2500},\n+ {start: 10000, end: 15000, duration: 5000},\n+ ];\n+\n+ assert.equal(EstimatedInputLatency.calculateRollingWindowEIL(events), 4516);\n+ });\n+\n+ it('handles continuous tasks', async () => {\n+ const events = [];\n+ const longTaskDuration = 100;\n+ const longTaskNumber = 1000;\n+ const shortTaskDuration = 1.1;\n+ const shortTaskNumber = 10000;\n+\n+ for (let i = 0; i < longTaskNumber; i++) {\n+ const start = i * longTaskDuration;\n+ events.push({start: start, end: start + longTaskDuration, duration: longTaskDuration});\n+ }\n+\n+ const baseline = events[events.length - 1].end;\n+ for (let i = 0; i < shortTaskNumber; i++) {\n+ const start = i * shortTaskDuration + baseline;\n+ events.push({start: start, end: start + shortTaskDuration, duration: shortTaskDuration});\n+ }\n+\n+ assert.equal(EstimatedInputLatency.calculateRollingWindowEIL(events), 106);\n+ });\n+ });\n+});\n", "new_path": "lighthouse-core/test/gather/computed/metrics/estimated-input-latency-test.js", "old_path": null }, { "change_type": "ADD", "diff": "+/**\n+ * @license Copyright 2018 Google Inc. All Rights Reserved.\n+ * 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\n+ * 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 limitations under the License.\n+ */\n+'use strict';\n+\n+const Runner = require('../../../../runner');\n+const assert = require('assert');\n+\n+const trace = require('../../../fixtures/traces/progressive-app-m60.json');\n+const devtoolsLog = require('../../../fixtures/traces/progressive-app-m60.devtools.log.json');\n+\n+/* eslint-env mocha */\n+\n+describe('Metrics: Lantern EIL', () => {\n+ it('should compute a simulated value', async () => {\n+ const artifacts = Runner.instantiateComputedArtifacts();\n+ const settings = {throttlingMethod: 'simulate'};\n+ const data = {trace, devtoolsLog, settings};\n+ const result = await artifacts.requestLanternEstimatedInputLatency(data);\n+\n+ assert.equal(Math.round(result.timing), 104);\n+ assert.equal(Math.round(result.optimisticEstimate.timeInMs), 101);\n+ assert.equal(Math.round(result.pessimisticEstimate.timeInMs), 158);\n+ });\n+});\n", "new_path": "lighthouse-core/test/gather/computed/metrics/lantern-estimated-input-latency-test.js", "old_path": null }, { "change_type": "MODIFY", "diff": "\"timing\": 4417,\n\"timestamp\": 185607736912\n},\n+ {\n+ \"metricName\": \"estimatedInputLatency\",\n+ \"timing\": 16\n+ },\n{\n\"metricName\": \"observedNavigationStart\",\n\"timing\": 0,\n", "new_path": "lighthouse-core/test/results/sample_v2.json", "old_path": "lighthouse-core/test/results/sample_v2.json" }, { "change_type": "MODIFY", "diff": "@@ -243,7 +243,7 @@ declare global {\nexport interface Metric {\ntiming: number;\n- timestamp: number;\n+ timestamp?: number;\n}\nexport interface LanternMetric {\n", "new_path": "typings/artifacts.d.ts", "old_path": "typings/artifacts.d.ts" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
core(metrics): add lantern EIL (#5024)
1
core
metrics
791,690
27.04.2018 10:59:07
25,200
63b84cfb786f8ec260f2cf202357b51e707e4576
core(render-blocking): address followup feedback
[ { "change_type": "MODIFY", "diff": "@@ -49,7 +49,10 @@ class RenderBlockingResources extends Audit {\n'Resources are blocking the first paint of your page. Consider ' +\n'delivering critical JS/CSS inline and deferring all non-critical ' +\n'JS/styles. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/blocking-resources).',\n- requiredArtifacts: ['CSSUsage', 'URL', 'TagsBlockingFirstPaint', 'traces'],\n+ // This audit also looks at CSSUsage but has a graceful fallback if it failed, so do not mark\n+ // it as a \"requiredArtifact\".\n+ // TODO: look into adding an `optionalArtifacts` property that captures this\n+ requiredArtifacts: ['URL', 'TagsBlockingFirstPaint', 'traces'],\n};\n}\n@@ -63,7 +66,7 @@ class RenderBlockingResources extends Audit {\nconst simulatorData = {devtoolsLog, settings: context.settings};\nconst traceOfTab = await artifacts.requestTraceOfTab(trace);\nconst simulator = await artifacts.requestLoadSimulator(simulatorData);\n- const wastedBytesMap = await RenderBlockingResources.computeWastedCSSBytes(artifacts, context);\n+ const wastedCssBytes = await RenderBlockingResources.computeWastedCSSBytes(artifacts, context);\nconst metricSettings = {throttlingMethod: 'simulate'};\nconst metricComputationData = {trace, devtoolsLog, simulator, settings: metricSettings};\n@@ -82,7 +85,7 @@ class RenderBlockingResources extends Audit {\nconst {node, nodeTiming} = nodesByUrl[resource.tag.url];\n- // Mark this node and all it's dependents as deferrable\n+ // Mark this node and all its dependents as deferrable\n// TODO(phulce): make this slightly more surgical\n// i.e. the referenced font asset won't become inlined just because you inline the CSS\nnode.traverse(node => deferredNodeIds.add(node.id));\n@@ -106,7 +109,7 @@ class RenderBlockingResources extends Audit {\nsimulator,\nfcpSimulation.optimisticGraph,\ndeferredNodeIds,\n- wastedBytesMap\n+ wastedCssBytes\n);\nreturn {results, wastedMs};\n@@ -125,10 +128,10 @@ class RenderBlockingResources extends Audit {\n* @param {Simulator} simulator\n* @param {Node} fcpGraph\n* @param {Set<string>} deferredIds\n- * @param {Map<string, number>} wastedBytesMap\n+ * @param {Map<string, number>} wastedCssBytesByUrl\n* @return {number}\n*/\n- static estimateSavingsWithGraphs(simulator, fcpGraph, deferredIds, wastedBytesMap) {\n+ static estimateSavingsWithGraphs(simulator, fcpGraph, deferredIds, wastedCssBytesByUrl) {\nconst originalEstimate = simulator.simulate(fcpGraph).timeInMs;\nlet totalChildNetworkBytes = 0;\n@@ -139,7 +142,7 @@ class RenderBlockingResources extends Audit {\nnode.record._resourceType === WebInspector.resourceTypes.Stylesheet;\nif (canDeferRequest && isStylesheet) {\n// We'll inline the used bytes of the stylesheet and assume the rest can be deferred\n- const wastedBytes = wastedBytesMap.get(node.record.url) || 0;\n+ const wastedBytes = wastedCssBytesByUrl.get(node.record.url) || 0;\ntotalChildNetworkBytes += node.record._transferSize - wastedBytes;\n}\n@@ -162,6 +165,7 @@ class RenderBlockingResources extends Audit {\nstatic async computeWastedCSSBytes(artifacts, context) {\nconst wastedBytesByUrl = new Map();\ntry {\n+ // TODO(phulce): pull this out into computed artifact\nconst results = await UnusedCSS.audit(artifacts, context);\nfor (const item of results.details.items) {\nwastedBytesByUrl.set(item.url, item.wastedBytes);\n", "new_path": "lighthouse-core/audits/byte-efficiency/render-blocking-resources.js", "old_path": "lighthouse-core/audits/byte-efficiency/render-blocking-resources.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
core(render-blocking): address followup feedback (#5039)
1
core
render-blocking
730,429
27.04.2018 11:05:05
14,400
563e51c14e95f47f82a957cf600f369ce00a40c4
docs(widget-recents): update prop type definitions for components
[ { "change_type": "MODIFY", "diff": "@@ -17,7 +17,9 @@ import styles from './styles.css';\nconst propTypes = {\navatarUrl: PropTypes.string,\ncall: PropTypes.object,\n- currentUser: PropTypes.object.isRequired,\n+ currentUser: PropTypes.shape({\n+ id: PropTypes.string.isRequired\n+ }).isRequired,\nformatMessage: PropTypes.func.isRequired,\nhasGroupCalling: PropTypes.bool,\nid: PropTypes.string,\n", "new_path": "packages/node_modules/@ciscospark/widget-recents/src/components/space-item/index.js", "old_path": "packages/node_modules/@ciscospark/widget-recents/src/components/space-item/index.js" }, { "change_type": "MODIFY", "diff": "@@ -5,19 +5,35 @@ import classNames from 'classnames';\nimport SpaceItem from '../space-item';\nconst propTypes = {\n- currentUser: PropTypes.object.isRequired,\n+ currentUser: PropTypes.shape({\n+ id: PropTypes.string.isRequired\n+ }).isRequired,\nformatMessage: PropTypes.func.isRequired,\nhasGroupCalling: PropTypes.bool,\nonCallClick: PropTypes.func,\nonClick: PropTypes.func,\n- spaces: PropTypes.object\n+ spaces: PropTypes.arrayOf(\n+ PropTypes.shape({\n+ avatarUrl: PropTypes.string,\n+ call: PropTypes.object,\n+ id: PropTypes.string,\n+ isDecrypting: PropTypes.bool,\n+ isUnread: PropTypes.bool,\n+ lastActivityTime: PropTypes.string,\n+ latestActivity: PropTypes.object,\n+ name: PropTypes.string,\n+ teamColor: PropTypes.string,\n+ teamName: PropTypes.string,\n+ type: PropTypes.string\n+ })\n+ )\n};\nconst defaultProps = {\nhasGroupCalling: false,\nonCallClick: () => {},\nonClick: () => {},\n- spaces: {}\n+ spaces: []\n};\nexport default function SpacesList({\n", "new_path": "packages/node_modules/@ciscospark/widget-recents/src/components/spaces-list/index.js", "old_path": "packages/node_modules/@ciscospark/widget-recents/src/components/spaces-list/index.js" } ]
JavaScript
MIT License
webex/react-widgets
docs(widget-recents): update prop type definitions for components
1
docs
widget-recents
730,429
27.04.2018 11:19:40
14,400
4368e04c3f360fe320ea6ad653819b5f075648e4
feat(join-call-button): moved to individual component
[ { "change_type": "ADD", "diff": "+{\n+ \"name\": \"@ciscospark/react-component-join-call-button\",\n+ \"description\": \"Cisco Spark React Join Call Button\",\n+ \"main\": \"./cjs/index.js\",\n+ \"src\": \"./src/index.js\",\n+ \"module\": \"./es/index.js\",\n+ \"keywords\": [],\n+ \"contributors\": [\n+ \"Adam Weeks <adweeks@cisco.com>\",\n+ \"Bernie Zang <nzang@cisco.com>\"\n+ ],\n+ \"license\": \"MIT\",\n+ \"repository\": \"https://github.com/webex/react-ciscospark\",\n+ \"files\": [\n+ \"src\",\n+ \"dist\",\n+ \"cjs\",\n+ \"es\"\n+ ]\n+}\n", "new_path": "packages/node_modules/@ciscospark/react-component-join-call-button/package.json", "old_path": null }, { "change_type": "RENAME", "diff": "", "new_path": "packages/node_modules/@ciscospark/react-component-join-call-button/src/index.js", "old_path": "packages/node_modules/@ciscospark/widget-recents/src/components/join-call-button/index.js" }, { "change_type": "RENAME", "diff": "", "new_path": "packages/node_modules/@ciscospark/react-component-join-call-button/src/styles.css", "old_path": "packages/node_modules/@ciscospark/widget-recents/src/components/join-call-button/styles.css" }, { "change_type": "MODIFY", "diff": "@@ -6,8 +6,7 @@ import {ICON_TYPE_VIDEO_OUTLINE} from '@ciscospark/react-component-icon';\nimport Avatar from '@ciscospark/react-component-avatar';\nimport Button from '@ciscospark/react-component-button';\nimport CallDataActivityMessage from '@ciscospark/react-component-call-data-activity';\n-\n-import JoinCallButton from '../join-call-button';\n+import JoinCallButton from '@ciscospark/react-component-join-call-button';\nimport messages from '../../messages';\n", "new_path": "packages/node_modules/@ciscospark/widget-recents/src/components/space-item/index.js", "old_path": "packages/node_modules/@ciscospark/widget-recents/src/components/space-item/index.js" } ]
JavaScript
MIT License
webex/react-widgets
feat(join-call-button): moved to individual component
1
feat
join-call-button
791,723
27.04.2018 11:39:20
25,200
63c999789dc08b9a3b56b22f25f478f13050da29
tests: fix cli handling empty runnerResult during gatherMode
[ { "change_type": "MODIFY", "diff": "@@ -100,12 +100,12 @@ function handleError(err) {\n* @return {Promise<void>}\n*/\nfunction saveResults(runnerResult, flags) {\n- const {lhr, artifacts} = runnerResult;\nconst cwd = process.cwd();\nlet promise = Promise.resolve();\nconst shouldSaveResults = flags.auditMode || (flags.gatherMode === flags.auditMode);\nif (!shouldSaveResults) return promise;\n+ const {lhr, artifacts} = runnerResult;\n// Use the output path as the prefix for all generated files.\n// If no output path is set, generate a file prefix using the URL and date.\n", "new_path": "lighthouse-cli/run.js", "old_path": "lighthouse-cli/run.js" }, { "change_type": "MODIFY", "diff": "@@ -53,6 +53,14 @@ describe('flag coercing', () => {\n});\n});\n+\n+describe('saveResults', () => {\n+ it('will quit early if we\\'re in gather mode', async () => {\n+ const result = await run.saveResults(undefined, {gatherMode: true});\n+ assert.equal(result, undefined);\n+ });\n+});\n+\ndescribe('Parsing --chrome-flags', () => {\nit('returns boolean flags that are true as a bare flag', () => {\nassert.deepStrictEqual(parseChromeFlags('--debug'), ['--debug']);\n", "new_path": "lighthouse-cli/test/cli/run-test.js", "old_path": "lighthouse-cli/test/cli/run-test.js" }, { "change_type": "MODIFY", "diff": "@@ -179,7 +179,7 @@ class Runner {\nartifacts = Object.assign(Runner.instantiateComputedArtifacts(), artifacts);\nif (artifacts.settings) {\n- const overrides = {gatherMode: undefined, auditMode: undefined};\n+ const overrides = {gatherMode: undefined, auditMode: undefined, output: undefined};\nconst normalizedGatherSettings = Object.assign({}, artifacts.settings, overrides);\nconst normalizedAuditSettings = Object.assign({}, settings, overrides);\n", "new_path": "lighthouse-core/runner.js", "old_path": "lighthouse-core/runner.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
tests: fix cli handling empty runnerResult during gatherMode (#5052)
1
tests
null
730,414
27.04.2018 12:13:24
14,400
74d41c4c02583bc95369380458ca012cfb28ea0f
chore(npm publish): add warn method
[ { "change_type": "MODIFY", "diff": "@@ -13,6 +13,16 @@ def cleanup = { ->\n}\n}\n+def warn = { msg ->\n+ if (!currentBuild.description) {\n+ currentBuild.description += ''\n+ }\n+ else if (currentBuild.description.substring(currentBuild.description.length() - 1) != '\\n') {\n+ currentBuild.description += '<br />\\n'\n+ }\n+ currentBuild.description += \"warning: ${msg}<br />\\n\"\n+}\n+\nansiColor('xterm') {\ntimestamps {\ntimeout(90) {\n", "new_path": "Jenkinsfile", "old_path": "Jenkinsfile" } ]
JavaScript
MIT License
webex/react-widgets
chore(npm publish): add warn method
1
chore
npm publish
724,206
27.04.2018 12:28:56
21,600
7516340d6cba88505306cc677eec7aca945d3862
docs: switch 'Action' component to 'Getters'
[ { "change_type": "MODIFY", "diff": "@@ -139,7 +139,7 @@ export default{\n``` js\nimport { shallow, createLocalVue } from '@vue/test-utils'\nimport Vuex from 'vuex'\n-import Actions from '../../../src/components/Getters'\n+import Getters from '../../../src/components/Getters'\nconst localVue = createLocalVue()\n@@ -161,13 +161,13 @@ describe('Getters.vue', () => {\n})\nit('Renders state.inputValue in first p tag', () => {\n- const wrapper = shallow(Actions, { store, localVue })\n+ const wrapper = shallow(Getters, { store, localVue })\nconst p = wrapper.find('p')\nexpect(p.text()).toBe(getters.inputValue())\n})\nit('Renders state.clicks in second p tag', () => {\n- const wrapper = shallow(Actions, { store, localVue })\n+ const wrapper = shallow(Getters, { store, localVue })\nconst p = wrapper.findAll('p').at(1)\nexpect(p.text()).toBe(getters.clicks().toString())\n})\n", "new_path": "docs/ja/guides/using-with-vuex.md", "old_path": "docs/ja/guides/using-with-vuex.md" }, { "change_type": "MODIFY", "diff": "@@ -137,7 +137,7 @@ export default{\n``` js\nimport { shallow, createLocalVue } from '@vue/test-utils'\nimport Vuex from 'vuex'\n-import Actions from '../../../src/components/Getters'\n+import Getters from '../../../src/components/Getters'\nconst localVue = createLocalVue()\n@@ -159,13 +159,13 @@ describe('Getters.vue', () => {\n})\nit('Renders state.inputValue in first p tag', () => {\n- const wrapper = shallow(Actions, { store, localVue })\n+ const wrapper = shallow(Getters, { store, localVue })\nconst p = wrapper.find('p')\nexpect(p.text()).toBe(getters.inputValue())\n})\nit('Renders state.clicks in second p tag', () => {\n- const wrapper = shallow(Actions, { store, localVue })\n+ const wrapper = shallow(Getters, { store, localVue })\nconst p = wrapper.findAll('p').at(1)\nexpect(p.text()).toBe(getters.clicks().toString())\n})\n", "new_path": "docs/kr/guides/using-with-vuex.md", "old_path": "docs/kr/guides/using-with-vuex.md" } ]
JavaScript
MIT License
vuejs/vue-test-utils
docs: switch 'Action' component to 'Getters' (#568)
1
docs
null
730,422
27.04.2018 12:31:56
25,200
7c67c5eb497624af660bfd452cb8c282e36fd4b6
refactor(react-component): converts PropTypes.object to PropTypes.shape
[ { "change_type": "MODIFY", "diff": "@@ -16,7 +16,13 @@ const propTypes = {\nactivities: PropTypes.arrayOf(PropTypes.shape({\nactivity: PropTypes.shape({\nid: PropTypes.string,\n- object: PropTypes.object,\n+ object: PropTypes.shape({\n+ content: PropTypes.string,\n+ displayName: PropTypes.string,\n+ files: PropTypes.shape({\n+ items: PropTypes.array\n+ })\n+ }).isRequired,\nactor: PropTypes.object,\npublished: PropTypes.string,\nverb: PropTypes.string\n", "new_path": "packages/node_modules/@ciscospark/react-component-activity-list/src/index.js", "old_path": "packages/node_modules/@ciscospark/react-component-activity-list/src/index.js" }, { "change_type": "MODIFY", "diff": "@@ -25,9 +25,25 @@ export const SYSTEM_MESSAGE_VERBS = [\n];\nconst propTypes = {\n- activity: PropTypes.object,\n- actor: PropTypes.object,\n- currentUser: PropTypes.object,\n+ activity: PropTypes.shape({\n+ duration: PropTypes.number.isRequired,\n+ isGroupCall: PropTypes.bool.isRequired,\n+ participants: PropTypes.arrayOf(\n+ PropTypes.shape({\n+ isInitiator: PropTypes.bool,\n+ person: PropTypes.shape({\n+ entryUUID: PropTypes.string\n+ }),\n+ state: PropTypes.string\n+ })\n+ )\n+ }),\n+ actor: PropTypes.shape({\n+ entryUUID: PropTypes.string\n+ }),\n+ currentUser: PropTypes.shape({\n+ id: PropTypes.string.isRequired\n+ }),\nisSelf: PropTypes.bool,\nname: PropTypes.string.isRequired,\ntimestamp: PropTypes.string,\n", "new_path": "packages/node_modules/@ciscospark/react-component-activity-system-message/src/index.js", "old_path": "packages/node_modules/@ciscospark/react-component-activity-system-message/src/index.js" }, { "change_type": "MODIFY", "diff": "@@ -5,9 +5,9 @@ import ListSeparator from '@ciscospark/react-component-list-separator';\nimport calculateDateText from './calculateDateText';\nconst propTypes = {\n- fromDate: PropTypes.object.isRequired,\n- now: PropTypes.object.isRequired,\n- toDate: PropTypes.object.isRequired\n+ fromDate: PropTypes.instanceOf(Date).isRequired,\n+ now: PropTypes.instanceOf(Date).isRequired,\n+ toDate: PropTypes.instanceOf(Date).isRequired\n};\nfunction DaySeparator({\n", "new_path": "packages/node_modules/@ciscospark/react-component-day-separator/src/index.js", "old_path": "packages/node_modules/@ciscospark/react-component-day-separator/src/index.js" } ]
JavaScript
MIT License
webex/react-widgets
refactor(react-component): converts PropTypes.object to PropTypes.shape
1
refactor
react-component
730,429
27.04.2018 12:35:35
14,400
3c32d6b71b320c23d006a5fcfaff101da8810b83
feat(space-item): moved to individual component
[ { "change_type": "ADD", "diff": "+{\n+ \"name\": \"@ciscospark/react-component-space-item\",\n+ \"description\": \"Cisco Spark React Space Item\",\n+ \"main\": \"./cjs/index.js\",\n+ \"src\": \"./src/index.js\",\n+ \"module\": \"./es/index.js\",\n+ \"keywords\": [],\n+ \"contributors\": [\n+ \"Adam Weeks <adweeks@cisco.com>\",\n+ \"Bernie Zang <nzang@cisco.com>\"\n+ ],\n+ \"license\": \"MIT\",\n+ \"repository\": \"https://github.com/webex/react-ciscospark\",\n+ \"files\": [\n+ \"src\",\n+ \"dist\",\n+ \"cjs\",\n+ \"es\"\n+ ]\n+}\n", "new_path": "packages/node_modules/@ciscospark/react-component-space-item/package.json", "old_path": null }, { "change_type": "ADD", "diff": "+// Jest Snapshot v1, https://goo.gl/fbAQLP\n+\n+exports[`SpaceItem component renders a decrypting space 1`] = `\n+<div\n+ className=\"space-item item isDecrypting\"\n+ onClick={[Function]}\n+ onKeyDown={[Function]}\n+ role=\"button\"\n+ tabIndex=\"0\"\n+>\n+ <div\n+ className=\"space-avatar-wrapper avatarWrapper\"\n+ >\n+ <div\n+ className=\"space-avatar-border\"\n+ >\n+ <Avatar\n+ baseColor=\"\"\n+ image=\"\"\n+ isSelfAvatar={false}\n+ name=\"Webex User\"\n+ />\n+ </div>\n+ </div>\n+ <div\n+ className=\"space-item-meta meta\"\n+ >\n+\n+ <div\n+ className=\"space-title title\"\n+ >\n+ Webex User\n+ </div>\n+ <div\n+ className=\"space-last-activity lastActivity\"\n+ >\n+\n+ </div>\n+ </div>\n+ <div\n+ className=\"space-last-activity-time timestamp\"\n+ >\n+\n+ </div>\n+</div>\n+`;\n+\n+exports[`SpaceItem component renders a space 1`] = `\n+<div\n+ className=\"space-item item hasCallSupport\"\n+ onClick={[Function]}\n+ onKeyDown={[Function]}\n+ role=\"button\"\n+ tabIndex=\"0\"\n+>\n+ <div\n+ className=\"space-unread-indicator unreadIndicator\"\n+ />\n+ <div\n+ className=\"space-avatar-wrapper avatarWrapper\"\n+ >\n+ <div\n+ className=\"space-avatar-border\"\n+ >\n+ <Avatar\n+ baseColor=\"blue\"\n+ image=\"\"\n+ isSelfAvatar={false}\n+ name=\"Webex User\"\n+ />\n+ </div>\n+ </div>\n+ <div\n+ className=\"space-item-meta meta\"\n+ >\n+ <div\n+ className=\"space-team-name teamName\"\n+ style={\n+ Object {\n+ \"color\": \"blue\",\n+ }\n+ }\n+ >\n+ Best Team\n+ </div>\n+ <div\n+ className=\"space-title title isUnread\"\n+ >\n+ Webex User\n+ </div>\n+ <div\n+ className=\"space-last-activity lastActivity\"\n+ >\n+ Hi there!\n+ </div>\n+ </div>\n+ <div\n+ className=\"space-last-activity-time timestamp\"\n+ >\n+ 9:05 PM\n+ </div>\n+ <div\n+ className=\"space-actions actions hoverReveal\"\n+ >\n+ <Button\n+ accessibilityLabel=\"Call Space\"\n+ buttonClassName=\"actionButton callButton\"\n+ iconType=\"icon-call_camera_32\"\n+ label=\"\"\n+ labelPosition=\"\"\n+ onClick={[Function]}\n+ title=\"\"\n+ />\n+ </div>\n+</div>\n+`;\n+\n+exports[`SpaceItem component renders a space with a call in progress 1`] = `\n+<div\n+ className=\"space-item item hasCallSupport\"\n+ onClick={[Function]}\n+ onKeyDown={[Function]}\n+ role=\"button\"\n+ tabIndex=\"0\"\n+>\n+ <div\n+ className=\"space-unread-indicator unreadIndicator\"\n+ />\n+ <div\n+ className=\"space-avatar-wrapper avatarWrapper\"\n+ >\n+ <div\n+ className=\"space-avatar-border\"\n+ >\n+ <Avatar\n+ baseColor=\"blue\"\n+ image=\"\"\n+ isSelfAvatar={false}\n+ name=\"Webex User\"\n+ />\n+ </div>\n+ </div>\n+ <div\n+ className=\"space-item-meta meta\"\n+ >\n+ <div\n+ className=\"space-team-name teamName\"\n+ style={\n+ Object {\n+ \"color\": \"blue\",\n+ }\n+ }\n+ >\n+ Best Team\n+ </div>\n+ <div\n+ className=\"space-title title isUnread\"\n+ >\n+ Webex User\n+ </div>\n+ <div\n+ className=\"space-last-activity lastActivity\"\n+ >\n+ Hi there!\n+ </div>\n+ </div>\n+ <div\n+ className=\"space-join-call joinCall\"\n+ >\n+ <JoinCallButton\n+ callStartTime={1483228800000}\n+ onJoinClick={[Function]}\n+ />\n+ </div>\n+</div>\n+`;\n+\n+exports[`SpaceItem component renders a space with a call in progress without call support 1`] = `\n+<div\n+ className=\"space-item item\"\n+ onClick={[Function]}\n+ onKeyDown={[Function]}\n+ role=\"button\"\n+ tabIndex=\"0\"\n+>\n+ <div\n+ className=\"space-unread-indicator unreadIndicator\"\n+ />\n+ <div\n+ className=\"space-avatar-wrapper avatarWrapper\"\n+ >\n+ <div\n+ className=\"space-avatar-border\"\n+ >\n+ <Avatar\n+ baseColor=\"blue\"\n+ image=\"\"\n+ isSelfAvatar={false}\n+ name=\"Webex User\"\n+ />\n+ </div>\n+ </div>\n+ <div\n+ className=\"space-item-meta meta\"\n+ >\n+ <div\n+ className=\"space-team-name teamName\"\n+ style={\n+ Object {\n+ \"color\": \"blue\",\n+ }\n+ }\n+ >\n+ Best Team\n+ </div>\n+ <div\n+ className=\"space-title title isUnread\"\n+ >\n+ Webex User\n+ </div>\n+ <div\n+ className=\"space-last-activity lastActivity\"\n+ >\n+ Hi there!\n+ </div>\n+ </div>\n+ <div\n+ className=\"space-last-activity-time timestamp\"\n+ >\n+ 9:05 PM\n+ </div>\n+</div>\n+`;\n", "new_path": "packages/node_modules/@ciscospark/react-component-space-item/src/__snapshots__/index.test.js.snap", "old_path": null }, { "change_type": "RENAME", "diff": "@@ -5,27 +5,23 @@ import classNames from 'classnames';\nimport {ICON_TYPE_VIDEO_OUTLINE} from '@ciscospark/react-component-icon';\nimport Avatar from '@ciscospark/react-component-avatar';\nimport Button from '@ciscospark/react-component-button';\n-import CallDataActivityMessage from '@ciscospark/react-component-call-data-activity';\nimport JoinCallButton from '@ciscospark/react-component-join-call-button';\n-import messages from '../../messages';\n-\nimport styles from './styles.css';\nconst propTypes = {\navatarUrl: PropTypes.string,\n- call: PropTypes.object,\n- currentUser: PropTypes.shape({\n- id: PropTypes.string.isRequired\n- }).isRequired,\n- formatMessage: PropTypes.func.isRequired,\n- hasGroupCalling: PropTypes.bool,\n+ activityText: PropTypes.oneOfType([\n+ PropTypes.string,\n+ PropTypes.element\n+ ]),\n+ callStartTime: PropTypes.number,\n+ hasCalling: PropTypes.bool,\nid: PropTypes.string,\nisDecrypting: PropTypes.bool,\nisUnread: PropTypes.bool,\nlastActivityTime: PropTypes.string,\n- latestActivity: PropTypes.object,\nname: PropTypes.string,\nonCallClick: PropTypes.func,\nonClick: PropTypes.func,\n@@ -35,13 +31,13 @@ const propTypes = {\n};\nconst defaultProps = {\n+ activityText: '',\navatarUrl: '',\n- call: undefined,\n- hasGroupCalling: false,\n+ callStartTime: undefined,\n+ hasCalling: false,\nid: '',\nisDecrypting: false,\nisUnread: false,\n- latestActivity: {},\nlastActivityTime: '',\nname: '',\nonCallClick: () => {},\n@@ -52,15 +48,13 @@ const defaultProps = {\n};\nfunction SpaceItem({\n+ activityText,\navatarUrl,\n- call,\n- currentUser,\n- formatMessage,\n- hasGroupCalling,\n+ callStartTime,\n+ hasCalling,\nid,\nisUnread,\nlastActivityTime,\n- latestActivity,\nname,\nonClick,\nonCallClick,\n@@ -83,53 +77,15 @@ function SpaceItem({\nfunction handleCallClick(e) {\n- if (type === 'direct' || hasGroupCalling) {\n+ if (type === 'direct' || hasCalling) {\ne.stopPropagation();\nreturn onCallClick(id);\n}\nreturn false;\n}\n- let activityText;\n-\n- if (!isDecrypting) {\n- const {actorName: actorName = '', type: activityType = 'unknown'} = latestActivity;\n-\n- switch (activityType) {\n- case 'post': {\n- activityText = <span>{actorName}<span className={styles.midDot} />{latestActivity.object.displayName}</span>;\n- break;\n- }\n- case 'update': {\n- if (latestActivity.object.objectType === 'locusSessionSummary') {\n- activityText = (\n- <CallDataActivityMessage\n- actor={latestActivity.actor}\n- currentUser={currentUser}\n- duration={latestActivity.object.duration}\n- isGroupCall={latestActivity.object.isGroupCall}\n- participants={latestActivity.object.participants.items}\n- />\n- );\n- }\n- break;\n- }\n- case 'share': {\n- activityText = formatMessage(messages.sharedFile);\n- break;\n- }\n- case 'add': {\n- activityText = formatMessage(messages.addedToSpace, {actorName, targetName: latestActivity.text.split(' ')[0]});\n- break;\n- }\n- default: {\n- activityText = '';\n- }\n- }\n- }\n-\n- const isDirectSpace = type === 'direct';\n- const hasCallSupport = typeof onCallClick === 'function' && (hasGroupCalling || isDirectSpace);\n+ // Show hover call and join in progress buttons\n+ const hasCallSupport = hasCalling && typeof onCallClick === 'function';\nreturn (\n<div\n@@ -169,21 +125,21 @@ function SpaceItem({\n</div>\n</div>\n{\n- (!hasCallSupport || !call) &&\n+ (!hasCallSupport || !callStartTime) &&\n<div className={classNames('space-last-activity-time', styles.timestamp)}>\n{lastActivityTime}\n</div>\n}\n{\n// Join call in progress\n- hasCallSupport && call &&\n+ hasCallSupport && callStartTime &&\n<div className={classNames('space-join-call', styles.joinCall)}>\n- <JoinCallButton callStartTime={call.startTime} onJoinClick={handleCallClick} />\n+ <JoinCallButton callStartTime={callStartTime} onJoinClick={handleCallClick} />\n</div>\n}\n{\n// Hover display of \"call\" button\n- hasCallSupport && !call &&\n+ hasCallSupport && !callStartTime &&\n<div className={classNames('space-actions', styles.actions, styles.hoverReveal)}>\n<Button\naccessibilityLabel=\"Call Space\"\n", "new_path": "packages/node_modules/@ciscospark/react-component-space-item/src/index.js", "old_path": "packages/node_modules/@ciscospark/widget-recents/src/components/space-item/index.js" }, { "change_type": "ADD", "diff": "+import React from 'react';\n+import ShallowRenderer from 'react-test-renderer/shallow';\n+\n+import SpaceItem from '.';\n+\n+const renderer = new ShallowRenderer();\n+\n+const onClick = jest.fn();\n+\n+describe('SpaceItem component', () => {\n+ it('renders a decrypting space', () => {\n+ renderer.render(\n+ <SpaceItem\n+ id=\"decrypting-space\"\n+ isDecrypting\n+ name=\"Webex User\"\n+ onClick={onClick}\n+ />\n+ );\n+ const component = renderer.getRenderOutput();\n+ expect(component).toMatchSnapshot();\n+ });\n+\n+ it('renders a space', () => {\n+ renderer.render(\n+ <SpaceItem\n+ activityText=\"Hi there!\"\n+ id=\"jane-doe-space\"\n+ lastActivityTime=\"9:05 PM\"\n+ latestActivity={{\n+ actorName: 'Jane Doe',\n+ type: 'post'\n+ }}\n+ isUnread\n+ hasCalling\n+ onCallClick={onClick}\n+ onClick={onClick}\n+ name=\"Webex User\"\n+ teamColor=\"blue\"\n+ teamName=\"Best Team\"\n+ />\n+ );\n+ const component = renderer.getRenderOutput();\n+ expect(component).toMatchSnapshot();\n+ });\n+\n+ it('renders a space with a call in progress', () => {\n+ renderer.render(\n+ <SpaceItem\n+ activityText=\"Hi there!\"\n+ callStartTime={Date.now()}\n+ id=\"jane-doe-space\"\n+ lastActivityTime=\"9:05 PM\"\n+ latestActivity={{\n+ actorName: 'Jane Doe',\n+ type: 'post'\n+ }}\n+ isUnread\n+ hasCalling\n+ onCallClick={onClick}\n+ onClick={onClick}\n+ name=\"Webex User\"\n+ teamColor=\"blue\"\n+ teamName=\"Best Team\"\n+ />\n+ );\n+ const component = renderer.getRenderOutput();\n+ expect(component).toMatchSnapshot();\n+ });\n+\n+ it('renders a space with a call in progress without call support', () => {\n+ renderer.render(\n+ <SpaceItem\n+ activityText=\"Hi there!\"\n+ callStartTime={Date.now()}\n+ id=\"jane-doe-space\"\n+ lastActivityTime=\"9:05 PM\"\n+ latestActivity={{\n+ actorName: 'Jane Doe',\n+ type: 'post'\n+ }}\n+ isUnread\n+ onCallClick={onClick}\n+ onClick={onClick}\n+ name=\"Webex User\"\n+ teamColor=\"blue\"\n+ teamName=\"Best Team\"\n+ />\n+ );\n+ const component = renderer.getRenderOutput();\n+ expect(component).toMatchSnapshot();\n+ });\n+});\n", "new_path": "packages/node_modules/@ciscospark/react-component-space-item/src/index.test.js", "old_path": null }, { "change_type": "RENAME", "diff": "display: none;\n}\n-.mid-dot::after {\n- padding: 0 3px;\n- content: '\\b7';\n-}\n-\n@keyframes placeHolderShimmer {\n0% {\nbackground-position: -468px 0;\n", "new_path": "packages/node_modules/@ciscospark/react-component-space-item/src/styles.css", "old_path": "packages/node_modules/@ciscospark/widget-recents/src/components/space-item/styles.css" }, { "change_type": "MODIFY", "diff": "@@ -2,7 +2,7 @@ import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n-import SpaceItem from '../space-item';\n+import SpaceItem from '@ciscospark/react-component-space-item';\nconst propTypes = {\ncurrentUser: PropTypes.shape({\n@@ -15,7 +15,7 @@ const propTypes = {\nspaces: PropTypes.arrayOf(\nPropTypes.shape({\navatarUrl: PropTypes.string,\n- call: PropTypes.object,\n+ callStartTime: PropTypes.number,\nid: PropTypes.string,\nisDecrypting: PropTypes.bool,\nisUnread: PropTypes.bool,\n", "new_path": "packages/node_modules/@ciscospark/widget-recents/src/components/spaces-list/index.js", "old_path": "packages/node_modules/@ciscospark/widget-recents/src/components/spaces-list/index.js" }, { "change_type": "MODIFY", "diff": "@@ -31,6 +31,7 @@ import {events as metricEvents} from '@ciscospark/react-redux-spark-metrics';\nimport LoadingScreen from '@ciscospark/react-component-loading-screen';\nimport Spinner from '@ciscospark/react-component-spinner';\nimport ErrorDisplay from '@ciscospark/react-component-error-display';\n+import CallDataActivityMessage from '@ciscospark/react-component-call-data-activity';\nimport messages from './messages';\nimport getRecentsWidgetProps from './selector';\n@@ -281,9 +282,11 @@ export class RecentsWidget extends Component {\n}\nif (incomingCall && !this.props.incomingCall) {\nconst space = this.getSpaceFromCall(incomingCall);\n+ if (space) {\nthis.handleEvent(eventNames.CALLS_CREATED, constructCallEventData(incomingCall.instance, space));\n}\n}\n+ }\n@autobind\nhandleShowMoreSpaces() {\n@@ -424,7 +427,6 @@ export class RecentsWidget extends Component {\nreturn sparkInstance.phone.on('call:incoming', (call) => this.handleCall(call));\n}\n-\n@autobind\nhandleCall(call) {\nconst {\n@@ -502,6 +504,60 @@ export class RecentsWidget extends Component {\n}\n}\n+ /**\n+ * Generates the activity text for a space based off the latest activity\n+ * @param {Object} space\n+ * @returns {String|Object}\n+ */\n+ @autobind\n+ constructActivityText(space) {\n+ const {props} = this;\n+ const {currentUser} = props;\n+ const {formatMessage} = props.intl;\n+\n+ // Get Activity Text for space\n+ let activityText;\n+\n+ const {isDecrypting, latestActivity} = space;\n+\n+ if (!isDecrypting) {\n+ const {actorName: actorName = '', type: activityType = 'unknown'} = latestActivity;\n+\n+ switch (activityType) {\n+ case 'post': {\n+ activityText = <span>{actorName}<span className={styles.midDot} />{latestActivity.object.displayName}</span>;\n+ break;\n+ }\n+ case 'update': {\n+ if (latestActivity.object.objectType === 'locusSessionSummary') {\n+ activityText = (\n+ <CallDataActivityMessage\n+ actor={latestActivity.actor}\n+ currentUser={currentUser}\n+ duration={latestActivity.object.duration}\n+ isGroupCall={latestActivity.object.isGroupCall}\n+ participants={latestActivity.object.participants.items}\n+ />\n+ );\n+ }\n+ break;\n+ }\n+ case 'share': {\n+ activityText = formatMessage(messages.sharedFile);\n+ break;\n+ }\n+ case 'add': {\n+ activityText = formatMessage(messages.addedToSpace, {actorName, targetName: latestActivity.text.split(' ')[0]});\n+ break;\n+ }\n+ default: {\n+ activityText = '';\n+ }\n+ }\n+ }\n+\n+ return activityText;\n+ }\nrender() {\nconst {props} = this;\n@@ -537,6 +593,12 @@ export class RecentsWidget extends Component {\nconst isWebRTCSupported = media.getIn(['webRTC', 'isSupported']);\nif (spacesList && hasFetchedSpaces) {\n+ const spacesListWithActivityText = spacesList.map((space) => {\n+ const s = Object.assign({}, space);\n+ s.activityText = this.constructActivityText(space);\n+ return s;\n+ });\n+\nconst handleCallClick = isWebRTCSupported ? this.handleSpaceCallClick : undefined;\nreturn (\n<div className={classNames('ciscospark-recents-widget', styles.recentsWidget)}>\n@@ -557,7 +619,7 @@ export class RecentsWidget extends Component {\nhasGroupCalling={hasGroupCalling}\nonCallClick={handleCallClick}\nonClick={this.handleSpaceClick}\n- spaces={spacesList}\n+ spaces={spacesListWithActivityText}\n/>\n{\nshowMoreButton &&\n", "new_path": "packages/node_modules/@ciscospark/widget-recents/src/container.js", "old_path": "packages/node_modules/@ciscospark/widget-recents/src/container.js" }, { "change_type": "MODIFY", "diff": "@@ -133,7 +133,8 @@ const getRecentSpacesWithDetail = createSelector(\nconst avatarItems = avatars.get('items');\nreturn recentSpaces.map((space) => {\n- const s = space;\n+ const s = Object.assign({}, space);\n+ // Get Avatar\nif (avatarItems.count()) {\nif (s.type === 'direct') {\ns.avatarUrl = avatarItems.get(s.toPersonId);\n@@ -142,9 +143,12 @@ const getRecentSpacesWithDetail = createSelector(\ns.avatarUrl = avatarItems.get(s.id);\n}\n}\n- if (calls.size && calls.has(space.locusUrl)) {\n- s.call = calls.get(space.locusUrl);\n+ // Get current call\n+ if (calls.size && calls.has(s.locusUrl)) {\n+ s.call = calls.get(s.locusUrl);\n+ s.callStartTime = s.call.startTime;\n}\n+\nreturn s;\n});\n}\n", "new_path": "packages/node_modules/@ciscospark/widget-recents/src/selector.js", "old_path": "packages/node_modules/@ciscospark/widget-recents/src/selector.js" }, { "change_type": "MODIFY", "diff": "border: 1px #07c1e4;\nborder-radius: 4px;\n}\n+\n+.mid-dot::after {\n+ padding: 0 3px;\n+ content: '\\b7';\n+}\n", "new_path": "packages/node_modules/@ciscospark/widget-recents/src/styles.css", "old_path": "packages/node_modules/@ciscospark/widget-recents/src/styles.css" } ]
JavaScript
MIT License
webex/react-widgets
feat(space-item): moved to individual component
1
feat
space-item
791,723
27.04.2018 13:22:26
25,200
43269549b24aa0606862fff9dec8eebb17696e19
report: add auditIds to DOM. update pptr tests to assert against them
[ { "change_type": "MODIFY", "diff": "@@ -30,6 +30,7 @@ class CategoryRenderer {\nrenderAudit(audit) {\nconst tmpl = this.dom.cloneTemplate('#tmpl-lh-audit', this.templateContext);\nconst auditEl = this.dom.find('.lh-audit', tmpl);\n+ auditEl.id = audit.result.name;\nconst scoreDisplayMode = audit.result.scoreDisplayMode;\nconst description = audit.result.helpText;\n", "new_path": "lighthouse-core/report/html/renderer/category-renderer.js", "old_path": "lighthouse-core/report/html/renderer/category-renderer.js" }, { "change_type": "MODIFY", "diff": "@@ -15,6 +15,7 @@ class PerformanceCategoryRenderer extends CategoryRenderer {\n_renderMetric(audit) {\nconst tmpl = this.dom.cloneTemplate('#tmpl-lh-perf-metric', this.templateContext);\nconst element = this.dom.find('.lh-perf-metric', tmpl);\n+ element.id = audit.result.name;\nelement.classList.add(`lh-perf-metric--${Util.calculateRating(audit.result.score)}`);\nconst titleEl = this.dom.find('.lh-perf-metric__title', tmpl);\n@@ -48,6 +49,7 @@ class PerformanceCategoryRenderer extends CategoryRenderer {\n`lh-perf-hint--${Util.calculateRating(audit.result.score)}`,\n'lh-expandable-details',\n].join(' '));\n+ element.id = audit.result.name;\nconst summary = this.dom.createChildOf(element, 'summary', 'lh-perf-hint__summary ' +\n'lh-expandable-details__summary');\n@@ -136,6 +138,7 @@ class PerformanceCategoryRenderer extends CategoryRenderer {\nconst thumbnailAudit = category.audits.find(audit => audit.id === 'screenshot-thumbnails');\nconst thumbnailResult = thumbnailAudit && thumbnailAudit.result;\nif (thumbnailResult && thumbnailResult.details) {\n+ timelineEl.id = thumbnailResult.name;\nconst thumbnailDetails = /** @type {!DetailsRenderer.FilmstripDetails} */\n(thumbnailResult.details);\nconst filmstripEl = this.detailsRenderer.render(thumbnailDetails);\n", "new_path": "lighthouse-core/report/html/renderer/performance-category-renderer.js", "old_path": "lighthouse-core/report/html/renderer/performance-category-renderer.js" }, { "change_type": "MODIFY", "diff": "@@ -205,6 +205,7 @@ if (typeof module !== 'undefined' && module.exports) {\n/**\n* @typedef {{\n* rawValue: (number|boolean|undefined),\n+ * name: string,\n* description: string,\n* informative: (boolean|undefined),\n* manual: (boolean|undefined),\n", "new_path": "lighthouse-core/report/html/renderer/report-renderer.js", "old_path": "lighthouse-core/report/html/renderer/report-renderer.js" }, { "change_type": "MODIFY", "diff": "@@ -27,14 +27,26 @@ describe('Lighthouse chrome extension', function() {\nlet extensionPage;\nlet originalManifest;\n- function getAuditElementsCount({category, selector}) {\n+ function getAuditElementsIds({category, selector}) {\nreturn extensionPage.evaluate(\n- ({category, selector}) =>\n- document.querySelector(`#${category}`).parentNode.querySelectorAll(selector).length,\n- {category, selector}\n+ ({category, selector}) => {\n+ const elems = document.querySelector(`#${category}`).parentNode.querySelectorAll(selector);\n+ return Array.from(elems).map(el => el.id);\n+ }, {category, selector}\n);\n}\n+ function getCategoryElementsIds() {\n+ return extensionPage.evaluate(\n+ () => {\n+ const elems = Array.from(document.querySelectorAll(`.lh-category`));\n+ return elems.map(el => {\n+ const permalink = el.querySelector('.lh-permalink');\n+ return permalink && permalink.id;\n+ });\n+ });\n+ }\n+\nbefore(async function() {\n// eslint-disable-next-line\nthis.timeout(90 * 1000);\n@@ -110,26 +122,26 @@ describe('Lighthouse chrome extension', function() {\n};\nit('should contain all categories', async () => {\n- const categories = await extensionPage.$$(`#${lighthouseCategories.join(',#')}`);\n- assert.equal(\n- categories.length,\n- lighthouseCategories.length,\n- `${categories.join(' ')} does not match ${lighthouseCategories.join(' ')}`\n+ const categories = await getCategoryElementsIds();\n+ assert.deepStrictEqual(\n+ categories.sort(),\n+ lighthouseCategories.sort(),\n+ `all categories not found`\n);\n});\nit('should contain audits of all categories', async () => {\nfor (const category of lighthouseCategories) {\n- let expected = getAuditsOfCategory(category).length;\n+ let expected = getAuditsOfCategory(category);\nif (category === 'performance') {\n- expected = getAuditsOfCategory(category).filter(a => !!a.group).length;\n+ expected = getAuditsOfCategory(category).filter(a => !!a.group);\n}\n+ expected = expected.map(audit => audit.id);\n+ const elementIds = await getAuditElementsIds({category, selector: selectors.audits});\n- const elementCount = await getAuditElementsCount({category, selector: selectors.audits});\n-\n- assert.equal(\n- expected,\n- elementCount,\n+ assert.deepStrictEqual(\n+ elementIds.sort(),\n+ expected.sort(),\n`${category} does not have the correct amount of audits`\n);\n}\n", "new_path": "lighthouse-extension/test/extension-test.js", "old_path": "lighthouse-extension/test/extension-test.js" }, { "change_type": "MODIFY", "diff": "@@ -29,14 +29,26 @@ describe('Lighthouse Viewer', function() {\nlet viewerPage;\nconst pageErrors = [];\n- function getAuditElementsCount({category, selector}) {\n+ function getAuditElementsIds({category, selector}) {\nreturn viewerPage.evaluate(\n- ({category, selector}) =>\n- document.querySelector(`#${category}`).parentNode.querySelectorAll(selector).length,\n- {category, selector}\n+ ({category, selector}) => {\n+ const elems = document.querySelector(`#${category}`).parentNode.querySelectorAll(selector);\n+ return Array.from(elems).map(el => el.id);\n+ }, {category, selector}\n);\n}\n+ function getCategoryElementsIds() {\n+ return viewerPage.evaluate(\n+ () => {\n+ const elems = Array.from(document.querySelectorAll(`.lh-category`));\n+ return elems.map(el => {\n+ const permalink = el.querySelector('.lh-permalink');\n+ return permalink && permalink.id;\n+ });\n+ });\n+ }\n+\nbefore(async function() {\nserver.listen(portNumber, 'localhost');\n@@ -71,27 +83,27 @@ describe('Lighthouse Viewer', function() {\n});\nit('should contain all categories', async () => {\n- const categories = await viewerPage.$$(`#${lighthouseCategories.join(',#')}`);\n- assert.equal(\n- categories.length,\n- lighthouseCategories.length,\n- `${categories.join(' ')} does not match ${lighthouseCategories.join(' ')}`\n+ const categories = await getCategoryElementsIds();\n+ assert.deepStrictEqual(\n+ categories.sort(),\n+ lighthouseCategories.sort(),\n+ `all categories not found`\n);\n});\nit('should contain audits of all categories', async () => {\nfor (const category of lighthouseCategories) {\n- let expected = getAuditsOfCategory(category).length;\n+ let expected = getAuditsOfCategory(category);\nif (category === 'performance') {\n- expected = getAuditsOfCategory(category).filter(a => !!a.group).length;\n+ expected = getAuditsOfCategory(category).filter(a => !!a.group);\n}\n+ expected = expected.map(audit => audit.id);\n+ const elementIds = await getAuditElementsIds({category, selector: selectors.audits});\n- const elementCount = await getAuditElementsCount({category, selector: selectors.audits});\n-\n- assert.equal(\n- expected,\n- elementCount,\n- `${category} does not have the correct amount of audits`\n+ assert.deepStrictEqual(\n+ elementIds.sort(),\n+ expected.sort(),\n+ `${category} does not have the identical audits`\n);\n}\n});\n", "new_path": "lighthouse-viewer/test/viewer-test-pptr.js", "old_path": "lighthouse-viewer/test/viewer-test-pptr.js" } ]
JavaScript
Apache License 2.0
googlechrome/lighthouse
report: add auditIds to DOM. update pptr tests to assert against them (#5058)
1
report
null
807,849
27.04.2018 13:37:56
25,200
4da631812783349ebb0d3a54923746a6050550cb
feat(project): Map deprecated config to new namespaces
[ { "change_type": "ADD", "diff": "+{\n+ \"packages\": [\n+ \"base-pkgs/*\"\n+ ],\n+ \"command\": {\n+ \"publish\": {\n+ \"loglevel\": \"success\"\n+ }\n+ },\n+ \"version\": \"ignored\"\n+}\n", "new_path": "core/project/__fixtures__/extends-deprecated/base.json", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"extends\": \"./recursive.json\",\n+ \"commands\": {\n+ \"bootstrap\": {\n+ \"hoist\": true\n+ }\n+ },\n+ \"version\": \"1.0.0\"\n+}\n", "new_path": "core/project/__fixtures__/extends-deprecated/lerna.json", "old_path": null }, { "change_type": "ADD", "diff": "+{\n+ \"extends\": \"./base.json\",\n+ \"packages\": [\n+ \"recursive-pkgs/*\"\n+ ],\n+ \"commands\": {\n+ \"publish\": {\n+ \"ignore\": [\n+ \"ignored-file\"\n+ ]\n+ }\n+ }\n+}\n", "new_path": "core/project/__fixtures__/extends-deprecated/recursive.json", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -127,6 +127,17 @@ describe(\"Project\", () => {\n});\n});\n+ it(\"renames deprecated config recursively\", async () => {\n+ const cwd = await initFixture(\"extends-deprecated\");\n+ const project = new Project(cwd);\n+\n+ expect(project.config).not.toHaveProperty(\"commands\");\n+ expect(project.config).not.toHaveProperty(\"command.publish.ignore\");\n+ expect(project.config).toHaveProperty(\"command.publish.ignoreChanges\", [\"ignored-file\"]);\n+ expect(project.config).toHaveProperty(\"command.publish.loglevel\", \"success\");\n+ expect(project.config).toHaveProperty(\"command.bootstrap.hoist\", true);\n+ });\n+\nit(\"throws an error when extend target is unresolvable\", async () => {\nconst cwd = await initFixture(\"extends-unresolved\");\n@@ -223,6 +234,16 @@ describe(\"Project\", () => {\nexpect(project.manifest).toBe(project.manifest);\n});\n+ it(\"defaults package.json name field when absent\", async () => {\n+ const cwd = await initFixture(\"basic\");\n+ const manifestLocation = path.join(cwd, \"package.json\");\n+\n+ await fs.writeJSON(manifestLocation, { private: true }, { spaces: 2 });\n+\n+ const project = new Project(cwd);\n+ expect(project.manifest).toHaveProperty(\"name\", path.basename(cwd));\n+ });\n+\nit(\"does not cache failures\", async () => {\nconst cwd = await initFixture(\"basic\");\nconst manifestLocation = path.join(cwd, \"package.json\");\n", "new_path": "core/project/__tests__/project.test.js", "old_path": "core/project/__tests__/project.test.js" }, { "change_type": "MODIFY", "diff": "@@ -11,6 +11,7 @@ const writeJsonFile = require(\"write-json-file\");\nconst ValidationError = require(\"@lerna/validation-error\");\nconst Package = require(\"@lerna/package\");\nconst applyExtends = require(\"./lib/apply-extends\");\n+const deprecateConfig = require(\"./lib/deprecate-config\");\nclass Project {\nconstructor(cwd) {\n@@ -31,11 +32,8 @@ class Project {\n};\n}\n- // normalize command-specific config namespace\n- if (obj.config.commands) {\n- obj.config.command = obj.config.commands;\n- delete obj.config.commands;\n- }\n+ // rename deprecated durable config\n+ deprecateConfig(obj.config, obj.filepath);\nobj.config = applyExtends(obj.config, path.dirname(obj.filepath));\n", "new_path": "core/project/index.js", "old_path": "core/project/index.js" }, { "change_type": "MODIFY", "diff": "const path = require(\"path\");\nconst resolveFrom = require(\"resolve-from\");\nconst ValidationError = require(\"@lerna/validation-error\");\n+const deprecateConfig = require(\"./deprecate-config\");\nconst shallowExtend = require(\"./shallow-extend\");\nmodule.exports = applyExtends;\n@@ -29,6 +30,8 @@ function applyExtends(config, cwd, seen = new Set()) {\ndefaultConfig = require(pathToDefault);\ndelete config.extends; // eslint-disable-line no-param-reassign\n+ deprecateConfig(defaultConfig, pathToDefault);\n+\ndefaultConfig = applyExtends(defaultConfig, path.dirname(pathToDefault), seen);\n}\n", "new_path": "core/project/lib/apply-extends.js", "old_path": "core/project/lib/apply-extends.js" }, { "change_type": "ADD", "diff": "+\"use strict\";\n+\n+const dotProp = require(\"dot-prop\");\n+const log = require(\"npmlog\");\n+const path = require(\"path\");\n+\n+module.exports = compose(\n+ // add new predicates HERE\n+ remap(\"command.publish.ignore\", \"command.publish.ignoreChanges\"),\n+ remap(\"commands\", \"command\"),\n+ (config, filepath) => ({ config, filepath })\n+);\n+\n+/**\n+ * Remap deprecated config properties, if they exist.\n+ * The returned predicate mutates the `config` parameter.\n+ *\n+ * @param {String} search Path to deprecated option\n+ * @param {String} replace Path of renamed option\n+ * @return {Function} predicate accepting (config, filepath)\n+ */\n+function remap(search, replace) {\n+ return obj => {\n+ if (dotProp.has(obj.config, search)) {\n+ const localPath = path.relative(\".\", obj.filepath);\n+\n+ log.warn(\n+ \"project\",\n+ `Deprecated key \"${search}\" found in ${localPath}\\nPlease rename \"${search}\" => \"${replace}\"`\n+ );\n+\n+ dotProp.set(obj.config, replace, dotProp.get(obj.config, search));\n+ dotProp.delete(obj.config, search);\n+ }\n+\n+ return obj;\n+ };\n+}\n+\n+function compose(...funcs) {\n+ return funcs.reduce((a, b) => (...args) => a(b(...args)));\n+}\n", "new_path": "core/project/lib/deprecate-config.js", "old_path": null }, { "change_type": "MODIFY", "diff": "\"@lerna/validation-error\": \"file:../validation-error\",\n\"cosmiconfig\": \"^4.0.0\",\n\"dedent\": \"^0.7.0\",\n+ \"dot-prop\": \"^4.2.0\",\n\"glob-parent\": \"^3.1.0\",\n\"load-json-file\": \"^4.0.0\",\n\"npmlog\": \"^4.1.2\",\n", "new_path": "core/project/package.json", "old_path": "core/project/package.json" }, { "change_type": "MODIFY", "diff": "@@ -56,6 +56,8 @@ Object {\nexports[`lerna init updates existing metadata: stderr 1`] = `\nlerna info version __TEST_VERSION__\n+lerna WARN project Deprecated key \"commands\" found in lerna.json\n+lerna WARN project Please rename \"commands\" => \"command\"\nlerna info Updating package.json\nlerna info Updating lerna.json\nlerna info Creating packages directory\n", "new_path": "integration/__snapshots__/lerna-init.test.js.snap", "old_path": "integration/__snapshots__/lerna-init.test.js.snap" }, { "change_type": "MODIFY", "diff": "\"@lerna/validation-error\": \"file:core/validation-error\",\n\"cosmiconfig\": \"4.0.0\",\n\"dedent\": \"0.7.0\",\n+ \"dot-prop\": \"4.2.0\",\n\"glob-parent\": \"3.1.0\",\n\"load-json-file\": \"4.0.0\",\n\"npmlog\": \"4.1.2\",\n\"requires\": {\n\"array-ify\": \"1.0.0\",\n\"dot-prop\": \"3.0.0\"\n+ },\n+ \"dependencies\": {\n+ \"dot-prop\": {\n+ \"version\": \"3.0.0\",\n+ \"resolved\": \"https://registry.npmjs.org/dot-prop/-/dot-prop-3.0.0.tgz\",\n+ \"integrity\": \"sha1-G3CK8JSknJoOfbyteQq6U52sEXc=\",\n+ \"requires\": {\n+ \"is-obj\": \"1.0.1\"\n+ }\n+ }\n}\n},\n\"compare-versions\": {\n}\n},\n\"dot-prop\": {\n- \"version\": \"3.0.0\",\n- \"resolved\": \"https://registry.npmjs.org/dot-prop/-/dot-prop-3.0.0.tgz\",\n- \"integrity\": \"sha1-G3CK8JSknJoOfbyteQq6U52sEXc=\",\n+ \"version\": \"4.2.0\",\n+ \"resolved\": \"https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz\",\n+ \"integrity\": \"sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==\",\n\"requires\": {\n\"is-obj\": \"1.0.1\"\n}\n", "new_path": "package-lock.json", "old_path": "package-lock.json" } ]
JavaScript
MIT License
lerna/lerna
feat(project): Map deprecated config to new namespaces
1
feat
project
807,849
27.04.2018 13:53:13
25,200
ccac74acb502a6568518182841f9e9ce17bcf21b
refactor(collect-updates): Destructure options explicitly
[ { "change_type": "MODIFY", "diff": "@@ -10,7 +10,13 @@ const makeDiffPredicate = require(\"./lib/make-diff-predicate\");\nmodule.exports = collectUpdates;\n-function collectUpdates({ filteredPackages, packageGraph, options, execOpts, logger }) {\n+function collectUpdates({\n+ filteredPackages,\n+ packageGraph,\n+ options: { canary, cdVersion, forcePublish, ignoreChanges, since },\n+ execOpts,\n+ logger,\n+}) {\nconst packages =\nfilteredPackages.length === packageGraph.size\n? packageGraph\n@@ -18,10 +24,10 @@ function collectUpdates({ filteredPackages, packageGraph, options, execOpts, log\nlogger.info(\"\", \"Checking for updated packages...\");\n- let { since: committish } = options;\n+ let committish = since;\nif (hasTags(execOpts)) {\n- if (options.canary) {\n+ if (canary) {\nconst sha = childProcess.execSync(\"git\", [\"rev-parse\", \"--short\", \"HEAD\"], execOpts);\n// if it's a merge commit, it will return all the commits that were part of the merge\n@@ -34,7 +40,7 @@ function collectUpdates({ filteredPackages, packageGraph, options, execOpts, log\nlogger.info(\"\", `Comparing with ${committish || \"initial commit\"}.`);\n- const forced = getForcedPackages(options.forcePublish);\n+ const forced = getForcedPackages(forcePublish);\nlet candidates;\nif (!committish || forced.has(\"*\")) {\n@@ -42,9 +48,8 @@ function collectUpdates({ filteredPackages, packageGraph, options, execOpts, log\n} else {\ncandidates = new Set();\n- const ignorePatterns = options.ignore || options.ignoreChanges; // \"ignore\" might be durable\n- const hasDiff = makeDiffPredicate(committish, execOpts, ignorePatterns);\n- const needsBump = (options.cdVersion || \"\").startsWith(\"pre\")\n+ const hasDiff = makeDiffPredicate(committish, execOpts, ignoreChanges);\n+ const needsBump = (cdVersion || \"\").startsWith(\"pre\")\n? () => false\n: /* skip packages that have not been previously prereleased */\nnode => semver.prerelease(node.version);\n@@ -59,7 +64,7 @@ function collectUpdates({ filteredPackages, packageGraph, options, execOpts, log\nconst dependents = collectDependents(candidates);\ndependents.forEach(node => candidates.add(node));\n- if (options.canary || packages.size === candidates.size) {\n+ if (canary || packages.size === candidates.size) {\nlogger.verbose(\"updated\", \"(short-circuit)\");\nreturn Array.from(candidates);\n", "new_path": "utils/collect-updates/collect-updates.js", "old_path": "utils/collect-updates/collect-updates.js" } ]
JavaScript
MIT License
lerna/lerna
refactor(collect-updates): Destructure options explicitly
1
refactor
collect-updates
807,849
27.04.2018 13:54:49
25,200
90df64633a858c9d5ff0c766021c58cd9ddac4ae
fix(collect-updates): Derive most recent tag from annotated tags only BREAKING CHANGE: Lightweight tags are no longer included when detecting changes since the last release.
[ { "change_type": "MODIFY", "diff": "@@ -34,7 +34,8 @@ function collectUpdates({\n// ex: If `ab7533e` had 2 commits, ab7533e^..ab7533e would contain 2 commits + the merge commit\ncommittish = `${sha}^..${sha}`;\n} else if (!committish) {\n- committish = childProcess.execSync(\"git\", [\"describe\", \"--tags\", \"--abbrev=0\"], execOpts);\n+ // attempt to find the last annotated tag in the current branch\n+ committish = childProcess.execSync(\"git\", [\"describe\", \"--abbrev=0\"], execOpts);\n}\n}\n", "new_path": "utils/collect-updates/collect-updates.js", "old_path": "utils/collect-updates/collect-updates.js" } ]
JavaScript
MIT License
lerna/lerna
fix(collect-updates): Derive most recent tag from annotated tags only BREAKING CHANGE: Lightweight tags are no longer included when detecting changes since the last release.
1
fix
collect-updates
730,414
27.04.2018 13:55:09
14,400
1aa1a8d530f32a38549736da648991f509cfeb1e
chore: remove .npmrc backup
[ { "change_type": "MODIFY", "diff": "@@ -207,9 +207,6 @@ ansiColor('xterm') {\nstring(credentialsId: 'NPM_TOKEN', variable: 'NPM_TOKEN')\n]) {\ntry {\n- // Back up .npmrc\n- sh '[ -f $HOME/.npmrc ] && mv $HOME/.npmrc $HOME/.npmrc.bak'\n- // Publish\nsh 'echo \\'//registry.npmjs.org/:_authToken=${NPM_TOKEN}\\' > $HOME/.npmrc'\necho ''\necho 'Reminder: E403 errors below are normal. They occur for any package that has no updates to publish'\n@@ -219,8 +216,6 @@ ansiColor('xterm') {\nnvm use v8.9.1\nnpm run publish:components\n'''\n- // Restore .npmrc\n- sh '[ -f $HOME/.npmrc.bak ] && mv $HOME/.npmrc.bak $HOME/.npmrc'\n}\ncatch (error) {\nwarn(\"failed to publish to npm ${error.toString()}\")\n", "new_path": "Jenkinsfile", "old_path": "Jenkinsfile" } ]
JavaScript
MIT License
webex/react-widgets
chore: remove .npmrc backup
1
chore
null
730,422
27.04.2018 14:46:28
25,200
ad3dace0f3ec06fc183fc9da9846562a68c88eae
refactor(react-component): array to arrayOf proptypes
[ { "change_type": "MODIFY", "diff": "@@ -16,7 +16,14 @@ const propTypes = {\ncontent: PropTypes.string,\ndisplayName: PropTypes.string,\nfiles: PropTypes.shape({\n- items: PropTypes.array\n+ items: PropTypes.arrayOf(PropTypes.shape({\n+ image: PropTypes.shape({\n+ url: PropTypes.string\n+ }),\n+ thumbnail: PropTypes.string,\n+ mimeType: PropTypes.string,\n+ url: PropTypes.string\n+ }))\n})\n}).isRequired,\nverb: PropTypes.string.isRequired\n", "new_path": "packages/node_modules/@ciscospark/react-component-activity-item/src/index.js", "old_path": "packages/node_modules/@ciscospark/react-component-activity-item/src/index.js" }, { "change_type": "MODIFY", "diff": "@@ -20,10 +20,17 @@ const propTypes = {\ncontent: PropTypes.string,\ndisplayName: PropTypes.string,\nfiles: PropTypes.shape({\n- items: PropTypes.array\n+ items: PropTypes.arrayOf(PropTypes.shape({\n+ image: PropTypes.shape({\n+ url: PropTypes.string\n+ }),\n+ thumbnail: PropTypes.string,\n+ mimeType: PropTypes.string,\n+ url: PropTypes.string\n+ }))\n})\n- }).isRequired,\n- actor: PropTypes.object,\n+ }),\n+ actor: PropTypes.object, // Are we even using it?\npublished: PropTypes.string,\nverb: PropTypes.string\n}),\n", "new_path": "packages/node_modules/@ciscospark/react-component-activity-list/src/index.js", "old_path": "packages/node_modules/@ciscospark/react-component-activity-list/src/index.js" }, { "change_type": "MODIFY", "diff": "@@ -8,7 +8,11 @@ import {bytesToSize} from '@ciscospark/react-component-utils';\nimport styles from './styles.css';\nconst propTypes = {\n- file: PropTypes.object.isRequired,\n+ file: PropTypes.shape({\n+ displayName: PropTypes.string,\n+ fileSize: PropTypes.number,\n+ objectType: PropTypes.string\n+ }).isRequired,\nisPending: PropTypes.bool,\nonDownloadClick: PropTypes.func.isRequired\n};\n", "new_path": "packages/node_modules/@ciscospark/react-component-activity-share-file/src/index.js", "old_path": "packages/node_modules/@ciscospark/react-component-activity-share-file/src/index.js" }, { "change_type": "MODIFY", "diff": "@@ -11,7 +11,14 @@ import styles from './styles.css';\nconst propTypes = {\ncontent: PropTypes.string,\ndisplayName: PropTypes.string,\n- files: PropTypes.array.isRequired,\n+ files: PropTypes.arrayOf(PropTypes.shape({\n+ image: PropTypes.shape({\n+ url: PropTypes.string\n+ }),\n+ thumbnail: PropTypes.string,\n+ mimeType: PropTypes.string,\n+ url: PropTypes.string\n+ })).isRequired,\nisPending: PropTypes.bool,\nonDownloadClick: PropTypes.func.isRequired,\nshare: PropTypes.object.isRequired\n", "new_path": "packages/node_modules/@ciscospark/react-component-activity-share-files/src/index.js", "old_path": "packages/node_modules/@ciscospark/react-component-activity-share-files/src/index.js" }, { "change_type": "MODIFY", "diff": "@@ -9,7 +9,11 @@ import {bytesToSize} from '@ciscospark/react-component-utils';\nimport styles from './styles.css';\nconst propTypes = {\n- file: PropTypes.object.isRequired,\n+ file: PropTypes.shape({\n+ displayName: PropTypes.string,\n+ fileSize: PropTypes.number,\n+ objectType: PropTypes.string\n+ }).isRequired,\nisFetching: PropTypes.bool,\nisPending: PropTypes.bool,\nobjectUrl: PropTypes.string,\n", "new_path": "packages/node_modules/@ciscospark/react-component-activity-share-thumbnail/src/index.js", "old_path": "packages/node_modules/@ciscospark/react-component-activity-share-thumbnail/src/index.js" }, { "change_type": "MODIFY", "diff": "@@ -10,7 +10,11 @@ const defaultProps = {\n};\nconst propTypes = {\n- file: PropTypes.object.isRequired,\n+ file: PropTypes.shape({\n+ displayName: PropTypes.string,\n+ fileSize: PropTypes.number,\n+ objectType: PropTypes.string\n+ }).isRequired,\nisFetching: PropTypes.bool.isRequired,\nisPending: PropTypes.bool,\nobjectUrl: PropTypes.string,\n", "new_path": "packages/node_modules/@ciscospark/react-component-file-share-display/src/index.js", "old_path": "packages/node_modules/@ciscospark/react-component-file-share-display/src/index.js" }, { "change_type": "MODIFY", "diff": "@@ -8,7 +8,15 @@ import ChipFile from '@ciscospark/react-component-chip-file';\nimport styles from './styles.css';\nconst propTypes = {\n- files: PropTypes.object.isRequired,\n+ files: PropTypes.shape({\n+ items: PropTypes.arrayOf(PropTypes.shape({\n+ name: PropTypes.string,\n+ type: PropTypes.string,\n+ id: PropTypes.string,\n+ thumbnail: PropTypes.string,\n+ fileSize: PropTypes.number\n+ }))\n+ }).isRequired,\nonFileRemove: PropTypes.func.isRequired,\nonSubmit: PropTypes.func.isRequired\n};\n", "new_path": "packages/node_modules/@ciscospark/react-component-file-staging-area/src/index.js", "old_path": "packages/node_modules/@ciscospark/react-component-file-staging-area/src/index.js" } ]
JavaScript
MIT License
webex/react-widgets
refactor(react-component): array to arrayOf proptypes
1
refactor
react-component
679,913
27.04.2018 16:10:04
-3,600
6f95bcb39d13432d91d47df55dac8e557962cb7e
feat(rstream-query): add obj->triple converter, update readme & example
[ { "change_type": "MODIFY", "diff": "@@ -53,30 +53,47 @@ yarn add @thi.ng/rstream-query\n## Usage examples\n```typescript\n+import { TripleStore, asTriples } from \"@thi.ng/rstream-query\";\nimport { trace } from \"@thi.ng/rstream\";\n-import { TripleStore } from \"../src\";\n// create store with initial set of triples / facts\nconst store = new TripleStore([\n[\"london\", \"type\", \"city\"],\n[\"london\", \"part-of\", \"uk\"],\n[\"portland\", \"type\", \"city\"],\n- [\"portland\", \"part-of\", \"oregon\"],\n- [\"portland\", \"part-of\", \"usa\"],\n+ [\"portland\", \"partOf\", \"oregon\"],\n+ [\"portland\", \"partOf\", \"usa\"],\n[\"oregon\", \"type\", \"state\"],\n[\"usa\", \"type\", \"country\"],\n[\"uk\", \"type\", \"country\"],\n]);\n+// alternatively, convert an object into a sequence of triples\n+const store = new TripleStore(asTriples({\n+ london: {\n+ type: \"city\",\n+ partOf: \"uk\"\n+ },\n+ portland: {\n+ type: \"city\",\n+ partOf: [\"oregon\", \"usa\"]\n+ },\n+ oregon: { type: \"state\" },\n+ uk: { type: \"country\" },\n+ usa: { type: \"country\" },\n+});\n+\n// compile the below query spec into a dataflow graph\n// pattern items prefixed w/ \"?\" are query variables\n// this query matches the following relationships\n// using all currently known triples in the store\n+// when matching triples are added or removed, the query\n+// result updates automatically...\n-// currently only \"where\" and \"path\" sub-queries are possible\n+// currently only \"where\" and bounded \"path\" sub-queries are possible\n// in the near future, more query types will be supported\n-// (e.g. optional relationships, filters etc.)\n+// (e.g. optional relationships, pre/post filters etc.)\nstore.addQueryFromSpec({\nq: [\n{\n@@ -85,7 +102,7 @@ store.addQueryFromSpec({\n// match any subject of type \"city\"\n[\"?city\", \"type\", \"city\"],\n// match each ?city var's \"part-of\" relationships (if any)\n- [\"?city\", \"part-of\", \"?country\"],\n+ [\"?city\", \"partOf\", \"?country\"],\n// matched ?country var must have type = \"country\"\n[\"?country\", \"type\", \"country\"]\n]\n@@ -100,7 +117,8 @@ store.addQueryFromSpec({\n},\n// another post-processing step, only keeps \"answer\" var in results\nselect: [\"answer\"]\n-}).subscribe(trace(\"results\"))\n+})\n+.subscribe(trace(\"results\"))\n// results Set {\n// { answer: 'london is located in uk' },\n// { answer: 'portland is located in usa' } }\n@@ -109,7 +127,7 @@ store.addQueryFromSpec({\nconst addCity = (name, country) =>\nstore.into([\n[name, \"type\", \"city\"],\n- [name, \"part-of\", country],\n+ [name, \"partOf\", country],\n[country, \"type\", \"country\"],\n]);\n", "new_path": "packages/rstream-query/README.md", "old_path": "packages/rstream-query/README.md" }, { "change_type": "ADD", "diff": "+import { isArray } from \"@thi.ng/checks/is-array\";\n+import { isPlainObject } from \"@thi.ng/checks/is-plain-object\";\n+import { concat } from \"@thi.ng/transducers/iter/concat\";\n+import { pairs } from \"@thi.ng/transducers/iter/pairs\";\n+import { iterator } from \"@thi.ng/transducers/iterator\";\n+import { mapcat } from \"@thi.ng/transducers/xform/mapcat\";\n+\n+let NEXT_ID = 0;\n+\n+const mapBNode = (s: any, p: any, o: any) => {\n+ const id = `__b${NEXT_ID++}__`;\n+ return concat([[s, p, id]], asTriples(o, id));\n+};\n+\n+const mapSubject = (subject: any) =>\n+ ([p, o]) => {\n+ if (isArray(o)) {\n+ return iterator(\n+ mapcat((o) =>\n+ isPlainObject(o) ?\n+ mapBNode(subject, p, o) :\n+ [[subject, p, o]]),\n+ o);\n+ } else if (isPlainObject(o)) {\n+ return mapBNode(subject, p, o);\n+ }\n+ return [[subject, p, o]];\n+ };\n+\n+/**\n+ * Converts given object into an iterable of triples, with the following\n+ * conversion rules:\n+ *\n+ * - Toplevel object keys are used as subjects and MUST each have a\n+ * plain object as value, where its keys are used as predicates and\n+ * values as objects (in the SPO sense).\n+ * - Plain objects in SPO object position are translated into unique IDs\n+ * in order to allow the nested map to become a subject itself. In RDF\n+ * terms, this is equivalent to BNodes.\n+ * - Arrays in SPO object position cause multiple triples with same\n+ * subject & predicate to be emitted. If any of the items in the array\n+ * is a plain object, it will be treated as BNode and transformed as\n+ * described in the previous rule\n+ *\n+ * ```\n+ * src = {\n+ * \"@thi.ng/rstream-query\": {\n+ * type: \"project\",\n+ * author: \"toxi\",\n+ * tag: [\"ES6\", \"TypeScript\", \"graph\"]\n+ * },\n+ * toxi: {\n+ * type: \"person\",\n+ * hasAccount: [\n+ * {type: \"twitter\", id: \"toxi\"},\n+ * {type: \"github\", id: \"postspectacular\"}\n+ * ]\n+ * }\n+ * };\n+ *\n+ * [...asTriples(src)]\n+ * // [ [ '@thi.ng/rstream-query', 'type', 'project' ],\n+ * // [ '@thi.ng/rstream-query', 'author', 'toxi' ],\n+ * // [ '@thi.ng/rstream-query', 'tag', 'ES6' ],\n+ * // [ '@thi.ng/rstream-query', 'tag', 'TypeScript' ],\n+ * // [ '@thi.ng/rstream-query', 'tag', 'graph' ],\n+ * // [ 'toxi', 'type', 'person' ],\n+ * // [ 'toxi', 'hasAccount', '__b0__' ],\n+ * // [ '__b0__', 'type', 'twitter' ],\n+ * // [ '__b0__', 'id', 'toxi' ],\n+ * // [ 'toxi', 'hasAccount', '__b1__' ],\n+ * // [ '__b1__', 'type', 'github' ],\n+ * // [ '__b1__', 'id', 'postspectacular' ] ]\n+ * ```\n+ *\n+ * @param obj\n+ * @param subject internal use only, do not specify!\n+ */\n+export const asTriples = (obj: any, subject?: any) =>\n+ iterator(\n+ mapcat(\n+ subject === undefined ?\n+ ([s, v]: any) => iterator(mapcat(mapSubject(s)), <any>pairs(v)) :\n+ mapSubject(subject)\n+ ),\n+ pairs(obj));\n", "new_path": "packages/rstream-query/src/convert.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "export * from \"./api\";\n+export * from \"./convert\";\nexport * from \"./pattern\";\nexport * from \"./qvar\";\nexport * from \"./store\";\n", "new_path": "packages/rstream-query/src/index.ts", "old_path": "packages/rstream-query/src/index.ts" }, { "change_type": "MODIFY", "diff": "@@ -219,7 +219,7 @@ export class TripleStore implements\n}\n}\nreturn emitTriples ?\n- results.subscribe(asTriples(this)) :\n+ results.subscribe(resultTriples(this)) :\nresults;\n}\n@@ -432,7 +432,7 @@ const indexSel = (key: any): Transducer<Edit, TripleIds> =>\n);\n};\n-const asTriples = (graph: TripleStore) =>\n+const resultTriples = (graph: TripleStore) =>\nmap<TripleIds, Set<Triple>>(\n(ids) => {\nconst res = new Set<Triple>();\n", "new_path": "packages/rstream-query/src/store.ts", "old_path": "packages/rstream-query/src/store.ts" }, { "change_type": "MODIFY", "diff": "import { trace } from \"@thi.ng/rstream\";\n-import { TripleStore } from \"../src\";\n+import * as q from \"../src\";\n-const store = new TripleStore([\n+const store = new q.TripleStore([\n[\"london\", \"type\", \"city\"],\n[\"london\", \"part-of\", \"uk\"],\n[\"portland\", \"type\", \"city\"],\n@@ -12,6 +12,21 @@ const store = new TripleStore([\n[\"uk\", \"type\", \"country\"],\n]);\n+// alternatively, convert an object into a sequence of triples\n+// const store = new q.TripleStore(q.asTriples({\n+// london: {\n+// type: \"city\",\n+// partOf: \"uk\"\n+// },\n+// portland: {\n+// type: \"city\",\n+// partOf: [\"oregon\", \"usa\"]\n+// },\n+// oregon: { type: \"state\" },\n+// uk: { type: \"country\" },\n+// usa: { type: \"country\" },\n+// }));\n+\n// compile the below query spec into a dataflow graph\n// pattern items prefixed w/ \"?\" are query variables\n@@ -28,7 +43,7 @@ store.addQueryFromSpec({\n// first match any subject of type \"city\"\n[\"?city\", \"type\", \"city\"],\n// then a city's \"part-of\" relationships (if any)\n- [\"?city\", \"part-of\", \"?country\"],\n+ [\"?city\", \"partOf\", \"?country\"],\n// the matched ?country must have type = \"country\"\n[\"?country\", \"type\", \"country\"]\n]\n@@ -52,7 +67,7 @@ store.addQueryFromSpec({\nconst addCity = (name, country) =>\nstore.into([\n[name, \"type\", \"city\"],\n- [name, \"part-of\", country],\n+ [name, \"partOf\", country],\n[country, \"type\", \"country\"],\n]);\n", "new_path": "packages/rstream-query/test/example.ts", "old_path": "packages/rstream-query/test/example.ts" } ]
TypeScript
Apache License 2.0
thi-ng/umbrella
feat(rstream-query): add obj->triple converter, update readme & example
1
feat
rstream-query
217,922
27.04.2018 16:46:13
-7,200
c0fee7a0327927bdb6c03731bd176b9df1c8caa0
chore(simulator): linear mode, reliability report
[ { "change_type": "MODIFY", "diff": "@@ -12,13 +12,13 @@ export abstract class CraftingAction {\nabstract canBeUsed(simulationState: Simulation): boolean;\n- public getCPCost(simulationState: Simulation): number {\n+ public getCPCost(simulationState: Simulation, linear = false): number {\nconst baseCPCost = this.getBaseCPCost(simulationState);\nif (simulationState.hasBuff(Buff.INITIAL_PREPARATIONS)) {\n// According to this reddit topic:\n// https://www.reddit.com/r/ffxiv/comments/7s4ilp/advanced_crafting_theory_and_math_recipe_level/\n// Initial preparation has 20% chances to proc and applies a 30% reduction to CP cost, let's reflect that here.\n- const roll = Math.random() * 100;\n+ const roll = linear ? 101 : Math.random() * 100;\nif (roll <= 20) {\nreturn Math.floor(baseCPCost * 0.7);\n}\n", "new_path": "src/app/pages/simulator/model/actions/crafting-action.ts", "old_path": "src/app/pages/simulator/model/actions/crafting-action.ts" }, { "change_type": "MODIFY", "diff": "@@ -12,7 +12,7 @@ export class PatientTouch extends QualityAction {\n}\nonFail(simulation: Simulation): void {\n- simulation.getBuff(Buff.INNER_QUIET).stacks = Math.floor(simulation.getBuff(Buff.INNER_QUIET).stacks / 2);\n+ simulation.getBuff(Buff.INNER_QUIET).stacks = Math.ceil(simulation.getBuff(Buff.INNER_QUIET).stacks / 2);\n}\ncanBeUsed(simulationState: Simulation): boolean {\n", "new_path": "src/app/pages/simulator/model/actions/quality/patient-touch.ts", "old_path": "src/app/pages/simulator/model/actions/quality/patient-touch.ts" }, { "change_type": "MODIFY", "diff": "@@ -18,6 +18,7 @@ import {MakersMark} from './model/actions/buff/makers-mark';\nimport {FlawlessSynthesis} from './model/actions/progression/flawless-synthesis';\nimport {Observe} from './model/actions/other/observe';\nimport {FocusedSynthesis} from './model/actions/progression/focused-synthesis';\n+import {HastyTouch} from './model/actions/quality/hasty-touch';\nconst infusionOfMind_Recipe: Craft = {\n'id': '3595',\n@@ -267,5 +268,19 @@ describe('Craft simulator tests', () => {\nexpect(results.filter(res => !res).length).toBeGreaterThan(9600);\nexpect(results.filter(res => !res).length).toBeLessThan(10400);\n});\n+\n+ it('should be able to run in linear mode properly', () => {\n+ const results = [];\n+ // Run simulation 10k times, to be sure with probability\n+ for (let i = 0; i < 10000; i++) {\n+ // Hasty Touch has 50% probability, with linear mode this should never fail.\n+ const simulation = new Simulation(infusionOfMind_Recipe,\n+ [new HastyTouch(), new HastyTouch(), new HastyTouch()], alc_70_350_stats);\n+ simulation.run(true);\n+ results.push(...simulation.steps.map(step => step.success));\n+ }\n+ // Expect no failure at all\n+ expect(results.filter(res => !res).length).toBe(0);\n+ });\n});\n});\n", "new_path": "src/app/pages/simulator/simulation.spec.ts", "old_path": "src/app/pages/simulator/simulation.spec.ts" }, { "change_type": "ADD", "diff": "+export interface SimulationReliabilityReport {\n+ successPercent: number;\n+ medianHQPercent: number;\n+ averageHQPercent: number;\n+}\n", "new_path": "src/app/pages/simulator/simulation/simulation-reliability-report.ts", "old_path": null }, { "change_type": "ADD", "diff": "+import {ActionResult} from '../model/action-result';\n+\n+export interface SimulationResult {\n+ steps: ActionResult[];\n+ hqPercent: number;\n+ success: boolean;\n+}\n", "new_path": "src/app/pages/simulator/simulation/simulation-result.ts", "old_path": null }, { "change_type": "MODIFY", "diff": "@@ -4,6 +4,8 @@ import {ActionResult} from '../model/action-result';\nimport {CrafterStats} from '../model/crafter-stats';\nimport {EffectiveBuff} from '../model/effective-buff';\nimport {Buff} from '../model/buff.enum';\n+import {SimulationResult} from './simulation-result';\n+import {SimulationReliabilityReport} from './simulation-reliability-report';\nexport class Simulation {\n@@ -38,7 +40,25 @@ export class Simulation {\n}\n}\n- public run(): ActionResult[] {\n+ public getReliability(): SimulationReliabilityReport {\n+ const results = [];\n+ // Let's run the simulation 1000 times.\n+ for (let i = 0; i < 1000; i++) {\n+ results.push(this.run(false));\n+ }\n+ return {\n+ successPercent: (results.filter(res => res.success).length / results.length) * 100,\n+ averageHQPercent: 0,\n+ medianHQPercent: 0\n+ }\n+ }\n+\n+ /**\n+ * Run the simulation.\n+ * @param {boolean} linear should everything be linear (aka no fail on actions, Initial preparations never procs)\n+ * @returns {ActionResult[]}\n+ */\n+ public run(linear = false): SimulationResult {\nthis.actions.forEach((action: CraftingAction, index: number) => {\n// If we're starting and the crafter is specialist\nif (index === 0 && this.crafterStats.specialist) {\n@@ -55,8 +75,8 @@ export class Simulation {\n}\n// If we can use the action\nif (this.success === undefined && action.getBaseCPCost(this) <= this.availableCP && action.canBeUsed(this)) {\n- // The roll for the current action's success rate\n- const probabilityRoll = Math.random() * 100;\n+ // The roll for the current action's success rate, 0 if ideal mode, as 0 will even match a 1% chances.\n+ const probabilityRoll = linear ? 0 : Math.random() * 100;\nconst qualityBefore = this.quality;\nconst progressionBefore = this.progression;\nif (action.getSuccessRate(this) >= probabilityRoll) {\n@@ -66,15 +86,16 @@ export class Simulation {\n}\n// Even if the action failed, we have to remove the durability cost\nthis.solidity -= action.getDurabilityCost(this);\n+ const CPCost = action.getCPCost(this, linear);\n// Even if the action failed, CP has to be consumed too\n- this.availableCP -= action.getCPCost(this);\n+ this.availableCP -= CPCost;\n// Push the result to the result array\nthis.steps.push({\naction: action,\nsuccess: action.getSuccessRate(this) >= probabilityRoll,\naddedQuality: this.quality - qualityBefore,\naddedProgression: this.progression - progressionBefore,\n- cpDifference: action.getCPCost(this),\n+ cpDifference: CPCost,\nskipped: false,\nsolidityDifference: action.getDurabilityCost(this)\n});\n@@ -97,7 +118,11 @@ export class Simulation {\n// Tick buffs after checking synth result, so if we reach 0 solidity, synth fails.\nthis.tickBuffs();\n});\n- return this.steps;\n+ return {\n+ steps: this.steps,\n+ hqPercent: 0, // TODO\n+ success: this.progression >= this.recipe.progress\n+ };\n}\npublic hasBuff(buff: Buff): boolean {\n", "new_path": "src/app/pages/simulator/simulation/simulation.ts", "old_path": "src/app/pages/simulator/simulation/simulation.ts" } ]
TypeScript
MIT License
ffxiv-teamcraft/ffxiv-teamcraft
chore(simulator): linear mode, reliability report
1
chore
simulator