ember-inspector 4.13.1 → 4.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ember-cli +1 -9
- package/.github/workflows/build.yml +33 -112
- package/.github/workflows/plan-release.yml +26 -48
- package/.github/workflows/publish.yml +129 -31
- package/.prettierignore +2 -13
- package/.prettierrc.js +10 -4
- package/.release-plan.json +13 -4
- package/.stylelintignore +8 -0
- package/.stylelintrc.js +10 -1
- package/.template-lintrc.js +2 -1
- package/.tool-versions +2 -2
- package/.watchmanconfig +1 -1
- package/CHANGELOG.md +137 -0
- package/DEVELOPMENT.md +50 -0
- package/PRIVACY.md +3 -0
- package/README.md +14 -50
- package/RELEASE.md +15 -50
- package/app/components/app-picker.hbs +2 -2
- package/app/components/component-tree-item.hbs +14 -14
- package/app/components/component-tree-toolbar.hbs +17 -3
- package/app/components/{date-property-field.js → date-property-field.ts} +6 -5
- package/app/components/deprecation-item-source.hbs +1 -1
- package/app/components/deprecation-item.hbs +1 -1
- package/app/components/deprecations-toolbar.hbs +1 -1
- package/app/components/item-types.hbs +7 -7
- package/app/components/list-cell.hbs +3 -3
- package/app/components/list-content.hbs +4 -3
- package/app/components/list-content.ts +96 -0
- package/app/components/list.hbs +3 -3
- package/app/components/list.js +7 -7
- package/app/components/model-types-toolbar.hbs +3 -3
- package/app/components/object-inspector/component-parents.hbs +33 -0
- package/app/components/object-inspector/component-parents.js +43 -0
- package/app/components/object-inspector/dependent-keys.hbs +4 -4
- package/app/components/object-inspector/errors.hbs +4 -4
- package/app/components/object-inspector/properties-all.hbs +1 -1
- package/app/components/object-inspector/properties-base.js +2 -0
- package/app/components/object-inspector/properties-grouped.hbs +5 -5
- package/app/components/object-inspector/property.hbs +36 -34
- package/app/components/object-inspector/property.ts +34 -17
- package/app/components/object-inspector/sort-properties.js +12 -4
- package/app/components/object-inspector/toggle.hbs +9 -0
- package/app/components/object-inspector/toggle.js +6 -0
- package/app/components/object-inspector.hbs +11 -9
- package/app/components/object-inspector.js +1 -1
- package/app/components/promise-item.hbs +11 -11
- package/app/components/promise-item.js +8 -6
- package/app/components/promise-tree-toolbar.hbs +5 -5
- package/app/components/records-toolbar.hbs +2 -2
- package/app/components/render-item.hbs +4 -4
- package/app/components/render-item.ts +12 -9
- package/app/components/render-tree-toolbar.hbs +1 -1
- package/app/components/route-cell-name.hbs +1 -1
- package/app/components/route-cell-name.js +3 -2
- package/app/components/route-tree-toolbar.hbs +2 -2
- package/app/components/scroll-container.js +2 -0
- package/app/components/side-nav.hbs +5 -5
- package/app/components/side-nav.js +1 -1
- package/{lib/ui/addon/components → app/components/ui}/drag-handle.hbs +4 -4
- package/{lib/ui/addon/components → app/components/ui}/drag-handle.js +3 -1
- package/{lib/ui/addon/components → app/components/ui}/empty-message.hbs +1 -1
- package/{lib/ui/addon/components → app/components/ui}/error-page.hbs +3 -3
- package/{lib/ui/addon/components → app/components/ui}/resizable-column.js +1 -1
- package/{lib/ui/addon/components → app/components/ui}/toolbar-clear-button.hbs +1 -1
- package/{lib/ui/addon/components → app/components/ui}/toolbar-reload-button.hbs +1 -1
- package/{lib/ui/addon/components → app/components/ui}/toolbar-search-field.hbs +2 -2
- package/app/computed/{debounce.js → debounce.ts} +7 -5
- package/app/config/environment.d.ts +5 -2
- package/app/controllers/app-config.js +1 -0
- package/app/controllers/application.js +36 -71
- package/app/controllers/component-tree.js +26 -7
- package/app/controllers/container-type.js +2 -1
- package/app/controllers/container-types/{index.js → index.ts} +5 -2
- package/app/controllers/container-types.js +3 -6
- package/app/controllers/deprecations.js +16 -11
- package/app/controllers/libraries.js +1 -0
- package/app/controllers/model-types.js +7 -13
- package/app/controllers/promise-tree.ts +149 -0
- package/app/controllers/records.js +18 -26
- package/app/controllers/{render-tree.js → render-tree.ts} +54 -45
- package/app/controllers/route-tree.js +7 -5
- package/app/helpers/build-style.js +1 -1
- package/app/index.html +1 -19
- package/app/initializers/setup.js +1 -1
- package/app/libs/promise-assembler.ts +249 -0
- package/app/libs/resizable-columns.js +10 -10
- package/app/models/{promise.js → promise.ts} +72 -69
- package/app/{router.js → router.ts} +1 -1
- package/app/routes/app-detected.js +3 -5
- package/app/routes/application.js +9 -13
- package/app/routes/deprecations.js +7 -16
- package/app/routes/launch.js +2 -1
- package/app/routes/libraries.js +2 -1
- package/app/routes/model-type.js +2 -3
- package/app/routes/model-types.ts +57 -0
- package/app/routes/promise-tree.ts +63 -0
- package/app/routes/records.ts +78 -0
- package/app/routes/render-tree.ts +93 -0
- package/app/routes/route-tree.js +0 -1
- package/app/routes/{tab.js → tab.ts} +9 -2
- package/app/routes/whats-new.js +6 -4
- package/app/services/adapters/{basic.js → basic.ts} +36 -30
- package/app/services/adapters/{bookmarklet.js → bookmarklet.ts} +17 -24
- package/app/services/adapters/{chrome.js → chrome.ts} +1 -2
- package/app/services/adapters/{web-extension.js → web-extension.ts} +46 -46
- package/app/services/adapters/websocket.ts +40 -0
- package/app/services/layout.ts +124 -0
- package/app/services/port.ts +195 -0
- package/app/services/storage/{local.js → local.ts} +7 -20
- package/app/services/storage/{memory.js → memory.ts} +6 -21
- package/app/services/{storage.js → storage.ts} +25 -23
- package/app/styles/app.scss +1 -0
- package/app/styles/base.scss +6 -2
- package/app/styles/colors.scss +33 -31
- package/app/styles/component_tree.scss +56 -51
- package/app/styles/dropdown.scss +2 -2
- package/app/styles/ember-table.scss +3 -3
- package/app/styles/mixin.scss +26 -26
- package/app/styles/object_inspector.scss +30 -21
- package/{lib/ui/addon/styles → app/styles/ui}/_disclosure-triangle.scss +3 -1
- package/{lib/ui/addon/styles → app/styles/ui}/_drag-handle.scss +7 -7
- package/{lib/ui/addon/styles → app/styles/ui}/_empty-message.scss +1 -1
- package/{lib/ui/addon/styles → app/styles/ui}/_error-page.scss +8 -7
- package/{lib/ui/addon/styles → app/styles/ui}/_list.scss +46 -45
- package/{lib/ui/addon/styles → app/styles/ui}/_nav.scss +29 -27
- package/app/styles/ui/_object-inspector-toggle.scss +4 -0
- package/{lib/ui/addon/styles → app/styles/ui}/_pill.scss +4 -4
- package/{lib/ui/addon/styles → app/styles/ui}/_send-to-console.scss +1 -1
- package/{lib/ui/addon/styles → app/styles/ui}/_split.scss +26 -20
- package/app/styles/ui/_ui.scss +13 -0
- package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_checkbox.scss +5 -5
- package/app/styles/ui/toolbar/_icon-button.scss +80 -0
- package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_index.scss +6 -5
- package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_radio.scss +10 -10
- package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_search.scss +5 -3
- package/app/styles/utils.scss +408 -122
- package/app/templates/application.hbs +22 -19
- package/app/templates/component-tree.hbs +4 -1
- package/app/templates/deprecations.hbs +2 -3
- package/app/templates/info.hbs +10 -10
- package/app/templates/promise-tree.hbs +1 -1
- package/app/templates/render-tree.hbs +1 -1
- package/app/templates/route-tree.hbs +1 -1
- package/app/utils/escape-reg-exp.ts +3 -2
- package/app/utils/nullish.ts +7 -0
- package/app/utils/parse-text.ts +4 -5
- package/app/utils/truncate.js +0 -1
- package/config/ember-cli-update.json +5 -3
- package/config/ember-try.js +117 -72
- package/config/environment.js +1 -1
- package/config/optional-features.json +2 -1
- package/dist/bookmarklet/load_inspector.js +31 -11
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.443.86a005e528b587663b78.js +1135 -0
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.443.86a005e528b587663b78.js.LICENSE.txt +18 -0
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.524.aca67dc376e8cd35b522.js +40 -0
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.582.d3d80e94c4f59dc3b65d.js +42 -0
- package/dist/bookmarklet/panes-3-16-0/assets/ember-inspector.css +997 -156
- package/dist/bookmarklet/panes-3-16-0/assets/ember-inspector.js +560 -613
- package/dist/bookmarklet/panes-3-16-0/assets/svg/ellipsis.svg +3 -3
- package/dist/bookmarklet/panes-3-16-0/assets/svg/focus-point-round.svg +9 -0
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-bug.svg +1 -1
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-components.svg +2 -2
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-container.svg +1 -1
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-data.svg +1 -1
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-deprecations.svg +3 -3
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-info.svg +3 -3
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-promises.svg +2 -2
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-render-performance.svg +2 -2
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-route-tree.svg +7 -7
- package/dist/bookmarklet/panes-3-16-0/assets/svg/sidebar-toggle-trailing.svg +9 -0
- package/dist/bookmarklet/panes-3-16-0/assets/vendor.css +4 -841
- package/dist/bookmarklet/panes-3-16-0/assets/vendor.js +4277 -5152
- package/dist/bookmarklet/panes-3-16-0/base-object-HAEdWjmg.js +59 -0
- package/dist/bookmarklet/panes-3-16-0/basic-B1dkgN3d.js +149 -0
- package/dist/bookmarklet/panes-3-16-0/basic-debug.js +10 -0
- package/dist/bookmarklet/panes-3-16-0/bookmarklet-BZWtwuX-.js +32 -0
- package/dist/bookmarklet/panes-3-16-0/bookmarklet-debug.js +10 -0
- package/dist/bookmarklet/panes-3-16-0/chrome-P6FSEUf1.js +10 -0
- package/dist/bookmarklet/panes-3-16-0/chrome-debug.js +10 -0
- package/dist/bookmarklet/panes-3-16-0/ember.js +166 -0
- package/dist/bookmarklet/panes-3-16-0/ember_debug.js +7 -11018
- package/dist/bookmarklet/panes-3-16-0/evented-BCTya3yE.js +62 -0
- package/dist/bookmarklet/panes-3-16-0/firefox-8F84zphP.js +30 -0
- package/dist/bookmarklet/panes-3-16-0/firefox-debug.js +10 -0
- package/dist/bookmarklet/panes-3-16-0/index.html +4 -23
- package/dist/bookmarklet/panes-3-16-0/internals-CRmXMEzb.js +12 -0
- package/dist/bookmarklet/panes-3-16-0/load-ember-debug-in-webpage-DCWcJhQm.js +29 -0
- package/dist/bookmarklet/panes-3-16-0/main.js +7669 -0
- package/dist/bookmarklet/panes-3-16-0/port.js +108 -0
- package/dist/bookmarklet/panes-3-16-0/profile-node.js +60 -0
- package/dist/bookmarklet/panes-3-16-0/promise-assembler.js +218 -0
- package/dist/bookmarklet/panes-3-16-0/runloop-6_0lpzTA.js +1138 -0
- package/dist/bookmarklet/panes-3-16-0/start-inspector-BIYQArZn.js +334 -0
- package/dist/bookmarklet/panes-3-16-0/type-check.js +119 -0
- package/dist/bookmarklet/panes-3-16-0/version.js +90 -0
- package/dist/bookmarklet/panes-3-16-0/versions.js +4 -0
- package/dist/bookmarklet/panes-3-16-0/web-extension-OWnXJ_XK.js +144 -0
- package/dist/bookmarklet/panes-3-16-0/websocket-BSUvUqER.js +58 -0
- package/dist/bookmarklet/panes-3-16-0/websocket-debug.js +10 -0
- package/dist/chrome/background.js +26 -21
- package/dist/chrome/boot.js +1 -1
- package/dist/chrome/content-script.js +12 -11
- package/dist/chrome/devtools.js +12 -3
- package/dist/chrome/manifest.json +4 -2
- package/dist/chrome/options.js +17 -12
- package/dist/chrome/panes-3-16-0/assets/chunk.443.86a005e528b587663b78.js +1135 -0
- package/dist/chrome/panes-3-16-0/assets/chunk.443.86a005e528b587663b78.js.LICENSE.txt +18 -0
- package/dist/chrome/panes-3-16-0/assets/chunk.524.aca67dc376e8cd35b522.js +40 -0
- package/dist/chrome/panes-3-16-0/assets/chunk.582.d3d80e94c4f59dc3b65d.js +42 -0
- package/dist/chrome/panes-3-16-0/assets/ember-inspector.css +997 -156
- package/dist/chrome/panes-3-16-0/assets/ember-inspector.js +560 -613
- package/dist/chrome/panes-3-16-0/assets/svg/ellipsis.svg +3 -3
- package/dist/chrome/panes-3-16-0/assets/svg/focus-point-round.svg +9 -0
- package/dist/chrome/panes-3-16-0/assets/svg/nav-bug.svg +1 -1
- package/dist/chrome/panes-3-16-0/assets/svg/nav-components.svg +2 -2
- package/dist/chrome/panes-3-16-0/assets/svg/nav-container.svg +1 -1
- package/dist/chrome/panes-3-16-0/assets/svg/nav-data.svg +1 -1
- package/dist/chrome/panes-3-16-0/assets/svg/nav-deprecations.svg +3 -3
- package/dist/chrome/panes-3-16-0/assets/svg/nav-info.svg +3 -3
- package/dist/chrome/panes-3-16-0/assets/svg/nav-promises.svg +2 -2
- package/dist/chrome/panes-3-16-0/assets/svg/nav-render-performance.svg +2 -2
- package/dist/chrome/panes-3-16-0/assets/svg/nav-route-tree.svg +7 -7
- package/dist/chrome/panes-3-16-0/assets/svg/sidebar-toggle-trailing.svg +9 -0
- package/dist/chrome/panes-3-16-0/assets/vendor.css +4 -841
- package/dist/chrome/panes-3-16-0/assets/vendor.js +4277 -5152
- package/dist/chrome/panes-3-16-0/base-object-HAEdWjmg.js +59 -0
- package/dist/chrome/panes-3-16-0/basic-B1dkgN3d.js +149 -0
- package/dist/chrome/panes-3-16-0/basic-debug.js +10 -0
- package/dist/chrome/panes-3-16-0/bookmarklet-BZWtwuX-.js +32 -0
- package/dist/chrome/panes-3-16-0/bookmarklet-debug.js +10 -0
- package/dist/chrome/panes-3-16-0/chrome-P6FSEUf1.js +10 -0
- package/dist/chrome/panes-3-16-0/chrome-debug.js +10 -0
- package/dist/chrome/panes-3-16-0/ember.js +166 -0
- package/dist/chrome/panes-3-16-0/ember_debug.js +7 -11018
- package/dist/chrome/panes-3-16-0/evented-BCTya3yE.js +62 -0
- package/dist/chrome/panes-3-16-0/firefox-8F84zphP.js +30 -0
- package/dist/chrome/panes-3-16-0/firefox-debug.js +10 -0
- package/dist/chrome/panes-3-16-0/index.html +4 -23
- package/dist/chrome/panes-3-16-0/internals-CRmXMEzb.js +12 -0
- package/dist/chrome/panes-3-16-0/load-ember-debug-in-webpage-DCWcJhQm.js +29 -0
- package/dist/chrome/panes-3-16-0/main.js +7669 -0
- package/dist/chrome/panes-3-16-0/port.js +108 -0
- package/dist/chrome/panes-3-16-0/profile-node.js +60 -0
- package/dist/chrome/panes-3-16-0/promise-assembler.js +218 -0
- package/dist/chrome/panes-3-16-0/runloop-6_0lpzTA.js +1138 -0
- package/dist/chrome/panes-3-16-0/start-inspector-BIYQArZn.js +334 -0
- package/dist/chrome/panes-3-16-0/type-check.js +119 -0
- package/dist/chrome/panes-3-16-0/version.js +90 -0
- package/dist/chrome/panes-3-16-0/versions.js +4 -0
- package/dist/chrome/panes-3-16-0/web-extension-OWnXJ_XK.js +144 -0
- package/dist/chrome/panes-3-16-0/websocket-BSUvUqER.js +58 -0
- package/dist/chrome/panes-3-16-0/websocket-debug.js +10 -0
- package/dist/chrome/scripts/in-page-script.js +19 -13
- package/dist/firefox/background.js +26 -21
- package/dist/firefox/boot.js +1 -1
- package/dist/firefox/content-script.js +12 -11
- package/dist/firefox/devtools.js +12 -3
- package/dist/firefox/manifest.json +4 -2
- package/dist/firefox/options.js +17 -12
- package/dist/firefox/panes-3-16-0/assets/chunk.443.86a005e528b587663b78.js +1135 -0
- package/dist/firefox/panes-3-16-0/assets/chunk.443.86a005e528b587663b78.js.LICENSE.txt +18 -0
- package/dist/firefox/panes-3-16-0/assets/chunk.524.aca67dc376e8cd35b522.js +40 -0
- package/dist/firefox/panes-3-16-0/assets/chunk.582.d3d80e94c4f59dc3b65d.js +42 -0
- package/dist/firefox/panes-3-16-0/assets/ember-inspector.css +997 -156
- package/dist/firefox/panes-3-16-0/assets/ember-inspector.js +560 -613
- package/dist/firefox/panes-3-16-0/assets/svg/ellipsis.svg +3 -3
- package/dist/firefox/panes-3-16-0/assets/svg/focus-point-round.svg +9 -0
- package/dist/firefox/panes-3-16-0/assets/svg/nav-bug.svg +1 -1
- package/dist/firefox/panes-3-16-0/assets/svg/nav-components.svg +2 -2
- package/dist/firefox/panes-3-16-0/assets/svg/nav-container.svg +1 -1
- package/dist/firefox/panes-3-16-0/assets/svg/nav-data.svg +1 -1
- package/dist/firefox/panes-3-16-0/assets/svg/nav-deprecations.svg +3 -3
- package/dist/firefox/panes-3-16-0/assets/svg/nav-info.svg +3 -3
- package/dist/firefox/panes-3-16-0/assets/svg/nav-promises.svg +2 -2
- package/dist/firefox/panes-3-16-0/assets/svg/nav-render-performance.svg +2 -2
- package/dist/firefox/panes-3-16-0/assets/svg/nav-route-tree.svg +7 -7
- package/dist/firefox/panes-3-16-0/assets/svg/sidebar-toggle-trailing.svg +9 -0
- package/dist/firefox/panes-3-16-0/assets/vendor.css +4 -841
- package/dist/firefox/panes-3-16-0/assets/vendor.js +4277 -5152
- package/dist/firefox/panes-3-16-0/base-object-HAEdWjmg.js +59 -0
- package/dist/firefox/panes-3-16-0/basic-B1dkgN3d.js +149 -0
- package/dist/firefox/panes-3-16-0/basic-debug.js +10 -0
- package/dist/firefox/panes-3-16-0/bookmarklet-BZWtwuX-.js +32 -0
- package/dist/firefox/panes-3-16-0/bookmarklet-debug.js +10 -0
- package/dist/firefox/panes-3-16-0/chrome-P6FSEUf1.js +10 -0
- package/dist/firefox/panes-3-16-0/chrome-debug.js +10 -0
- package/dist/firefox/panes-3-16-0/ember.js +166 -0
- package/dist/firefox/panes-3-16-0/ember_debug.js +7 -11018
- package/dist/firefox/panes-3-16-0/evented-BCTya3yE.js +62 -0
- package/dist/firefox/panes-3-16-0/firefox-8F84zphP.js +30 -0
- package/dist/firefox/panes-3-16-0/firefox-debug.js +10 -0
- package/dist/firefox/panes-3-16-0/index.html +4 -23
- package/dist/firefox/panes-3-16-0/internals-CRmXMEzb.js +12 -0
- package/dist/firefox/panes-3-16-0/load-ember-debug-in-webpage-DCWcJhQm.js +29 -0
- package/dist/firefox/panes-3-16-0/main.js +7669 -0
- package/dist/firefox/panes-3-16-0/port.js +108 -0
- package/dist/firefox/panes-3-16-0/profile-node.js +60 -0
- package/dist/firefox/panes-3-16-0/promise-assembler.js +218 -0
- package/dist/firefox/panes-3-16-0/runloop-6_0lpzTA.js +1138 -0
- package/dist/firefox/panes-3-16-0/start-inspector-BIYQArZn.js +334 -0
- package/dist/firefox/panes-3-16-0/type-check.js +119 -0
- package/dist/firefox/panes-3-16-0/version.js +90 -0
- package/dist/firefox/panes-3-16-0/versions.js +4 -0
- package/dist/firefox/panes-3-16-0/web-extension-OWnXJ_XK.js +144 -0
- package/dist/firefox/panes-3-16-0/websocket-BSUvUqER.js +58 -0
- package/dist/firefox/panes-3-16-0/websocket-debug.js +10 -0
- package/dist/firefox/scripts/in-page-script.js +19 -13
- package/dist/websocket/assets/chunk.443.86a005e528b587663b78.js +1135 -0
- package/dist/websocket/assets/chunk.443.86a005e528b587663b78.js.LICENSE.txt +18 -0
- package/dist/websocket/assets/chunk.524.aca67dc376e8cd35b522.js +40 -0
- package/dist/websocket/assets/chunk.582.d3d80e94c4f59dc3b65d.js +42 -0
- package/dist/websocket/assets/ember-inspector.css +997 -156
- package/dist/websocket/assets/ember-inspector.js +560 -613
- package/dist/websocket/assets/svg/ellipsis.svg +3 -3
- package/dist/websocket/assets/svg/focus-point-round.svg +9 -0
- package/dist/websocket/assets/svg/nav-bug.svg +1 -1
- package/dist/websocket/assets/svg/nav-components.svg +2 -2
- package/dist/websocket/assets/svg/nav-container.svg +1 -1
- package/dist/websocket/assets/svg/nav-data.svg +1 -1
- package/dist/websocket/assets/svg/nav-deprecations.svg +3 -3
- package/dist/websocket/assets/svg/nav-info.svg +3 -3
- package/dist/websocket/assets/svg/nav-promises.svg +2 -2
- package/dist/websocket/assets/svg/nav-render-performance.svg +2 -2
- package/dist/websocket/assets/svg/nav-route-tree.svg +7 -7
- package/dist/websocket/assets/svg/sidebar-toggle-trailing.svg +9 -0
- package/dist/websocket/assets/vendor.css +4 -841
- package/dist/websocket/assets/vendor.js +4277 -5152
- package/dist/websocket/base-object-HAEdWjmg.js +59 -0
- package/dist/websocket/basic-B1dkgN3d.js +149 -0
- package/dist/websocket/basic-debug.js +10 -0
- package/dist/websocket/bookmarklet-BZWtwuX-.js +32 -0
- package/dist/websocket/bookmarklet-debug.js +10 -0
- package/dist/websocket/chrome-P6FSEUf1.js +10 -0
- package/dist/websocket/chrome-debug.js +10 -0
- package/dist/websocket/ember.js +166 -0
- package/dist/websocket/ember_debug.js +7 -11018
- package/dist/websocket/evented-BCTya3yE.js +62 -0
- package/dist/websocket/firefox-8F84zphP.js +30 -0
- package/dist/websocket/firefox-debug.js +10 -0
- package/dist/websocket/index.html +4 -23
- package/dist/websocket/internals-CRmXMEzb.js +12 -0
- package/dist/websocket/load-ember-debug-in-webpage-DCWcJhQm.js +29 -0
- package/dist/websocket/main.js +7669 -0
- package/dist/websocket/port.js +108 -0
- package/dist/websocket/profile-node.js +60 -0
- package/dist/websocket/promise-assembler.js +218 -0
- package/dist/websocket/runloop-6_0lpzTA.js +1138 -0
- package/dist/websocket/start-inspector-BIYQArZn.js +334 -0
- package/dist/websocket/type-check.js +119 -0
- package/dist/websocket/version.js +90 -0
- package/dist/websocket/versions.js +4 -0
- package/dist/websocket/web-extension-OWnXJ_XK.js +144 -0
- package/dist/websocket/websocket-BSUvUqER.js +58 -0
- package/dist/websocket/websocket-debug.js +10 -0
- package/ember-cli-build.js +31 -140
- package/ember_debug/adapters/basic.js +10 -29
- package/ember_debug/adapters/bookmarklet.js +1 -0
- package/ember_debug/adapters/firefox.js +3 -3
- package/ember_debug/adapters/web-extension.js +6 -5
- package/ember_debug/adapters/websocket.js +2 -2
- package/ember_debug/babel.config.cjs +11 -0
- package/ember_debug/container-debug.js +1 -1
- package/ember_debug/data-debug.js +7 -8
- package/ember_debug/debug-port.js +1 -1
- package/ember_debug/deprecation-debug.js +14 -14
- package/ember_debug/entrypoints/basic-debug.js +10 -0
- package/ember_debug/entrypoints/bookmarklet-debug.js +10 -0
- package/ember_debug/entrypoints/chrome-debug.js +10 -0
- package/ember_debug/entrypoints/firefox-debug.js +10 -0
- package/ember_debug/entrypoints/websocket-debug.js +10 -0
- package/ember_debug/general-debug.js +4 -4
- package/ember_debug/lib/boot-ember-inspector.js +9 -0
- package/ember_debug/lib/get-applications.js +28 -0
- package/ember_debug/lib/load-ember-debug-in-webpage.js +32 -0
- package/ember_debug/lib/send-apps.js +14 -0
- package/ember_debug/lib/send-version-miss.js +38 -0
- package/ember_debug/lib/setup-instance-initializer.js +17 -0
- package/ember_debug/lib/start-inspector.js +195 -0
- package/ember_debug/lib/version-test.js +73 -0
- package/ember_debug/lib/versions.js +3 -0
- package/ember_debug/libs/capture-render-tree.js +1 -2
- package/ember_debug/libs/promise-assembler.js +5 -4
- package/ember_debug/libs/render-tree.js +37 -44
- package/ember_debug/libs/source-map.js +7 -6
- package/ember_debug/libs/view-inspection.js +25 -17
- package/ember_debug/main.js +18 -21
- package/ember_debug/models/profile-manager.js +6 -6
- package/ember_debug/models/profile-node.js +1 -1
- package/ember_debug/models/promise.js +2 -2
- package/ember_debug/object-inspector.js +74 -65
- package/ember_debug/package.json +27 -0
- package/ember_debug/port.js +5 -4
- package/ember_debug/promise-debug.js +5 -5
- package/ember_debug/render-debug.js +5 -5
- package/ember_debug/rollup.config.js +24 -0
- package/ember_debug/route-debug.js +10 -9
- package/ember_debug/services/session.js +2 -2
- package/ember_debug/utils/classify.js +1 -1
- package/ember_debug/utils/ember/object/internals.js +1 -11
- package/ember_debug/utils/ember/own-runloop.js +1 -1
- package/ember_debug/utils/ember/runloop.js +7 -10
- package/ember_debug/utils/ember-object-names.js +11 -9
- package/ember_debug/utils/ember.js +222 -40
- package/ember_debug/utils/evented.js +1 -1
- package/ember_debug/utils/get-object-name.js +3 -3
- package/ember_debug/utils/type-check.js +9 -5
- package/ember_debug/view-debug.js +12 -6
- package/eslint.config.mjs +173 -0
- package/gulpfile.js +1 -1
- package/package.json +97 -95
- package/patches/ember-cli-inject-live-reload.patch +16 -0
- package/pnpm-workspace.yaml +3 -0
- package/public/assets/svg/ellipsis.svg +3 -3
- package/public/assets/svg/focus-point-round.svg +9 -0
- package/public/assets/svg/nav-bug.svg +1 -1
- package/public/assets/svg/nav-components.svg +2 -2
- package/public/assets/svg/nav-container.svg +1 -1
- package/public/assets/svg/nav-data.svg +1 -1
- package/public/assets/svg/nav-deprecations.svg +3 -3
- package/public/assets/svg/nav-info.svg +3 -3
- package/public/assets/svg/nav-promises.svg +2 -2
- package/public/assets/svg/nav-render-performance.svg +2 -2
- package/public/assets/svg/nav-route-tree.svg +7 -7
- package/public/assets/svg/sidebar-toggle-trailing.svg +9 -0
- package/scripts/download-panes.js +1 -1
- package/skeletons/bookmarklet/load_inspector.js +31 -11
- package/skeletons/web-extension/background.js +26 -21
- package/skeletons/web-extension/boot.js +1 -1
- package/skeletons/web-extension/content-script.js +12 -11
- package/skeletons/web-extension/devtools.js +12 -3
- package/skeletons/web-extension/manifest.json +3 -1
- package/skeletons/web-extension/options.js +17 -12
- package/skeletons/web-extension/scripts/in-page-script.js +19 -13
- package/testem.js +0 -1
- package/tests/acceptance/app-picker-test.js +4 -4
- package/tests/acceptance/component-tree-test.js +96 -57
- package/tests/acceptance/container-test.js +0 -2
- package/tests/acceptance/data-test.js +14 -11
- package/tests/acceptance/deprecation-test.js +8 -12
- package/tests/acceptance/info-test.js +2 -2
- package/tests/acceptance/object-inspector-test.js +62 -110
- package/tests/acceptance/promise-test.js +1 -11
- package/tests/acceptance/render-tree-test.js +2 -2
- package/tests/acceptance/route-tree-test.js +12 -14
- package/tests/acceptance/whats-new-test.js +11 -11
- package/tests/ember_debug/container-debug-test.js +5 -14
- package/tests/ember_debug/deprecation-debug-test.js +15 -6
- package/tests/ember_debug/ember-data-test.js +7 -1
- package/tests/ember_debug/ember-debug-test.js +13 -13
- package/tests/ember_debug/object-inspector-test.js +115 -50
- package/tests/ember_debug/profile-manager-test.js +153 -170
- package/tests/ember_debug/profile-node-test.js +9 -5
- package/tests/ember_debug/promise-assembler-test.js +18 -10
- package/tests/ember_debug/promise-debug-test.js +19 -15
- package/tests/ember_debug/render-debug-test.js +8 -1
- package/tests/ember_debug/route-debug-test.js +14 -8
- package/tests/ember_debug/view-debug-test.js +267 -183
- package/tests/helpers/{index.js → index.ts} +6 -5
- package/tests/helpers/setup-ember-debug-test.js +22 -2
- package/tests/index.html +1 -2
- package/tests/integration/injection-test.js +37 -81
- package/tests/test-adapter.js +15 -15
- package/tests/test-helper.js +6 -4
- package/tests/unit/check-current-route-test.js +0 -4
- package/tests/unit/resizable-columns-test.js +53 -51
- package/tests/unit/utils/parse-text-test.js +3 -3
- package/tests/unit/utils/search-match-test.js +5 -5
- package/tests/unit/utils/type-check-test.js +27 -0
- package/tsconfig.json +3 -1
- package/types/ember-inspector/index.d.ts +2 -1
- package/types/global.d.ts +1 -7
- package/.eslintignore +0 -33
- package/.eslintrc.js +0 -86
- package/app/components/list-content.js +0 -130
- package/app/controllers/promise-tree.js +0 -130
- package/app/libs/promise-assembler.js +0 -169
- package/app/routes/model-types.js +0 -47
- package/app/routes/promise-tree.js +0 -48
- package/app/routes/records.js +0 -55
- package/app/routes/render-tree.js +0 -66
- package/app/services/adapters/websocket.js +0 -31
- package/app/services/layout.js +0 -39
- package/app/services/port.js +0 -90
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.143.76a242242ec46a377266.js +0 -28
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.178.b6064b368cf24cc346ec.js +0 -9
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.359.0be5d21f60d2b5d6d423.js +0 -2620
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.359.0be5d21f60d2b5d6d423.js.LICENSE.txt +0 -67
- package/dist/bookmarklet/panes-3-16-0/assets/fonts/Inter-Bold.woff +0 -0
- package/dist/bookmarklet/panes-3-16-0/assets/fonts/Inter-Bold.woff2 +0 -0
- package/dist/bookmarklet/panes-3-16-0/assets/fonts/Inter-Regular.woff +0 -0
- package/dist/bookmarklet/panes-3-16-0/assets/fonts/Inter-Regular.woff2 +0 -0
- package/dist/chrome/panes-3-16-0/assets/chunk.143.76a242242ec46a377266.js +0 -28
- package/dist/chrome/panes-3-16-0/assets/chunk.178.b6064b368cf24cc346ec.js +0 -9
- package/dist/chrome/panes-3-16-0/assets/chunk.359.0be5d21f60d2b5d6d423.js +0 -2620
- package/dist/chrome/panes-3-16-0/assets/chunk.359.0be5d21f60d2b5d6d423.js.LICENSE.txt +0 -67
- package/dist/chrome/panes-3-16-0/assets/fonts/Inter-Bold.woff +0 -0
- package/dist/chrome/panes-3-16-0/assets/fonts/Inter-Bold.woff2 +0 -0
- package/dist/chrome/panes-3-16-0/assets/fonts/Inter-Regular.woff +0 -0
- package/dist/chrome/panes-3-16-0/assets/fonts/Inter-Regular.woff2 +0 -0
- package/dist/firefox/panes-3-16-0/assets/chunk.143.76a242242ec46a377266.js +0 -28
- package/dist/firefox/panes-3-16-0/assets/chunk.178.b6064b368cf24cc346ec.js +0 -9
- package/dist/firefox/panes-3-16-0/assets/chunk.359.0be5d21f60d2b5d6d423.js +0 -2620
- package/dist/firefox/panes-3-16-0/assets/chunk.359.0be5d21f60d2b5d6d423.js.LICENSE.txt +0 -67
- package/dist/firefox/panes-3-16-0/assets/fonts/Inter-Bold.woff +0 -0
- package/dist/firefox/panes-3-16-0/assets/fonts/Inter-Bold.woff2 +0 -0
- package/dist/firefox/panes-3-16-0/assets/fonts/Inter-Regular.woff +0 -0
- package/dist/firefox/panes-3-16-0/assets/fonts/Inter-Regular.woff2 +0 -0
- package/dist/websocket/assets/chunk.143.76a242242ec46a377266.js +0 -28
- package/dist/websocket/assets/chunk.178.b6064b368cf24cc346ec.js +0 -9
- package/dist/websocket/assets/chunk.359.0be5d21f60d2b5d6d423.js +0 -2620
- package/dist/websocket/assets/chunk.359.0be5d21f60d2b5d6d423.js.LICENSE.txt +0 -67
- package/dist/websocket/assets/fonts/Inter-Bold.woff +0 -0
- package/dist/websocket/assets/fonts/Inter-Bold.woff2 +0 -0
- package/dist/websocket/assets/fonts/Inter-Regular.woff +0 -0
- package/dist/websocket/assets/fonts/Inter-Regular.woff2 +0 -0
- package/ember_debug/.eslintrc.js +0 -13
- package/ember_debug/utils/ember/debug.js +0 -20
- package/ember_debug/utils/ember/instrumentation.js +0 -11
- package/ember_debug/utils/ember/loader.js +0 -22
- package/ember_debug/utils/rsvp.js +0 -20
- package/ember_debug/vendor/loader.js +0 -54
- package/ember_debug/vendor/startup-wrapper.js +0 -399
- package/lib/ui/addon/styles/_object-inspector-toggle.scss +0 -12
- package/lib/ui/addon/styles/addon.scss +0 -13
- package/lib/ui/addon/styles/toolbar/_icon-button.scss +0 -61
- package/lib/ui/app/components/ui/disclosure-triangle.js +0 -1
- package/lib/ui/app/components/ui/disclosure.js +0 -1
- package/lib/ui/app/components/ui/drag-handle.js +0 -1
- package/lib/ui/app/components/ui/draggable-column.js +0 -1
- package/lib/ui/app/components/ui/empty-message.js +0 -1
- package/lib/ui/app/components/ui/error-page.js +0 -1
- package/lib/ui/app/components/ui/open-links-in-new-window.js +0 -1
- package/lib/ui/app/components/ui/resizable-column.js +0 -1
- package/lib/ui/app/components/ui/send-to-console.js +0 -1
- package/lib/ui/app/components/ui/toolbar-clear-button.js +0 -1
- package/lib/ui/app/components/ui/toolbar-divider.js +0 -1
- package/lib/ui/app/components/ui/toolbar-reload-button.js +0 -1
- package/lib/ui/app/components/ui/toolbar-search-field.js +0 -1
- package/lib/ui/app/components/ui/warning-message.js +0 -1
- package/lib/ui/index.js +0 -34
- package/lib/ui/package.json +0 -13
- package/public/assets/fonts/Inter-Bold.woff +0 -0
- package/public/assets/fonts/Inter-Bold.woff2 +0 -0
- package/public/assets/fonts/Inter-Regular.woff +0 -0
- package/public/assets/fonts/Inter-Regular.woff2 +0 -0
- package/tests/helpers/trigger-port.js +0 -6
- /package/app/{app.js → app.ts} +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/disclosure-triangle.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/disclosure.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/disclosure.js +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/draggable-column.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/draggable-column.js +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/open-links-in-new-window.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/open-links-in-new-window.js +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/resizable-column.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/send-to-console.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/toolbar-divider.hbs +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/toolbar-search-field.js +0 -0
- /package/{lib/ui/addon/components → app/components/ui}/warning-message.hbs +0 -0
- /package/app/controllers/{info.js → info.ts} +0 -0
- /package/app/services/adapters/{firefox.js → firefox.ts} +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_goto-source.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/_warning.scss +0 -0
- /package/{lib/ui/addon/styles → app/styles/ui}/toolbar/_divider.scss +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { g as guidFor } from './internals-CRmXMEzb.js';
|
|
2
|
+
import { r as run } from './runloop-6_0lpzTA.js';
|
|
3
|
+
import { B as BaseObject } from './base-object-HAEdWjmg.js';
|
|
4
|
+
import { E as Evented } from './evented-BCTya3yE.js';
|
|
5
|
+
import './ember.js';
|
|
6
|
+
|
|
7
|
+
class Port extends BaseObject {
|
|
8
|
+
constructor(data) {
|
|
9
|
+
super(data);
|
|
10
|
+
Evented.applyTo(this);
|
|
11
|
+
}
|
|
12
|
+
get adapter() {
|
|
13
|
+
return this.namespace?.adapter;
|
|
14
|
+
}
|
|
15
|
+
get applicationId() {
|
|
16
|
+
return this.namespace?.applicationId;
|
|
17
|
+
}
|
|
18
|
+
get applicationName() {
|
|
19
|
+
return this.namespace?._application?.name || this.namespace?._application?.modulePrefix;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Unique id per application (not application instance). It's very important
|
|
24
|
+
* that this id doesn't change when the app is reset otherwise the inspector
|
|
25
|
+
* will no longer recognize the app.
|
|
26
|
+
*
|
|
27
|
+
* @property uniqueId
|
|
28
|
+
* @type {String}
|
|
29
|
+
*/
|
|
30
|
+
get uniqueId() {
|
|
31
|
+
return guidFor(this.namespace?._application, 'ember');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// eslint-disable-next-line ember/classic-decorator-hooks
|
|
35
|
+
init() {
|
|
36
|
+
/**
|
|
37
|
+
* Stores the timestamp when it was first accessed.
|
|
38
|
+
*
|
|
39
|
+
* @property now
|
|
40
|
+
* @type {Number}
|
|
41
|
+
*/
|
|
42
|
+
this.now = Date.now();
|
|
43
|
+
this.adapter.onMessageReceived(message => {
|
|
44
|
+
if (this.uniqueId === message.applicationId || !message.applicationId) {
|
|
45
|
+
this.messageReceived(message.type, message);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
messageReceived(name, message) {
|
|
50
|
+
// We should generally not be run-wrapping here. Starting a runloop in
|
|
51
|
+
// ember-debug will cause the inspected app to revalidate/rerender. We
|
|
52
|
+
// are generally not intending to cause changes to the rendered output
|
|
53
|
+
// of the app, so this is generally unnecessary, and in big apps this
|
|
54
|
+
// could be quite slow. There is nothing special about the `view:*`
|
|
55
|
+
// messages – I (GC) just happened to have reviewed all of them recently
|
|
56
|
+
// and can be quite sure that they don't need the runloop. We should
|
|
57
|
+
// audit the rest of them and see if we can remove the else branch. I
|
|
58
|
+
// think we most likely can. In the limited cases (if any) where the
|
|
59
|
+
// runloop is needed, the callback code should just do the wrapping
|
|
60
|
+
// themselves.
|
|
61
|
+
if (name.startsWith('view:')) {
|
|
62
|
+
try {
|
|
63
|
+
this.trigger(name, message);
|
|
64
|
+
} catch (error) {
|
|
65
|
+
this.adapter.handleError(error);
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
this.wrap(() => {
|
|
69
|
+
this.trigger(name, message);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
send(messageType, options = {}) {
|
|
74
|
+
options.type = messageType;
|
|
75
|
+
options.from = 'inspectedWindow';
|
|
76
|
+
options.applicationId = this.uniqueId;
|
|
77
|
+
options.applicationName = this.applicationName;
|
|
78
|
+
this.adapter.send(options);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Wrap all code triggered from outside of
|
|
83
|
+
* EmberDebug with this method.
|
|
84
|
+
*
|
|
85
|
+
* `wrap` is called by default
|
|
86
|
+
* on all callbacks triggered by `port`,
|
|
87
|
+
* so no need to call it in this case.
|
|
88
|
+
*
|
|
89
|
+
* - Wraps a callback in `Ember.run`.
|
|
90
|
+
* - Catches all errors during production
|
|
91
|
+
* and displays them in a user friendly manner.
|
|
92
|
+
*
|
|
93
|
+
* @method wrap
|
|
94
|
+
* @param {Function} fn
|
|
95
|
+
* @return {Mixed} The return value of the passed function
|
|
96
|
+
*/
|
|
97
|
+
wrap(fn) {
|
|
98
|
+
return run(this, function () {
|
|
99
|
+
try {
|
|
100
|
+
return fn();
|
|
101
|
+
} catch (error) {
|
|
102
|
+
this.adapter.handleError(error);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export { Port as default };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { g as guidFor } from './internals-CRmXMEzb.js';
|
|
2
|
+
import './ember.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
A tree structure for assembling a list of render calls so they can be grouped and displayed nicely afterwards.
|
|
6
|
+
|
|
7
|
+
@class ProfileNode
|
|
8
|
+
**/
|
|
9
|
+
function get(obj, key) {
|
|
10
|
+
return obj.get ? obj.get(key) : obj[key];
|
|
11
|
+
}
|
|
12
|
+
const ProfileNode = function (start, payload, parent, now) {
|
|
13
|
+
let name;
|
|
14
|
+
this.start = start;
|
|
15
|
+
this.timestamp = now || Date.now();
|
|
16
|
+
if (payload) {
|
|
17
|
+
if (payload.template) {
|
|
18
|
+
name = payload.template;
|
|
19
|
+
} else if (payload.view) {
|
|
20
|
+
const view = payload.view;
|
|
21
|
+
name = get(view, 'instrumentDisplay') || get(view, '_debugContainerKey');
|
|
22
|
+
if (name) {
|
|
23
|
+
name = name.replace(/^view:/, '');
|
|
24
|
+
}
|
|
25
|
+
this.viewGuid = guidFor(view);
|
|
26
|
+
}
|
|
27
|
+
if (!name && payload.object) {
|
|
28
|
+
name = payload.object.toString().replace(/:?:ember\d+>$/, '').replace(/^</, '');
|
|
29
|
+
if (!this.viewGuid) {
|
|
30
|
+
const match = name.match(/:(ember\d+)>$/);
|
|
31
|
+
if (match && match.length > 1) {
|
|
32
|
+
this.viewGuid = match[1];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
this.name = name || 'Unknown view';
|
|
38
|
+
if (parent) {
|
|
39
|
+
this.parent = parent;
|
|
40
|
+
}
|
|
41
|
+
this.children = [];
|
|
42
|
+
};
|
|
43
|
+
ProfileNode.prototype = {
|
|
44
|
+
finish(timestamp) {
|
|
45
|
+
this.time = timestamp - this.start;
|
|
46
|
+
this.calcDuration();
|
|
47
|
+
|
|
48
|
+
// Once we attach to our parent, we remove that reference
|
|
49
|
+
// to avoid a graph cycle when serializing:
|
|
50
|
+
if (this.parent) {
|
|
51
|
+
this.parent.children.push(this);
|
|
52
|
+
this.parent = null;
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
calcDuration() {
|
|
56
|
+
this.duration = Math.round(this.time * 100) / 100;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { ProfileNode as default };
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { a as _applyDecoratedDescriptor, B as BaseObject, b as _initializerDefineProperty, _ as _defineProperty } from './base-object-HAEdWjmg.js';
|
|
2
|
+
import { typeOf } from './type-check.js';
|
|
3
|
+
import { RSVP } from './ember.js';
|
|
4
|
+
import { E as Evented } from './evented-BCTya3yE.js';
|
|
5
|
+
|
|
6
|
+
var _dec, _dec2, _dec3, _class2, _descriptor, _descriptor2, _descriptor3;
|
|
7
|
+
const dateComputed = function () {
|
|
8
|
+
return function (target, propertyKey) {
|
|
9
|
+
return {
|
|
10
|
+
get() {
|
|
11
|
+
return this[`__${propertyKey}__`];
|
|
12
|
+
},
|
|
13
|
+
set(date) {
|
|
14
|
+
if (typeOf(date) === 'date') {
|
|
15
|
+
this[`__${propertyKey}__`] = date;
|
|
16
|
+
return;
|
|
17
|
+
} else if (typeof date === 'number' || typeof date === 'string') {
|
|
18
|
+
this[`__${propertyKey}__`] = new Date(date);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
this[`__${propertyKey}__`] = null;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
let _class = (_dec = dateComputed(), _dec2 = dateComputed(), _dec3 = dateComputed(), _class2 = class _class2 extends BaseObject {
|
|
27
|
+
constructor(...args) {
|
|
28
|
+
super(...args);
|
|
29
|
+
_initializerDefineProperty(this, "createdAt", _descriptor, this);
|
|
30
|
+
_initializerDefineProperty(this, "settledAt", _descriptor2, this);
|
|
31
|
+
_initializerDefineProperty(this, "chainedAt", _descriptor3, this);
|
|
32
|
+
_defineProperty(this, "parent", null);
|
|
33
|
+
_defineProperty(this, "children", []);
|
|
34
|
+
}
|
|
35
|
+
get level() {
|
|
36
|
+
const parent = this.parent;
|
|
37
|
+
if (!parent) {
|
|
38
|
+
return 0;
|
|
39
|
+
}
|
|
40
|
+
return parent.level + 1;
|
|
41
|
+
}
|
|
42
|
+
get isSettled() {
|
|
43
|
+
return this.isFulfilled || this.isRejected;
|
|
44
|
+
}
|
|
45
|
+
get isFulfilled() {
|
|
46
|
+
return this.state === 'fulfilled';
|
|
47
|
+
}
|
|
48
|
+
get isRejected() {
|
|
49
|
+
return this.state === 'rejected';
|
|
50
|
+
}
|
|
51
|
+
}, _descriptor = _applyDecoratedDescriptor(_class2.prototype, "createdAt", [_dec], {
|
|
52
|
+
configurable: true,
|
|
53
|
+
enumerable: true,
|
|
54
|
+
writable: true,
|
|
55
|
+
initializer: null
|
|
56
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "settledAt", [_dec2], {
|
|
57
|
+
configurable: true,
|
|
58
|
+
enumerable: true,
|
|
59
|
+
writable: true,
|
|
60
|
+
initializer: null
|
|
61
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "chainedAt", [_dec3], {
|
|
62
|
+
configurable: true,
|
|
63
|
+
enumerable: true,
|
|
64
|
+
writable: true,
|
|
65
|
+
initializer: null
|
|
66
|
+
}), _class2);
|
|
67
|
+
|
|
68
|
+
var _PromiseAssembler;
|
|
69
|
+
class PromiseAssembler extends BaseObject {
|
|
70
|
+
constructor(data) {
|
|
71
|
+
super(data);
|
|
72
|
+
// RSVP lib to debug
|
|
73
|
+
_defineProperty(this, "isStarted", false);
|
|
74
|
+
Evented.applyTo(this);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// eslint-disable-next-line ember/classic-decorator-hooks
|
|
78
|
+
init() {
|
|
79
|
+
super.init();
|
|
80
|
+
this.all = [];
|
|
81
|
+
this.promiseIndex = {};
|
|
82
|
+
}
|
|
83
|
+
start() {
|
|
84
|
+
this.RSVP.configure('instrument', true);
|
|
85
|
+
this.promiseChained = e => {
|
|
86
|
+
chain.call(this, e);
|
|
87
|
+
};
|
|
88
|
+
this.promiseRejected = e => {
|
|
89
|
+
reject.call(this, e);
|
|
90
|
+
};
|
|
91
|
+
this.promiseFulfilled = e => {
|
|
92
|
+
fulfill.call(this, e);
|
|
93
|
+
};
|
|
94
|
+
this.promiseCreated = e => {
|
|
95
|
+
create.bind(this)(e);
|
|
96
|
+
};
|
|
97
|
+
this.RSVP.on('chained', this.promiseChained);
|
|
98
|
+
this.RSVP.on('rejected', this.promiseRejected);
|
|
99
|
+
this.RSVP.on('fulfilled', this.promiseFulfilled);
|
|
100
|
+
this.RSVP.on('created', this.promiseCreated);
|
|
101
|
+
this.isStarted = true;
|
|
102
|
+
}
|
|
103
|
+
stop() {
|
|
104
|
+
if (this.isStarted) {
|
|
105
|
+
this.RSVP.configure('instrument', false);
|
|
106
|
+
this.RSVP.off('chained', this.promiseChained);
|
|
107
|
+
this.RSVP.off('rejected', this.promiseRejected);
|
|
108
|
+
this.RSVP.off('fulfilled', this.promiseFulfilled);
|
|
109
|
+
this.RSVP.off('created', this.promiseCreated);
|
|
110
|
+
this.all.forEach(item => {
|
|
111
|
+
item.destroy();
|
|
112
|
+
});
|
|
113
|
+
this.all = [];
|
|
114
|
+
this.promiseIndex = {};
|
|
115
|
+
this.promiseChained = null;
|
|
116
|
+
this.promiseRejected = null;
|
|
117
|
+
this.promiseFulfilled = null;
|
|
118
|
+
this.promiseCreated = null;
|
|
119
|
+
this.isStarted = false;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
willDestroy() {
|
|
123
|
+
this.stop();
|
|
124
|
+
super.willDestroy();
|
|
125
|
+
}
|
|
126
|
+
createPromise(props) {
|
|
127
|
+
let promise = new _class(props);
|
|
128
|
+
let index = this.all.length;
|
|
129
|
+
this.all.push(promise);
|
|
130
|
+
this.promiseIndex[promise.guid] = index;
|
|
131
|
+
return promise;
|
|
132
|
+
}
|
|
133
|
+
find(guid) {
|
|
134
|
+
if (guid) {
|
|
135
|
+
const index = this.promiseIndex[guid];
|
|
136
|
+
if (index !== undefined) {
|
|
137
|
+
return this.all[index];
|
|
138
|
+
}
|
|
139
|
+
} else {
|
|
140
|
+
return this.all;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
findOrCreate(guid) {
|
|
144
|
+
return this.find(guid) || this.createPromise({
|
|
145
|
+
guid
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
updateOrCreate(guid, properties) {
|
|
149
|
+
let entry = this.find(guid);
|
|
150
|
+
if (entry) {
|
|
151
|
+
Object.assign(entry, properties);
|
|
152
|
+
} else {
|
|
153
|
+
properties = Object.assign({}, properties);
|
|
154
|
+
properties.guid = guid;
|
|
155
|
+
entry = this.createPromise(properties);
|
|
156
|
+
}
|
|
157
|
+
return entry;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
_PromiseAssembler = PromiseAssembler;
|
|
161
|
+
_PromiseAssembler.prototype.RSVP = RSVP;
|
|
162
|
+
function fulfill(event) {
|
|
163
|
+
const guid = event.guid;
|
|
164
|
+
const promise = this.updateOrCreate(guid, {
|
|
165
|
+
label: event.label,
|
|
166
|
+
settledAt: event.timeStamp,
|
|
167
|
+
state: 'fulfilled',
|
|
168
|
+
value: event.detail
|
|
169
|
+
});
|
|
170
|
+
this.trigger('fulfilled', {
|
|
171
|
+
promise
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
function reject(event) {
|
|
175
|
+
const guid = event.guid;
|
|
176
|
+
const promise = this.updateOrCreate(guid, {
|
|
177
|
+
label: event.label,
|
|
178
|
+
settledAt: event.timeStamp,
|
|
179
|
+
state: 'rejected',
|
|
180
|
+
reason: event.detail
|
|
181
|
+
});
|
|
182
|
+
this.trigger('rejected', {
|
|
183
|
+
promise
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
function chain(event) {
|
|
187
|
+
let guid = event.guid;
|
|
188
|
+
let promise = this.updateOrCreate(guid, {
|
|
189
|
+
label: event.label,
|
|
190
|
+
chainedAt: event.timeStamp
|
|
191
|
+
});
|
|
192
|
+
let children = promise.children;
|
|
193
|
+
let child = this.findOrCreate(event.childGuid);
|
|
194
|
+
child.parent = promise;
|
|
195
|
+
children.push(child);
|
|
196
|
+
this.trigger('chained', {
|
|
197
|
+
promise,
|
|
198
|
+
child
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
function create(event) {
|
|
202
|
+
const guid = event.guid;
|
|
203
|
+
const promise = this.updateOrCreate(guid, {
|
|
204
|
+
label: event.label,
|
|
205
|
+
createdAt: event.timeStamp,
|
|
206
|
+
stack: event.stack
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
// todo fix ordering
|
|
210
|
+
if (!promise.state) {
|
|
211
|
+
promise.state = 'created';
|
|
212
|
+
}
|
|
213
|
+
this.trigger('created', {
|
|
214
|
+
promise
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export { PromiseAssembler as default };
|