discourse-ember-source 3.5.1.1 → 3.5.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ember/version.rb +1 -1
- metadata +2 -740
- data/.gitignore +0 -9
- data/.travis.yml +0 -5
- data/Gemfile +0 -6
- data/LICENSE.txt +0 -21
- data/README +0 -18
- data/README.md +0 -39
- data/Rakefile +0 -27
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/discourse-ember-source-3.5.1.0.gem +0 -0
- data/dist/ember-all.debug.map +0 -1
- data/dist/ember-template-compiler.map +0 -1
- data/dist/ember-testing.map +0 -1
- data/dist/ember-tests.map +0 -1
- data/dist/ember-tests.prod.map +0 -1
- data/dist/ember.debug.map +0 -1
- data/dist/ember.min.map +0 -1
- data/dist/ember.prod.map +0 -1
- data/dist/es/@ember/application/globals-resolver.js +0 -425
- data/dist/es/@ember/application/index.js +0 -3
- data/dist/es/@ember/application/instance.js +0 -513
- data/dist/es/@ember/application/lib/application.js +0 -1139
- data/dist/es/@ember/application/lib/lazy_load.js +0 -69
- data/dist/es/@ember/application/lib/validate-type.js +0 -24
- data/dist/es/@ember/application/tests/application_instance_test.js +0 -230
- data/dist/es/@ember/application/tests/application_test.js +0 -470
- data/dist/es/@ember/application/tests/bootstrap-test.js +0 -28
- data/dist/es/@ember/application/tests/dependency_injection/custom_resolver_test.js +0 -32
- data/dist/es/@ember/application/tests/dependency_injection/default_resolver_test.js +0 -363
- data/dist/es/@ember/application/tests/dependency_injection/normalization_test.js +0 -70
- data/dist/es/@ember/application/tests/dependency_injection/to_string_test.js +0 -71
- data/dist/es/@ember/application/tests/dependency_injection_test.js +0 -93
- data/dist/es/@ember/application/tests/initializers_test.js +0 -391
- data/dist/es/@ember/application/tests/instance_initializers_test.js +0 -395
- data/dist/es/@ember/application/tests/lazy_load_test.js +0 -79
- data/dist/es/@ember/application/tests/logging_test.js +0 -179
- data/dist/es/@ember/application/tests/readiness_test.js +0 -138
- data/dist/es/@ember/application/tests/reset_test.js +0 -185
- data/dist/es/@ember/application/tests/visit_test.js +0 -783
- data/dist/es/@ember/canary-features/index.js +0 -76
- data/dist/es/@ember/controller/index.js +0 -50
- data/dist/es/@ember/controller/lib/controller_mixin.js +0 -42
- data/dist/es/@ember/controller/tests/controller_test.js +0 -209
- data/dist/es/@ember/debug/index.js +0 -264
- data/dist/es/@ember/debug/lib/deprecate.js +0 -198
- data/dist/es/@ember/debug/lib/handlers.js +0 -22
- data/dist/es/@ember/debug/lib/testing.js +0 -7
- data/dist/es/@ember/debug/lib/warn.js +0 -107
- data/dist/es/@ember/debug/tests/handlers-test.js +0 -144
- data/dist/es/@ember/debug/tests/main_test.js +0 -444
- data/dist/es/@ember/deprecated-features/index.js +0 -21
- data/dist/es/@ember/engine/index.js +0 -532
- data/dist/es/@ember/engine/instance.js +0 -228
- data/dist/es/@ember/engine/lib/engine-parent.js +0 -32
- data/dist/es/@ember/engine/tests/engine_initializers_test.js +0 -366
- data/dist/es/@ember/engine/tests/engine_instance_initializers_test.js +0 -409
- data/dist/es/@ember/engine/tests/engine_instance_test.js +0 -115
- data/dist/es/@ember/engine/tests/engine_parent_test.js +0 -20
- data/dist/es/@ember/engine/tests/engine_test.js +0 -121
- data/dist/es/@ember/error/index.js +0 -36
- data/dist/es/@ember/error/tests/index_test.js +0 -19
- data/dist/es/@ember/instrumentation/index.js +0 -240
- data/dist/es/@ember/instrumentation/tests/index-test.js +0 -214
- data/dist/es/@ember/map/index.js +0 -218
- data/dist/es/@ember/map/lib/ordered-set.js +0 -186
- data/dist/es/@ember/map/lib/utils.js +0 -29
- data/dist/es/@ember/map/tests/map_test.js +0 -578
- data/dist/es/@ember/map/with-default.js +0 -87
- data/dist/es/@ember/object/computed.js +0 -35
- data/dist/es/@ember/object/lib/computed/computed_macros.js +0 -742
- data/dist/es/@ember/object/lib/computed/reduce_computed_macros.js +0 -894
- data/dist/es/@ember/object/tests/computed/computed_macros_test.js +0 -533
- data/dist/es/@ember/object/tests/computed/reduce_computed_macros_test.js +0 -2243
- data/dist/es/@ember/polyfills/index.js +0 -3
- data/dist/es/@ember/polyfills/lib/assign.js +0 -43
- data/dist/es/@ember/polyfills/lib/merge.js +0 -35
- data/dist/es/@ember/polyfills/tests/assign_test.js +0 -64
- data/dist/es/@ember/runloop/index.js +0 -749
- data/dist/es/@ember/runloop/tests/debounce_test.js +0 -87
- data/dist/es/@ember/runloop/tests/later_test.js +0 -264
- data/dist/es/@ember/runloop/tests/next_test.js +0 -56
- data/dist/es/@ember/runloop/tests/once_test.js +0 -62
- data/dist/es/@ember/runloop/tests/onerror_test.js +0 -59
- data/dist/es/@ember/runloop/tests/run_bind_test.js +0 -59
- data/dist/es/@ember/runloop/tests/run_test.js +0 -28
- data/dist/es/@ember/runloop/tests/schedule_test.js +0 -86
- data/dist/es/@ember/runloop/tests/sync_test.js +0 -32
- data/dist/es/@ember/runloop/tests/unwind_test.js +0 -54
- data/dist/es/@ember/service/index.js +0 -57
- data/dist/es/@ember/string/index.js +0 -362
- data/dist/es/@ember/string/lib/string_registry.js +0 -13
- data/dist/es/@ember/string/tests/camelize_test.js +0 -53
- data/dist/es/@ember/string/tests/capitalize_test.js +0 -58
- data/dist/es/@ember/string/tests/classify_test.js +0 -79
- data/dist/es/@ember/string/tests/dasherize_test.js +0 -57
- data/dist/es/@ember/string/tests/decamelize_test.js +0 -51
- data/dist/es/@ember/string/tests/loc_test.js +0 -76
- data/dist/es/@ember/string/tests/underscore_test.js +0 -51
- data/dist/es/@ember/string/tests/w_test.js +0 -39
- data/dist/es/@glimmer/compiler.js +0 -1226
- data/dist/es/@glimmer/encoder.js +0 -39
- data/dist/es/@glimmer/low-level.js +0 -82
- data/dist/es/@glimmer/node.js +0 -112
- data/dist/es/@glimmer/opcode-compiler.js +0 -1999
- data/dist/es/@glimmer/program.js +0 -405
- data/dist/es/@glimmer/reference.js +0 -478
- data/dist/es/@glimmer/runtime.js +0 -4086
- data/dist/es/@glimmer/syntax.js +0 -1424
- data/dist/es/@glimmer/util.js +0 -189
- data/dist/es/@glimmer/vm.js +0 -27
- data/dist/es/@glimmer/wire-format.js +0 -56
- data/dist/es/backburner.js +0 -936
- data/dist/es/container/index.js +0 -8
- data/dist/es/container/lib/container.js +0 -437
- data/dist/es/container/lib/registry.js +0 -646
- data/dist/es/container/tests/container_test.js +0 -872
- data/dist/es/container/tests/owner_test.js +0 -20
- data/dist/es/container/tests/registry_test.js +0 -943
- data/dist/es/dag-map.js +0 -209
- data/dist/es/ember-browser-environment/index.js +0 -8
- data/dist/es/ember-browser-environment/lib/has-dom.js +0 -19
- data/dist/es/ember-console/index.js +0 -177
- data/dist/es/ember-environment/index.js +0 -3
- data/dist/es/ember-environment/lib/context.js +0 -20
- data/dist/es/ember-environment/lib/env.js +0 -185
- data/dist/es/ember-environment/lib/global.js +0 -14
- data/dist/es/ember-error-handling/index.js +0 -22
- data/dist/es/ember-extension-support/index.js +0 -2
- data/dist/es/ember-extension-support/lib/container_debug_adapter.js +0 -99
- data/dist/es/ember-extension-support/lib/data_adapter.js +0 -493
- data/dist/es/ember-extension-support/tests/container_debug_adapter_test.js +0 -73
- data/dist/es/ember-extension-support/tests/data_adapter_test.js +0 -301
- data/dist/es/ember-glimmer/index.js +0 -286
- data/dist/es/ember-glimmer/lib/compile-time-lookup.js +0 -37
- data/dist/es/ember-glimmer/lib/component-managers/abstract.js +0 -49
- data/dist/es/ember-glimmer/lib/component-managers/curly.js +0 -395
- data/dist/es/ember-glimmer/lib/component-managers/custom.js +0 -145
- data/dist/es/ember-glimmer/lib/component-managers/definition-state.js +0 -1
- data/dist/es/ember-glimmer/lib/component-managers/mount.js +0 -103
- data/dist/es/ember-glimmer/lib/component-managers/outlet.js +0 -114
- data/dist/es/ember-glimmer/lib/component-managers/render.js +0 -112
- data/dist/es/ember-glimmer/lib/component-managers/root.js +0 -74
- data/dist/es/ember-glimmer/lib/component-managers/template-only.js +0 -46
- data/dist/es/ember-glimmer/lib/component.js +0 -633
- data/dist/es/ember-glimmer/lib/components/checkbox.js +0 -57
- data/dist/es/ember-glimmer/lib/components/link-to.js +0 -777
- data/dist/es/ember-glimmer/lib/components/text_area.js +0 -236
- data/dist/es/ember-glimmer/lib/components/text_field.js +0 -145
- data/dist/es/ember-glimmer/lib/dom.js +0 -3
- data/dist/es/ember-glimmer/lib/environment.js +0 -102
- data/dist/es/ember-glimmer/lib/helper.js +0 -128
- data/dist/es/ember-glimmer/lib/helpers/-class.js +0 -23
- data/dist/es/ember-glimmer/lib/helpers/-html-safe.js +0 -9
- data/dist/es/ember-glimmer/lib/helpers/-input-type.js +0 -11
- data/dist/es/ember-glimmer/lib/helpers/-normalize-class.js +0 -22
- data/dist/es/ember-glimmer/lib/helpers/action.js +0 -360
- data/dist/es/ember-glimmer/lib/helpers/component.js +0 -135
- data/dist/es/ember-glimmer/lib/helpers/concat.js +0 -38
- data/dist/es/ember-glimmer/lib/helpers/each-in.js +0 -126
- data/dist/es/ember-glimmer/lib/helpers/get.js +0 -100
- data/dist/es/ember-glimmer/lib/helpers/hash.js +0 -44
- data/dist/es/ember-glimmer/lib/helpers/if-unless.js +0 -142
- data/dist/es/ember-glimmer/lib/helpers/loc.js +0 -40
- data/dist/es/ember-glimmer/lib/helpers/log.js +0 -25
- data/dist/es/ember-glimmer/lib/helpers/mut.js +0 -107
- data/dist/es/ember-glimmer/lib/helpers/query-param.js +0 -31
- data/dist/es/ember-glimmer/lib/helpers/readonly.js +0 -104
- data/dist/es/ember-glimmer/lib/helpers/unbound.js +0 -36
- data/dist/es/ember-glimmer/lib/modifiers/action.js +0 -185
- data/dist/es/ember-glimmer/lib/protocol-for-url.js +0 -48
- data/dist/es/ember-glimmer/lib/renderer.js +0 -371
- data/dist/es/ember-glimmer/lib/resolver.js +0 -290
- data/dist/es/ember-glimmer/lib/setup-registry.js +0 -77
- data/dist/es/ember-glimmer/lib/syntax.js +0 -73
- data/dist/es/ember-glimmer/lib/syntax/-text-area.js +0 -8
- data/dist/es/ember-glimmer/lib/syntax/input.js +0 -173
- data/dist/es/ember-glimmer/lib/syntax/let.js +0 -50
- data/dist/es/ember-glimmer/lib/syntax/mount.js +0 -101
- data/dist/es/ember-glimmer/lib/syntax/outlet.js +0 -120
- data/dist/es/ember-glimmer/lib/syntax/render.js +0 -140
- data/dist/es/ember-glimmer/lib/syntax/utils.js +0 -6
- data/dist/es/ember-glimmer/lib/template-compiler.js +0 -7
- data/dist/es/ember-glimmer/lib/template.js +0 -16
- data/dist/es/ember-glimmer/lib/template_registry.js +0 -18
- data/dist/es/ember-glimmer/lib/templates/component.js +0 -2
- data/dist/es/ember-glimmer/lib/templates/empty.js +0 -2
- data/dist/es/ember-glimmer/lib/templates/link-to.js +0 -2
- data/dist/es/ember-glimmer/lib/templates/outlet.js +0 -2
- data/dist/es/ember-glimmer/lib/templates/root.js +0 -2
- data/dist/es/ember-glimmer/lib/utils/bindings.js +0 -180
- data/dist/es/ember-glimmer/lib/utils/curly-component-state-bucket.js +0 -36
- data/dist/es/ember-glimmer/lib/utils/custom-component-manager.js +0 -20
- data/dist/es/ember-glimmer/lib/utils/debug-stack.js +0 -57
- data/dist/es/ember-glimmer/lib/utils/iterable.js +0 -358
- data/dist/es/ember-glimmer/lib/utils/outlet.js +0 -89
- data/dist/es/ember-glimmer/lib/utils/process-args.js +0 -40
- data/dist/es/ember-glimmer/lib/utils/references.js +0 -325
- data/dist/es/ember-glimmer/lib/utils/serialization-first-node-helpers.js +0 -1
- data/dist/es/ember-glimmer/lib/utils/string.js +0 -98
- data/dist/es/ember-glimmer/lib/utils/to-bool.js +0 -9
- data/dist/es/ember-glimmer/lib/views/outlet.js +0 -71
- data/dist/es/ember-glimmer/tests/integration/application/actions-test.js +0 -107
- data/dist/es/ember-glimmer/tests/integration/application/engine-test.js +0 -912
- data/dist/es/ember-glimmer/tests/integration/application/rendering-test.js +0 -530
- data/dist/es/ember-glimmer/tests/integration/components/angle-bracket-invocation-test.js +0 -852
- data/dist/es/ember-glimmer/tests/integration/components/append-test.js +0 -742
- data/dist/es/ember-glimmer/tests/integration/components/attribute-bindings-test.js +0 -999
- data/dist/es/ember-glimmer/tests/integration/components/attrs-lookup-test.js +0 -268
- data/dist/es/ember-glimmer/tests/integration/components/class-bindings-test.js +0 -849
- data/dist/es/ember-glimmer/tests/integration/components/contextual-components-test.js +0 -1493
- data/dist/es/ember-glimmer/tests/integration/components/curly-components-test.js +0 -3705
- data/dist/es/ember-glimmer/tests/integration/components/destroy-test.js +0 -33
- data/dist/es/ember-glimmer/tests/integration/components/dynamic-components-test.js +0 -896
- data/dist/es/ember-glimmer/tests/integration/components/error-handling-test.js +0 -164
- data/dist/es/ember-glimmer/tests/integration/components/fragment-components-test.js +0 -285
- data/dist/es/ember-glimmer/tests/integration/components/instrumentation-compile-test.js +0 -108
- data/dist/es/ember-glimmer/tests/integration/components/instrumentation-test.js +0 -157
- data/dist/es/ember-glimmer/tests/integration/components/life-cycle-test.js +0 -1653
- data/dist/es/ember-glimmer/tests/integration/components/link-to-test.js +0 -218
- data/dist/es/ember-glimmer/tests/integration/components/local-lookup-test.js +0 -414
- data/dist/es/ember-glimmer/tests/integration/components/namespaced-lookup-test.js +0 -185
- data/dist/es/ember-glimmer/tests/integration/components/render-to-element-test.js +0 -0
- data/dist/es/ember-glimmer/tests/integration/components/target-action-test.js +0 -779
- data/dist/es/ember-glimmer/tests/integration/components/template-only-components-test.js +0 -225
- data/dist/es/ember-glimmer/tests/integration/components/to-string-test.js +0 -27
- data/dist/es/ember-glimmer/tests/integration/components/utils-test.js +0 -401
- data/dist/es/ember-glimmer/tests/integration/components/web-component-fallback-test.js +0 -35
- data/dist/es/ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js +0 -40
- data/dist/es/ember-glimmer/tests/integration/content-test.js +0 -1759
- data/dist/es/ember-glimmer/tests/integration/custom-component-manager-test.js +0 -508
- data/dist/es/ember-glimmer/tests/integration/event-dispatcher-test.js +0 -607
- data/dist/es/ember-glimmer/tests/integration/helpers/-class-test.js +0 -76
- data/dist/es/ember-glimmer/tests/integration/helpers/closure-action-test.js +0 -1240
- data/dist/es/ember-glimmer/tests/integration/helpers/concat-test.js +0 -106
- data/dist/es/ember-glimmer/tests/integration/helpers/custom-helper-test.js +0 -672
- data/dist/es/ember-glimmer/tests/integration/helpers/element-action-test.js +0 -1595
- data/dist/es/ember-glimmer/tests/integration/helpers/get-test.js +0 -618
- data/dist/es/ember-glimmer/tests/integration/helpers/hash-test.js +0 -188
- data/dist/es/ember-glimmer/tests/integration/helpers/if-unless-test.js +0 -149
- data/dist/es/ember-glimmer/tests/integration/helpers/input-test.js +0 -827
- data/dist/es/ember-glimmer/tests/integration/helpers/loc-test.js +0 -103
- data/dist/es/ember-glimmer/tests/integration/helpers/log-test.js +0 -61
- data/dist/es/ember-glimmer/tests/integration/helpers/mut-test.js +0 -580
- data/dist/es/ember-glimmer/tests/integration/helpers/partial-test.js +0 -386
- data/dist/es/ember-glimmer/tests/integration/helpers/readonly-test.js +0 -293
- data/dist/es/ember-glimmer/tests/integration/helpers/render-test.js +0 -522
- data/dist/es/ember-glimmer/tests/integration/helpers/text-area-test.js +0 -166
- data/dist/es/ember-glimmer/tests/integration/helpers/unbound-test.js +0 -650
- data/dist/es/ember-glimmer/tests/integration/helpers/yield-test.js +0 -275
- data/dist/es/ember-glimmer/tests/integration/input-test.js +0 -242
- data/dist/es/ember-glimmer/tests/integration/mount-test.js +0 -424
- data/dist/es/ember-glimmer/tests/integration/outlet-test.js +0 -318
- data/dist/es/ember-glimmer/tests/integration/refinements-test.js +0 -74
- data/dist/es/ember-glimmer/tests/integration/render-settled-test.js +0 -72
- data/dist/es/ember-glimmer/tests/integration/svg-test.js +0 -158
- data/dist/es/ember-glimmer/tests/integration/syntax/each-in-test.js +0 -697
- data/dist/es/ember-glimmer/tests/integration/syntax/each-test.js +0 -1251
- data/dist/es/ember-glimmer/tests/integration/syntax/experimental-syntax-test.js +0 -42
- data/dist/es/ember-glimmer/tests/integration/syntax/if-unless-test.js +0 -108
- data/dist/es/ember-glimmer/tests/integration/syntax/in-element-test.js +0 -119
- data/dist/es/ember-glimmer/tests/integration/syntax/let-test.js +0 -390
- data/dist/es/ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js +0 -36
- data/dist/es/ember-glimmer/tests/integration/syntax/with-test.js +0 -422
- data/dist/es/ember-glimmer/tests/unit/outlet-test.js +0 -48
- data/dist/es/ember-glimmer/tests/unit/runtime-resolver-cache-test.js +0 -263
- data/dist/es/ember-glimmer/tests/unit/template-factory-test.js +0 -67
- data/dist/es/ember-glimmer/tests/unit/utils/debug-stack-test.js +0 -38
- data/dist/es/ember-glimmer/tests/utils/abstract-test-case.js +0 -1
- data/dist/es/ember-glimmer/tests/utils/helpers.js +0 -15
- data/dist/es/ember-glimmer/tests/utils/shared-conditional-tests.js +0 -965
- data/dist/es/ember-glimmer/tests/utils/string-test.js +0 -47
- data/dist/es/ember-glimmer/tests/utils/test-case.js +0 -6
- data/dist/es/ember-glimmer/tests/utils/test-helpers.js +0 -1
- data/dist/es/ember-meta/index.js +0 -1
- data/dist/es/ember-meta/lib/meta.js +0 -623
- data/dist/es/ember-meta/tests/meta_test.js +0 -169
- data/dist/es/ember-metal/index.js +0 -33
- data/dist/es/ember-metal/lib/alias.js +0 -80
- data/dist/es/ember-metal/lib/array.js +0 -55
- data/dist/es/ember-metal/lib/array_events.js +0 -65
- data/dist/es/ember-metal/lib/chains.js +0 -315
- data/dist/es/ember-metal/lib/change_event.js +0 -4
- data/dist/es/ember-metal/lib/computed.js +0 -526
- data/dist/es/ember-metal/lib/computed_cache.js +0 -58
- data/dist/es/ember-metal/lib/dependent_keys.js +0 -34
- data/dist/es/ember-metal/lib/deprecate_property.js +0 -34
- data/dist/es/ember-metal/lib/descriptor.js +0 -28
- data/dist/es/ember-metal/lib/each_proxy.js +0 -106
- data/dist/es/ember-metal/lib/each_proxy_events.js +0 -13
- data/dist/es/ember-metal/lib/events.js +0 -174
- data/dist/es/ember-metal/lib/expand_properties.js +0 -64
- data/dist/es/ember-metal/lib/get_properties.js +0 -45
- data/dist/es/ember-metal/lib/injected_property.js +0 -53
- data/dist/es/ember-metal/lib/is_blank.js +0 -34
- data/dist/es/ember-metal/lib/is_empty.js +0 -63
- data/dist/es/ember-metal/lib/is_none.js +0 -27
- data/dist/es/ember-metal/lib/is_present.js +0 -38
- data/dist/es/ember-metal/lib/libraries.js +0 -80
- data/dist/es/ember-metal/lib/mixin.js +0 -646
- data/dist/es/ember-metal/lib/namespace_search.js +0 -166
- data/dist/es/ember-metal/lib/observer.js +0 -34
- data/dist/es/ember-metal/lib/observer_set.js +0 -48
- data/dist/es/ember-metal/lib/path_cache.js +0 -5
- data/dist/es/ember-metal/lib/properties.js +0 -192
- data/dist/es/ember-metal/lib/property_events.js +0 -198
- data/dist/es/ember-metal/lib/property_get.js +0 -160
- data/dist/es/ember-metal/lib/property_set.js +0 -157
- data/dist/es/ember-metal/lib/set_properties.js +0 -43
- data/dist/es/ember-metal/lib/tags.js +0 -81
- data/dist/es/ember-metal/lib/tracked.js +0 -201
- data/dist/es/ember-metal/lib/transaction.js +0 -137
- data/dist/es/ember-metal/lib/watch_key.js +0 -113
- data/dist/es/ember-metal/lib/watch_path.js +0 -24
- data/dist/es/ember-metal/lib/watching.js +0 -54
- data/dist/es/ember-metal/tests/accessors/get_path_test.js +0 -82
- data/dist/es/ember-metal/tests/accessors/get_properties_test.js +0 -36
- data/dist/es/ember-metal/tests/accessors/get_test.js +0 -335
- data/dist/es/ember-metal/tests/accessors/mandatory_setters_test.js +0 -470
- data/dist/es/ember-metal/tests/accessors/set_path_test.js +0 -97
- data/dist/es/ember-metal/tests/accessors/set_test.js +0 -128
- data/dist/es/ember-metal/tests/alias_test.js +0 -167
- data/dist/es/ember-metal/tests/chains_test.js +0 -210
- data/dist/es/ember-metal/tests/computed_test.js +0 -1040
- data/dist/es/ember-metal/tests/descriptor_test.js +0 -368
- data/dist/es/ember-metal/tests/events_test.js +0 -210
- data/dist/es/ember-metal/tests/expand_properties_test.js +0 -119
- data/dist/es/ember-metal/tests/injected_property_test.js +0 -76
- data/dist/es/ember-metal/tests/is_blank_test.js +0 -29
- data/dist/es/ember-metal/tests/is_empty_test.js +0 -55
- data/dist/es/ember-metal/tests/is_none_test.js +0 -23
- data/dist/es/ember-metal/tests/is_present_test.js +0 -30
- data/dist/es/ember-metal/tests/libraries_test.js +0 -99
- data/dist/es/ember-metal/tests/main_test.js +0 -31
- data/dist/es/ember-metal/tests/mixin/alias_method_test.js +0 -91
- data/dist/es/ember-metal/tests/mixin/apply_test.js +0 -40
- data/dist/es/ember-metal/tests/mixin/computed_test.js +0 -166
- data/dist/es/ember-metal/tests/mixin/concatenated_properties_test.js +0 -117
- data/dist/es/ember-metal/tests/mixin/detect_test.js +0 -40
- data/dist/es/ember-metal/tests/mixin/introspection_test.js +0 -75
- data/dist/es/ember-metal/tests/mixin/merged_properties_test.js +0 -200
- data/dist/es/ember-metal/tests/mixin/method_test.js +0 -252
- data/dist/es/ember-metal/tests/mixin/observer_test.js +0 -202
- data/dist/es/ember-metal/tests/mixin/reopen_test.js +0 -53
- data/dist/es/ember-metal/tests/mixin/without_test.js +0 -22
- data/dist/es/ember-metal/tests/namespace_search_test.js +0 -16
- data/dist/es/ember-metal/tests/observer_test.js +0 -961
- data/dist/es/ember-metal/tests/performance_test.js +0 -81
- data/dist/es/ember-metal/tests/properties_test.js +0 -120
- data/dist/es/ember-metal/tests/property_did_change_hook.js +0 -73
- data/dist/es/ember-metal/tests/set_properties_test.js +0 -49
- data/dist/es/ember-metal/tests/tracked/computed_test.js +0 -67
- data/dist/es/ember-metal/tests/tracked/get_test.js +0 -86
- data/dist/es/ember-metal/tests/tracked/set_test.js +0 -44
- data/dist/es/ember-metal/tests/tracked/support.js +0 -37
- data/dist/es/ember-metal/tests/tracked/validation_test.js +0 -233
- data/dist/es/ember-metal/tests/watching/is_watching_test.js +0 -97
- data/dist/es/ember-metal/tests/watching/unwatch_test.js +0 -109
- data/dist/es/ember-metal/tests/watching/watch_test.js +0 -255
- data/dist/es/ember-owner/index.js +0 -66
- data/dist/es/ember-routing/index.js +0 -21
- data/dist/es/ember-routing/lib/ext/controller.js +0 -222
- data/dist/es/ember-routing/lib/location/api.js +0 -118
- data/dist/es/ember-routing/lib/location/auto_location.js +0 -323
- data/dist/es/ember-routing/lib/location/hash_location.js +0 -171
- data/dist/es/ember-routing/lib/location/history_location.js +0 -298
- data/dist/es/ember-routing/lib/location/none_location.js +0 -122
- data/dist/es/ember-routing/lib/location/util.js +0 -114
- data/dist/es/ember-routing/lib/services/router.js +0 -243
- data/dist/es/ember-routing/lib/services/routing.js +0 -101
- data/dist/es/ember-routing/lib/system/cache.js +0 -40
- data/dist/es/ember-routing/lib/system/controller_for.js +0 -14
- data/dist/es/ember-routing/lib/system/dsl.js +0 -208
- data/dist/es/ember-routing/lib/system/generate_controller.js +0 -54
- data/dist/es/ember-routing/lib/system/query_params.js +0 -6
- data/dist/es/ember-routing/lib/system/route.js +0 -2476
- data/dist/es/ember-routing/lib/system/router.js +0 -1607
- data/dist/es/ember-routing/lib/system/router_state.js +0 -26
- data/dist/es/ember-routing/lib/system/transition.js +0 -153
- data/dist/es/ember-routing/lib/utils.js +0 -230
- data/dist/es/ember-routing/tests/ext/controller_test.js +0 -85
- data/dist/es/ember-routing/tests/location/auto_location_test.js +0 -379
- data/dist/es/ember-routing/tests/location/hash_location_test.js +0 -207
- data/dist/es/ember-routing/tests/location/history_location_test.js +0 -322
- data/dist/es/ember-routing/tests/location/none_location_test.js +0 -88
- data/dist/es/ember-routing/tests/location/util_test.js +0 -159
- data/dist/es/ember-routing/tests/system/cache_test.js +0 -54
- data/dist/es/ember-routing/tests/system/controller_for_test.js +0 -75
- data/dist/es/ember-routing/tests/system/dsl_test.js +0 -413
- data/dist/es/ember-routing/tests/system/route_test.js +0 -587
- data/dist/es/ember-routing/tests/system/router_test.js +0 -287
- data/dist/es/ember-routing/tests/utils_test.js +0 -37
- data/dist/es/ember-runtime/.gitignore +0 -1
- data/dist/es/ember-runtime/README +0 -12
- data/dist/es/ember-runtime/index.js +0 -35
- data/dist/es/ember-runtime/lib/compare.js +0 -149
- data/dist/es/ember-runtime/lib/copy.js +0 -106
- data/dist/es/ember-runtime/lib/ext/function.js +0 -154
- data/dist/es/ember-runtime/lib/ext/rsvp.js +0 -59
- data/dist/es/ember-runtime/lib/is-equal.js +0 -60
- data/dist/es/ember-runtime/lib/mixins/-proxy.js +0 -109
- data/dist/es/ember-runtime/lib/mixins/action_handler.js +0 -222
- data/dist/es/ember-runtime/lib/mixins/array.js +0 -1661
- data/dist/es/ember-runtime/lib/mixins/comparable.js +0 -38
- data/dist/es/ember-runtime/lib/mixins/container_proxy.js +0 -154
- data/dist/es/ember-runtime/lib/mixins/copyable.js +0 -34
- data/dist/es/ember-runtime/lib/mixins/enumerable.js +0 -16
- data/dist/es/ember-runtime/lib/mixins/evented.js +0 -149
- data/dist/es/ember-runtime/lib/mixins/mutable_enumerable.js +0 -18
- data/dist/es/ember-runtime/lib/mixins/observable.js +0 -482
- data/dist/es/ember-runtime/lib/mixins/promise_proxy.js +0 -224
- data/dist/es/ember-runtime/lib/mixins/registry_proxy.js +0 -265
- data/dist/es/ember-runtime/lib/mixins/target_action_support.js +0 -172
- data/dist/es/ember-runtime/lib/system/array_proxy.js +0 -298
- data/dist/es/ember-runtime/lib/system/core_object.js +0 -1037
- data/dist/es/ember-runtime/lib/system/namespace.js +0 -69
- data/dist/es/ember-runtime/lib/system/object.js +0 -73
- data/dist/es/ember-runtime/lib/system/object_proxy.js +0 -81
- data/dist/es/ember-runtime/lib/type-of.js +0 -107
- data/dist/es/ember-runtime/tests/array/any-test.js +0 -55
- data/dist/es/ember-runtime/tests/array/compact-test.js +0 -12
- data/dist/es/ember-runtime/tests/array/every-test.js +0 -82
- data/dist/es/ember-runtime/tests/array/filter-test.js +0 -123
- data/dist/es/ember-runtime/tests/array/find-test.js +0 -86
- data/dist/es/ember-runtime/tests/array/firstObject-test.js +0 -27
- data/dist/es/ember-runtime/tests/array/forEach-test.js +0 -68
- data/dist/es/ember-runtime/tests/array/includes-test.js +0 -46
- data/dist/es/ember-runtime/tests/array/indexOf-test.js +0 -27
- data/dist/es/ember-runtime/tests/array/invoke-test.js +0 -60
- data/dist/es/ember-runtime/tests/array/isAny-test.js +0 -53
- data/dist/es/ember-runtime/tests/array/lastIndexOf-test.js +0 -78
- data/dist/es/ember-runtime/tests/array/lastObject-test.js +0 -31
- data/dist/es/ember-runtime/tests/array/map-test.js +0 -68
- data/dist/es/ember-runtime/tests/array/mapBy-test.js +0 -16
- data/dist/es/ember-runtime/tests/array/objectAt-test.js +0 -34
- data/dist/es/ember-runtime/tests/array/reduce-test.js +0 -24
- data/dist/es/ember-runtime/tests/array/reject-test.js +0 -134
- data/dist/es/ember-runtime/tests/array/sortBy-test.js +0 -23
- data/dist/es/ember-runtime/tests/array/toArray-test.js +0 -11
- data/dist/es/ember-runtime/tests/array/uniq-test.js +0 -27
- data/dist/es/ember-runtime/tests/array/uniqBy-test.js +0 -33
- data/dist/es/ember-runtime/tests/array/without-test.js +0 -39
- data/dist/es/ember-runtime/tests/copyable-array/copy-test.js +0 -12
- data/dist/es/ember-runtime/tests/core/compare_test.js +0 -89
- data/dist/es/ember-runtime/tests/core/copy_test.js +0 -47
- data/dist/es/ember-runtime/tests/core/isEqual_test.js +0 -65
- data/dist/es/ember-runtime/tests/core/is_array_test.js +0 -59
- data/dist/es/ember-runtime/tests/core/is_empty_test.js +0 -15
- data/dist/es/ember-runtime/tests/core/type_of_test.js +0 -54
- data/dist/es/ember-runtime/tests/ext/function_test.js +0 -121
- data/dist/es/ember-runtime/tests/ext/rsvp_test.js +0 -269
- data/dist/es/ember-runtime/tests/helpers/array.js +0 -336
- data/dist/es/ember-runtime/tests/inject_test.js +0 -51
- data/dist/es/ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js +0 -63
- data/dist/es/ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js +0 -892
- data/dist/es/ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js +0 -142
- data/dist/es/ember-runtime/tests/legacy_1x/system/object/base_test.js +0 -98
- data/dist/es/ember-runtime/tests/legacy_1x/system/object/concatenated_test.js +0 -131
- data/dist/es/ember-runtime/tests/mixins/array_test.js +0 -400
- data/dist/es/ember-runtime/tests/mixins/comparable_test.js +0 -37
- data/dist/es/ember-runtime/tests/mixins/container_proxy_test.js +0 -48
- data/dist/es/ember-runtime/tests/mixins/enumerable_test.js +0 -17
- data/dist/es/ember-runtime/tests/mixins/evented_test.js +0 -23
- data/dist/es/ember-runtime/tests/mixins/mutable_enumerable_test.js +0 -17
- data/dist/es/ember-runtime/tests/mixins/observable_test.js +0 -137
- data/dist/es/ember-runtime/tests/mixins/promise_proxy_test.js +0 -593
- data/dist/es/ember-runtime/tests/mixins/target_action_support_test.js +0 -237
- data/dist/es/ember-runtime/tests/mutable-array/addObject-test.js +0 -76
- data/dist/es/ember-runtime/tests/mutable-array/clear-test.js +0 -64
- data/dist/es/ember-runtime/tests/mutable-array/insertAt-test.js +0 -216
- data/dist/es/ember-runtime/tests/mutable-array/popObject-test.js +0 -91
- data/dist/es/ember-runtime/tests/mutable-array/pushObject-test.js +0 -98
- data/dist/es/ember-runtime/tests/mutable-array/pushObjects-test.js +0 -12
- data/dist/es/ember-runtime/tests/mutable-array/removeAt-test.js +0 -187
- data/dist/es/ember-runtime/tests/mutable-array/removeObject-test.js +0 -77
- data/dist/es/ember-runtime/tests/mutable-array/removeObjects-test.js +0 -202
- data/dist/es/ember-runtime/tests/mutable-array/replace-test.js +0 -221
- data/dist/es/ember-runtime/tests/mutable-array/reverseObjects-test.js +0 -35
- data/dist/es/ember-runtime/tests/mutable-array/setObjects-test.js +0 -63
- data/dist/es/ember-runtime/tests/mutable-array/shiftObject-test.js +0 -105
- data/dist/es/ember-runtime/tests/mutable-array/unshiftObject-test.js +0 -99
- data/dist/es/ember-runtime/tests/mutable-array/unshiftObjects-test.js +0 -102
- data/dist/es/ember-runtime/tests/system/array_proxy/arranged_content_test.js +0 -275
- data/dist/es/ember-runtime/tests/system/array_proxy/array_observer_test.js +0 -51
- data/dist/es/ember-runtime/tests/system/array_proxy/content_change_test.js +0 -85
- data/dist/es/ember-runtime/tests/system/array_proxy/length_test.js +0 -201
- data/dist/es/ember-runtime/tests/system/array_proxy/watching_and_listening_test.js +0 -157
- data/dist/es/ember-runtime/tests/system/core_object_test.js +0 -114
- data/dist/es/ember-runtime/tests/system/namespace/base_test.js +0 -175
- data/dist/es/ember-runtime/tests/system/native_array/a_test.js +0 -16
- data/dist/es/ember-runtime/tests/system/native_array/copyable_suite_test.js +0 -19
- data/dist/es/ember-runtime/tests/system/native_array/replace_test.js +0 -17
- data/dist/es/ember-runtime/tests/system/object/computed_test.js +0 -352
- data/dist/es/ember-runtime/tests/system/object/create_test.js +0 -135
- data/dist/es/ember-runtime/tests/system/object/destroy_test.js +0 -146
- data/dist/es/ember-runtime/tests/system/object/detectInstance_test.js +0 -38
- data/dist/es/ember-runtime/tests/system/object/detect_test.js +0 -33
- data/dist/es/ember-runtime/tests/system/object/es-compatibility-test.js +0 -469
- data/dist/es/ember-runtime/tests/system/object/events_test.js +0 -156
- data/dist/es/ember-runtime/tests/system/object/extend_test.js +0 -153
- data/dist/es/ember-runtime/tests/system/object/observer_test.js +0 -216
- data/dist/es/ember-runtime/tests/system/object/reopenClass_test.js +0 -36
- data/dist/es/ember-runtime/tests/system/object/reopen_test.js +0 -48
- data/dist/es/ember-runtime/tests/system/object/strict-mode-test.js +0 -31
- data/dist/es/ember-runtime/tests/system/object/toString_test.js +0 -125
- data/dist/es/ember-runtime/tests/system/object_proxy_test.js +0 -314
- data/dist/es/ember-template-compiler/index.js +0 -26
- data/dist/es/ember-template-compiler/lib/compat.js +0 -16
- data/dist/es/ember-template-compiler/lib/plugins/assert-if-helper-without-arguments.js +0 -38
- data/dist/es/ember-template-compiler/lib/plugins/assert-input-helper-without-block.js +0 -20
- data/dist/es/ember-template-compiler/lib/plugins/assert-reserved-named-arguments.js +0 -26
- data/dist/es/ember-template-compiler/lib/plugins/assert-splattribute-expression.js +0 -27
- data/dist/es/ember-template-compiler/lib/plugins/deprecate-render-model.js +0 -38
- data/dist/es/ember-template-compiler/lib/plugins/deprecate-render.js +0 -41
- data/dist/es/ember-template-compiler/lib/plugins/deprecate-send-action.js +0 -42
- data/dist/es/ember-template-compiler/lib/plugins/index.js +0 -50
- data/dist/es/ember-template-compiler/lib/plugins/transform-action-syntax.js +0 -52
- data/dist/es/ember-template-compiler/lib/plugins/transform-angle-bracket-components.js +0 -10
- data/dist/es/ember-template-compiler/lib/plugins/transform-attrs-into-args.js +0 -62
- data/dist/es/ember-template-compiler/lib/plugins/transform-dot-component-invocation.js +0 -88
- data/dist/es/ember-template-compiler/lib/plugins/transform-each-in-into-each.js +0 -48
- data/dist/es/ember-template-compiler/lib/plugins/transform-has-block-syntax.js +0 -46
- data/dist/es/ember-template-compiler/lib/plugins/transform-in-element.js +0 -83
- data/dist/es/ember-template-compiler/lib/plugins/transform-inline-link-to.js +0 -31
- data/dist/es/ember-template-compiler/lib/plugins/transform-input-type-syntax.js +0 -52
- data/dist/es/ember-template-compiler/lib/plugins/transform-old-binding-syntax.js +0 -48
- data/dist/es/ember-template-compiler/lib/plugins/transform-old-class-binding-syntax.js +0 -102
- data/dist/es/ember-template-compiler/lib/plugins/transform-quoted-bindings-into-just-bindings.js +0 -34
- data/dist/es/ember-template-compiler/lib/plugins/transform-top-level-components.js +0 -41
- data/dist/es/ember-template-compiler/lib/system/bootstrap.js +0 -44
- data/dist/es/ember-template-compiler/lib/system/calculate-location-display.js +0 -20
- data/dist/es/ember-template-compiler/lib/system/compile-options.js +0 -71
- data/dist/es/ember-template-compiler/lib/system/compile.js +0 -28
- data/dist/es/ember-template-compiler/lib/system/dasherize-component-name.js +0 -13
- data/dist/es/ember-template-compiler/lib/system/initializer.js +0 -22
- data/dist/es/ember-template-compiler/lib/system/precompile.js +0 -18
- data/dist/es/ember-template-compiler/tests/plugins/assert-if-helper-without-arguments-test.js +0 -51
- data/dist/es/ember-template-compiler/tests/plugins/assert-input-helper-without-block-test.js +0 -17
- data/dist/es/ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js +0 -416
- data/dist/es/ember-template-compiler/tests/plugins/assert-splattribute-expression-test.js +0 -57
- data/dist/es/ember-template-compiler/tests/plugins/deprecate-render-model-test.js +0 -19
- data/dist/es/ember-template-compiler/tests/plugins/deprecate-render-test.js +0 -19
- data/dist/es/ember-template-compiler/tests/plugins/deprecate-send-action-test.js +0 -29
- data/dist/es/ember-template-compiler/tests/plugins/transform-dot-component-invocation-test.js +0 -27
- data/dist/es/ember-template-compiler/tests/plugins/transform-inline-link-to-test.js +0 -15
- data/dist/es/ember-template-compiler/tests/plugins/transform-input-type-syntax-test.js +0 -25
- data/dist/es/ember-template-compiler/tests/system/bootstrap-test.js +0 -155
- data/dist/es/ember-template-compiler/tests/system/compile_options_test.js +0 -115
- data/dist/es/ember-template-compiler/tests/system/dasherize-component-name-test.js +0 -19
- data/dist/es/ember-testing/index.js +0 -10
- data/dist/es/ember-testing/lib/adapters/adapter.js +0 -58
- data/dist/es/ember-testing/lib/adapters/qunit.js +0 -47
- data/dist/es/ember-testing/lib/events.js +0 -136
- data/dist/es/ember-testing/lib/ext/application.js +0 -191
- data/dist/es/ember-testing/lib/ext/rsvp.js +0 -19
- data/dist/es/ember-testing/lib/helpers.js +0 -30
- data/dist/es/ember-testing/lib/helpers/-is-form-control.js +0 -16
- data/dist/es/ember-testing/lib/helpers/and_then.js +0 -3
- data/dist/es/ember-testing/lib/helpers/click.js +0 -36
- data/dist/es/ember-testing/lib/helpers/current_path.js +0 -27
- data/dist/es/ember-testing/lib/helpers/current_route_name.js +0 -25
- data/dist/es/ember-testing/lib/helpers/current_url.js +0 -27
- data/dist/es/ember-testing/lib/helpers/fill_in.js +0 -46
- data/dist/es/ember-testing/lib/helpers/find.js +0 -41
- data/dist/es/ember-testing/lib/helpers/find_with_assert.js +0 -34
- data/dist/es/ember-testing/lib/helpers/key_event.js +0 -36
- data/dist/es/ember-testing/lib/helpers/pause_test.js +0 -65
- data/dist/es/ember-testing/lib/helpers/trigger_event.js +0 -62
- data/dist/es/ember-testing/lib/helpers/visit.js +0 -42
- data/dist/es/ember-testing/lib/helpers/wait.js +0 -72
- data/dist/es/ember-testing/lib/initializers.js +0 -17
- data/dist/es/ember-testing/lib/setup_for_testing.js +0 -44
- data/dist/es/ember-testing/lib/support.js +0 -62
- data/dist/es/ember-testing/lib/test.js +0 -70
- data/dist/es/ember-testing/lib/test/adapter.js +0 -33
- data/dist/es/ember-testing/lib/test/helpers.js +0 -125
- data/dist/es/ember-testing/lib/test/on_inject_helpers.js +0 -38
- data/dist/es/ember-testing/lib/test/pending_requests.js +0 -24
- data/dist/es/ember-testing/lib/test/promise.js +0 -79
- data/dist/es/ember-testing/lib/test/run.js +0 -9
- data/dist/es/ember-testing/lib/test/waiters.js +0 -117
- data/dist/es/ember-testing/tests/acceptance_test.js +0 -478
- data/dist/es/ember-testing/tests/adapters/adapter_test.js +0 -31
- data/dist/es/ember-testing/tests/adapters/qunit_test.js +0 -50
- data/dist/es/ember-testing/tests/adapters_test.js +0 -405
- data/dist/es/ember-testing/tests/ext/rsvp_test.js +0 -124
- data/dist/es/ember-testing/tests/helper_registration_test.js +0 -98
- data/dist/es/ember-testing/tests/helpers_test.js +0 -1228
- data/dist/es/ember-testing/tests/integration_test.js +0 -106
- data/dist/es/ember-testing/tests/reexports_test.js +0 -26
- data/dist/es/ember-testing/tests/test/waiters-test.js +0 -145
- data/dist/es/ember-utils/index.js +0 -28
- data/dist/es/ember-utils/lib/cache.js +0 -36
- data/dist/es/ember-utils/lib/dictionary.js +0 -11
- data/dist/es/ember-utils/lib/guid.js +0 -120
- data/dist/es/ember-utils/lib/inspect.js +0 -112
- data/dist/es/ember-utils/lib/intern.js +0 -49
- data/dist/es/ember-utils/lib/invoke.js +0 -53
- data/dist/es/ember-utils/lib/is_proxy.js +0 -14
- data/dist/es/ember-utils/lib/lookup-descriptor.js +0 -11
- data/dist/es/ember-utils/lib/make-array.js +0 -7
- data/dist/es/ember-utils/lib/name.js +0 -9
- data/dist/es/ember-utils/lib/proxy-utils.js +0 -1
- data/dist/es/ember-utils/lib/spec.js +0 -14
- data/dist/es/ember-utils/lib/super.js +0 -83
- data/dist/es/ember-utils/lib/symbol-utils.js +0 -8
- data/dist/es/ember-utils/lib/symbol.js +0 -15
- data/dist/es/ember-utils/lib/to-string.js +0 -35
- data/dist/es/ember-utils/lib/weak_set.js +0 -18
- data/dist/es/ember-utils/tests/cache_test.js +0 -77
- data/dist/es/ember-utils/tests/can_invoke_test.js +0 -46
- data/dist/es/ember-utils/tests/checkHasSuper_test.js +0 -17
- data/dist/es/ember-utils/tests/generate_guid_test.js +0 -13
- data/dist/es/ember-utils/tests/guid_for_test.js +0 -101
- data/dist/es/ember-utils/tests/inspect_test.js +0 -146
- data/dist/es/ember-utils/tests/is_proxy_test.js +0 -18
- data/dist/es/ember-utils/tests/make_array_test.js +0 -41
- data/dist/es/ember-utils/tests/to-string-test.js +0 -32
- data/dist/es/ember-utils/tests/try_invoke_test.js +0 -48
- data/dist/es/ember-views/index.js +0 -28
- data/dist/es/ember-views/lib/compat/attrs.js +0 -3
- data/dist/es/ember-views/lib/compat/fallback-view-registry.js +0 -3
- data/dist/es/ember-views/lib/component_lookup.js +0 -27
- data/dist/es/ember-views/lib/mixins/action_support.js +0 -189
- data/dist/es/ember-views/lib/mixins/child_views_support.js +0 -27
- data/dist/es/ember-views/lib/mixins/class_names_support.js +0 -102
- data/dist/es/ember-views/lib/mixins/text_support.js +0 -333
- data/dist/es/ember-views/lib/mixins/view_state_support.js +0 -19
- data/dist/es/ember-views/lib/mixins/view_support.js +0 -452
- data/dist/es/ember-views/lib/system/action_manager.js +0 -14
- data/dist/es/ember-views/lib/system/event_dispatcher.js +0 -454
- data/dist/es/ember-views/lib/system/jquery.js +0 -29
- data/dist/es/ember-views/lib/system/jquery_event_deprecation.js +0 -61
- data/dist/es/ember-views/lib/system/lookup_partial.js +0 -55
- data/dist/es/ember-views/lib/system/utils.js +0 -201
- data/dist/es/ember-views/lib/utils/lookup-component.js +0 -58
- data/dist/es/ember-views/lib/views/core_view.js +0 -83
- data/dist/es/ember-views/lib/views/states.js +0 -48
- data/dist/es/ember-views/lib/views/states/default.js +0 -17
- data/dist/es/ember-views/lib/views/states/destroying.js +0 -16
- data/dist/es/ember-views/lib/views/states/has_element.js +0 -31
- data/dist/es/ember-views/lib/views/states/in_dom.js +0 -28
- data/dist/es/ember-views/lib/views/states/pre_render.js +0 -3
- data/dist/es/ember/index.js +0 -645
- data/dist/es/ember/tests/application_lifecycle_test.js +0 -188
- data/dist/es/ember/tests/component_context_test.js +0 -255
- data/dist/es/ember/tests/component_registration_test.js +0 -252
- data/dist/es/ember/tests/controller_test.js +0 -44
- data/dist/es/ember/tests/error_handler_test.js +0 -581
- data/dist/es/ember/tests/helpers/helper_registration_test.js +0 -103
- data/dist/es/ember/tests/helpers/link_to_test.js +0 -2103
- data/dist/es/ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js +0 -342
- data/dist/es/ember/tests/helpers/link_to_test/link_to_with_query_params_test.js +0 -694
- data/dist/es/ember/tests/homepage_example_test.js +0 -47
- data/dist/es/ember/tests/integration/multiple-app-test.js +0 -101
- data/dist/es/ember/tests/production_build_test.js +0 -34
- data/dist/es/ember/tests/reexports_test.js +0 -307
- data/dist/es/ember/tests/routing/decoupled_basic_test.js +0 -4506
- data/dist/es/ember/tests/routing/query_params_test.js +0 -1579
- data/dist/es/ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js +0 -1117
- data/dist/es/ember/tests/routing/query_params_test/overlapping_query_params_test.js +0 -185
- data/dist/es/ember/tests/routing/query_params_test/query_param_async_get_handler_test.js +0 -327
- data/dist/es/ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js +0 -37
- data/dist/es/ember/tests/routing/query_params_test/shared_state_test.js +0 -84
- data/dist/es/ember/tests/routing/router_map_test.js +0 -46
- data/dist/es/ember/tests/routing/router_service_test/basic_test.js +0 -95
- data/dist/es/ember/tests/routing/router_service_test/currenturl_lifecycle_test.js +0 -149
- data/dist/es/ember/tests/routing/router_service_test/isActive_test.js +0 -113
- data/dist/es/ember/tests/routing/router_service_test/replaceWith_test.js +0 -144
- data/dist/es/ember/tests/routing/router_service_test/transitionTo_test.js +0 -370
- data/dist/es/ember/tests/routing/router_service_test/urlFor_test.js +0 -307
- data/dist/es/ember/tests/routing/substates_test.js +0 -1110
- data/dist/es/ember/tests/routing/toplevel_dom_test.js +0 -37
- data/dist/es/ember/tests/service_injection_test.js +0 -278
- data/dist/es/ember/tests/view_instrumentation_test.js +0 -47
- data/dist/es/ember/version.js +0 -1
- data/dist/es/handlebars.js +0 -1268
- data/dist/es/internal-test-helpers/index.js +0 -31
- data/dist/es/internal-test-helpers/lib/.gitkeep +0 -0
- data/dist/es/internal-test-helpers/lib/apply-mixins.js +0 -37
- data/dist/es/internal-test-helpers/lib/browser-detect.js +0 -4
- data/dist/es/internal-test-helpers/lib/build-owner.js +0 -49
- data/dist/es/internal-test-helpers/lib/confirm-export.js +0 -45
- data/dist/es/internal-test-helpers/lib/ember-dev/assertion.js +0 -87
- data/dist/es/internal-test-helpers/lib/ember-dev/containers.js +0 -34
- data/dist/es/internal-test-helpers/lib/ember-dev/debug.js +0 -47
- data/dist/es/internal-test-helpers/lib/ember-dev/deprecation.js +0 -71
- data/dist/es/internal-test-helpers/lib/ember-dev/index.js +0 -19
- data/dist/es/internal-test-helpers/lib/ember-dev/method-call-tracker.js +0 -127
- data/dist/es/internal-test-helpers/lib/ember-dev/namespaces.js +0 -34
- data/dist/es/internal-test-helpers/lib/ember-dev/run-loop.js +0 -28
- data/dist/es/internal-test-helpers/lib/ember-dev/setup-qunit.js +0 -26
- data/dist/es/internal-test-helpers/lib/ember-dev/utils.js +0 -33
- data/dist/es/internal-test-helpers/lib/ember-dev/warning.js +0 -71
- data/dist/es/internal-test-helpers/lib/equal-inner-html.js +0 -37
- data/dist/es/internal-test-helpers/lib/equal-tokens.js +0 -53
- data/dist/es/internal-test-helpers/lib/factory.js +0 -65
- data/dist/es/internal-test-helpers/lib/get-all-property-names.js +0 -12
- data/dist/es/internal-test-helpers/lib/get-text-of.js +0 -3
- data/dist/es/internal-test-helpers/lib/matchers.js +0 -167
- data/dist/es/internal-test-helpers/lib/module-for.js +0 -89
- data/dist/es/internal-test-helpers/lib/registry-check.js +0 -28
- data/dist/es/internal-test-helpers/lib/run.js +0 -11
- data/dist/es/internal-test-helpers/lib/strip.js +0 -12
- data/dist/es/internal-test-helpers/lib/system/synthetic-events.js +0 -183
- data/dist/es/internal-test-helpers/lib/test-cases/abstract-application.js +0 -70
- data/dist/es/internal-test-helpers/lib/test-cases/abstract-rendering.js +0 -203
- data/dist/es/internal-test-helpers/lib/test-cases/abstract.js +0 -222
- data/dist/es/internal-test-helpers/lib/test-cases/application.js +0 -39
- data/dist/es/internal-test-helpers/lib/test-cases/autoboot-application.js +0 -34
- data/dist/es/internal-test-helpers/lib/test-cases/default-resolver-application.js +0 -43
- data/dist/es/internal-test-helpers/lib/test-cases/node-query.js +0 -120
- data/dist/es/internal-test-helpers/lib/test-cases/query-param.js +0 -124
- data/dist/es/internal-test-helpers/lib/test-cases/rendering.js +0 -14
- data/dist/es/internal-test-helpers/lib/test-cases/router.js +0 -26
- data/dist/es/internal-test-helpers/lib/test-cases/test-resolver-application.js +0 -40
- data/dist/es/internal-test-helpers/lib/test-resolver.js +0 -86
- data/dist/es/internal-test-helpers/tests/index-test.js +0 -10
- data/dist/es/route-recognizer.js +0 -685
- data/dist/es/router.js +0 -2454
- data/dist/es/rsvp.js +0 -2394
- data/dist/es/simple-html-tokenizer.js +0 -638
- data/dist/jquery/jquery.js +0 -10364
- data/dist/node/app-boot-test.js +0 -146
- data/dist/node/build-info-test.js +0 -177
- data/dist/node/component-rendering-test.js +0 -34
- data/dist/node/helpers/app-module.js +0 -198
- data/dist/node/helpers/assert-html-matches.js +0 -25
- data/dist/node/helpers/build-owner.js +0 -28
- data/dist/node/helpers/component-module.js +0 -137
- data/dist/node/sourcemap-test.js +0 -27
- data/dist/node/template-compiler-test.js +0 -45
- data/dist/node/visit-test.js +0 -349
- data/dist/qunit/qunit.css +0 -436
- data/dist/qunit/qunit.js +0 -5188
- data/dist/tests/index.html +0 -254
- data/ember-source.gemspec +0 -28
- data/node_modules/.yarn-integrity +0 -10
- data/yarn.lock +0 -4
@@ -1,1139 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
@module @ember/application
|
3
|
-
*/
|
4
|
-
|
5
|
-
import { dictionary } from 'ember-utils';
|
6
|
-
import { ENV } from 'ember-environment';
|
7
|
-
import { hasDOM } from 'ember-browser-environment';
|
8
|
-
import { assert, isTesting } from '@ember/debug';
|
9
|
-
import { DEBUG } from '@glimmer/env';
|
10
|
-
import { bind, join, once, run, schedule } from '@ember/runloop';
|
11
|
-
import { libraries, processAllNamespaces, setNamespaceSearchDisabled } from 'ember-metal';
|
12
|
-
import { _loaded, runLoadHooks } from './lazy_load';
|
13
|
-
import { RSVP } from 'ember-runtime';
|
14
|
-
import { EventDispatcher, jQuery, jQueryDisabled } from 'ember-views';
|
15
|
-
import {
|
16
|
-
Route,
|
17
|
-
Router,
|
18
|
-
HashLocation,
|
19
|
-
HistoryLocation,
|
20
|
-
AutoLocation,
|
21
|
-
NoneLocation,
|
22
|
-
BucketCache,
|
23
|
-
} from 'ember-routing';
|
24
|
-
import ApplicationInstance from '../instance';
|
25
|
-
import Engine from '@ember/engine';
|
26
|
-
import { privatize as P } from 'container';
|
27
|
-
import { setupApplicationRegistry } from 'ember-glimmer';
|
28
|
-
import { RouterService } from 'ember-routing';
|
29
|
-
import { EMBER_ROUTING_ROUTER_SERVICE } from '@ember/canary-features';
|
30
|
-
|
31
|
-
let librariesRegistered = false;
|
32
|
-
|
33
|
-
/**
|
34
|
-
An instance of `Application` is the starting point for every Ember
|
35
|
-
application. It helps to instantiate, initialize and coordinate the many
|
36
|
-
objects that make up your app.
|
37
|
-
|
38
|
-
Each Ember app has one and only one `Application` object. In fact, the
|
39
|
-
very first thing you should do in your application is create the instance:
|
40
|
-
|
41
|
-
```javascript
|
42
|
-
import Application from '@ember/application';
|
43
|
-
|
44
|
-
window.App = Application.create();
|
45
|
-
```
|
46
|
-
|
47
|
-
Typically, the application object is the only global variable. All other
|
48
|
-
classes in your app should be properties on the `Application` instance,
|
49
|
-
which highlights its first role: a global namespace.
|
50
|
-
|
51
|
-
For example, if you define a view class, it might look like this:
|
52
|
-
|
53
|
-
```javascript
|
54
|
-
import Application from '@ember/application';
|
55
|
-
|
56
|
-
App.MyView = Ember.View.extend();
|
57
|
-
```
|
58
|
-
|
59
|
-
By default, calling `Application.create()` will automatically initialize
|
60
|
-
your application by calling the `Application.initialize()` method. If
|
61
|
-
you need to delay initialization, you can call your app's `deferReadiness()`
|
62
|
-
method. When you are ready for your app to be initialized, call its
|
63
|
-
`advanceReadiness()` method.
|
64
|
-
|
65
|
-
You can define a `ready` method on the `Application` instance, which
|
66
|
-
will be run by Ember when the application is initialized.
|
67
|
-
|
68
|
-
Because `Application` inherits from `Ember.Namespace`, any classes
|
69
|
-
you create will have useful string representations when calling `toString()`.
|
70
|
-
See the `Ember.Namespace` documentation for more information.
|
71
|
-
|
72
|
-
While you can think of your `Application` as a container that holds the
|
73
|
-
other classes in your application, there are several other responsibilities
|
74
|
-
going on under-the-hood that you may want to understand.
|
75
|
-
|
76
|
-
### Event Delegation
|
77
|
-
|
78
|
-
Ember uses a technique called _event delegation_. This allows the framework
|
79
|
-
to set up a global, shared event listener instead of requiring each view to
|
80
|
-
do it manually. For example, instead of each view registering its own
|
81
|
-
`mousedown` listener on its associated element, Ember sets up a `mousedown`
|
82
|
-
listener on the `body`.
|
83
|
-
|
84
|
-
If a `mousedown` event occurs, Ember will look at the target of the event and
|
85
|
-
start walking up the DOM node tree, finding corresponding views and invoking
|
86
|
-
their `mouseDown` method as it goes.
|
87
|
-
|
88
|
-
`Application` has a number of default events that it listens for, as
|
89
|
-
well as a mapping from lowercase events to camel-cased view method names. For
|
90
|
-
example, the `keypress` event causes the `keyPress` method on the view to be
|
91
|
-
called, the `dblclick` event causes `doubleClick` to be called, and so on.
|
92
|
-
|
93
|
-
If there is a bubbling browser event that Ember does not listen for by
|
94
|
-
default, you can specify custom events and their corresponding view method
|
95
|
-
names by setting the application's `customEvents` property:
|
96
|
-
|
97
|
-
```javascript
|
98
|
-
import Application from '@ember/application';
|
99
|
-
|
100
|
-
let App = Application.create({
|
101
|
-
customEvents: {
|
102
|
-
// add support for the paste event
|
103
|
-
paste: 'paste'
|
104
|
-
}
|
105
|
-
});
|
106
|
-
```
|
107
|
-
|
108
|
-
To prevent Ember from setting up a listener for a default event,
|
109
|
-
specify the event name with a `null` value in the `customEvents`
|
110
|
-
property:
|
111
|
-
|
112
|
-
```javascript
|
113
|
-
import Application from '@ember/application';
|
114
|
-
|
115
|
-
let App = Application.create({
|
116
|
-
customEvents: {
|
117
|
-
// prevent listeners for mouseenter/mouseleave events
|
118
|
-
mouseenter: null,
|
119
|
-
mouseleave: null
|
120
|
-
}
|
121
|
-
});
|
122
|
-
```
|
123
|
-
|
124
|
-
By default, the application sets up these event listeners on the document
|
125
|
-
body. However, in cases where you are embedding an Ember application inside
|
126
|
-
an existing page, you may want it to set up the listeners on an element
|
127
|
-
inside the body.
|
128
|
-
|
129
|
-
For example, if only events inside a DOM element with the ID of `ember-app`
|
130
|
-
should be delegated, set your application's `rootElement` property:
|
131
|
-
|
132
|
-
```javascript
|
133
|
-
import Application from '@ember/application';
|
134
|
-
|
135
|
-
let App = Application.create({
|
136
|
-
rootElement: '#ember-app'
|
137
|
-
});
|
138
|
-
```
|
139
|
-
|
140
|
-
The `rootElement` can be either a DOM element or a jQuery-compatible selector
|
141
|
-
string. Note that *views appended to the DOM outside the root element will
|
142
|
-
not receive events.* If you specify a custom root element, make sure you only
|
143
|
-
append views inside it!
|
144
|
-
|
145
|
-
To learn more about the events Ember components use, see
|
146
|
-
|
147
|
-
[components/handling-events](https://guides.emberjs.com/release/components/handling-events/#toc_event-names).
|
148
|
-
|
149
|
-
### Initializers
|
150
|
-
|
151
|
-
Libraries on top of Ember can add initializers, like so:
|
152
|
-
|
153
|
-
```javascript
|
154
|
-
import Application from '@ember/application';
|
155
|
-
|
156
|
-
Application.initializer({
|
157
|
-
name: 'api-adapter',
|
158
|
-
|
159
|
-
initialize: function(application) {
|
160
|
-
application.register('api-adapter:main', ApiAdapter);
|
161
|
-
}
|
162
|
-
});
|
163
|
-
```
|
164
|
-
|
165
|
-
Initializers provide an opportunity to access the internal registry, which
|
166
|
-
organizes the different components of an Ember application. Additionally
|
167
|
-
they provide a chance to access the instantiated application. Beyond
|
168
|
-
being used for libraries, initializers are also a great way to organize
|
169
|
-
dependency injection or setup in your own application.
|
170
|
-
|
171
|
-
### Routing
|
172
|
-
|
173
|
-
In addition to creating your application's router, `Application` is
|
174
|
-
also responsible for telling the router when to start routing. Transitions
|
175
|
-
between routes can be logged with the `LOG_TRANSITIONS` flag, and more
|
176
|
-
detailed intra-transition logging can be logged with
|
177
|
-
the `LOG_TRANSITIONS_INTERNAL` flag:
|
178
|
-
|
179
|
-
```javascript
|
180
|
-
import Application from '@ember/application';
|
181
|
-
|
182
|
-
let App = Application.create({
|
183
|
-
LOG_TRANSITIONS: true, // basic logging of successful transitions
|
184
|
-
LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps
|
185
|
-
});
|
186
|
-
```
|
187
|
-
|
188
|
-
By default, the router will begin trying to translate the current URL into
|
189
|
-
application state once the browser emits the `DOMContentReady` event. If you
|
190
|
-
need to defer routing, you can call the application's `deferReadiness()`
|
191
|
-
method. Once routing can begin, call the `advanceReadiness()` method.
|
192
|
-
|
193
|
-
If there is any setup required before routing begins, you can implement a
|
194
|
-
`ready()` method on your app that will be invoked immediately before routing
|
195
|
-
begins.
|
196
|
-
|
197
|
-
@class Application
|
198
|
-
@extends Engine
|
199
|
-
@uses RegistryProxyMixin
|
200
|
-
@public
|
201
|
-
*/
|
202
|
-
|
203
|
-
const Application = Engine.extend({
|
204
|
-
/**
|
205
|
-
The root DOM element of the Application. This can be specified as an
|
206
|
-
element or a
|
207
|
-
[jQuery-compatible selector string](http://api.jquery.com/category/selectors/).
|
208
|
-
|
209
|
-
This is the element that will be passed to the Application's,
|
210
|
-
`eventDispatcher`, which sets up the listeners for event delegation. Every
|
211
|
-
view in your application should be a child of the element you specify here.
|
212
|
-
|
213
|
-
@property rootElement
|
214
|
-
@type DOMElement
|
215
|
-
@default 'body'
|
216
|
-
@public
|
217
|
-
*/
|
218
|
-
rootElement: 'body',
|
219
|
-
|
220
|
-
/**
|
221
|
-
The `Ember.EventDispatcher` responsible for delegating events to this
|
222
|
-
application's views.
|
223
|
-
|
224
|
-
The event dispatcher is created by the application at initialization time
|
225
|
-
and sets up event listeners on the DOM element described by the
|
226
|
-
application's `rootElement` property.
|
227
|
-
|
228
|
-
See the documentation for `Ember.EventDispatcher` for more information.
|
229
|
-
|
230
|
-
@property eventDispatcher
|
231
|
-
@type Ember.EventDispatcher
|
232
|
-
@default null
|
233
|
-
@public
|
234
|
-
*/
|
235
|
-
eventDispatcher: null,
|
236
|
-
|
237
|
-
/**
|
238
|
-
The DOM events for which the event dispatcher should listen.
|
239
|
-
|
240
|
-
By default, the application's `Ember.EventDispatcher` listens
|
241
|
-
for a set of standard DOM events, such as `mousedown` and
|
242
|
-
`keyup`, and delegates them to your application's `Ember.View`
|
243
|
-
instances.
|
244
|
-
|
245
|
-
If you would like additional bubbling events to be delegated to your
|
246
|
-
views, set your `Application`'s `customEvents` property
|
247
|
-
to a hash containing the DOM event name as the key and the
|
248
|
-
corresponding view method name as the value. Setting an event to
|
249
|
-
a value of `null` will prevent a default event listener from being
|
250
|
-
added for that event.
|
251
|
-
|
252
|
-
To add new events to be listened to:
|
253
|
-
|
254
|
-
```javascript
|
255
|
-
import Application from '@ember/application';
|
256
|
-
|
257
|
-
let App = Application.create({
|
258
|
-
customEvents: {
|
259
|
-
// add support for the paste event
|
260
|
-
paste: 'paste'
|
261
|
-
}
|
262
|
-
});
|
263
|
-
```
|
264
|
-
|
265
|
-
To prevent default events from being listened to:
|
266
|
-
|
267
|
-
```javascript
|
268
|
-
import Application from '@ember/application';
|
269
|
-
|
270
|
-
let App = Application.create({
|
271
|
-
customEvents: {
|
272
|
-
// remove support for mouseenter / mouseleave events
|
273
|
-
mouseenter: null,
|
274
|
-
mouseleave: null
|
275
|
-
}
|
276
|
-
});
|
277
|
-
```
|
278
|
-
@property customEvents
|
279
|
-
@type Object
|
280
|
-
@default null
|
281
|
-
@public
|
282
|
-
*/
|
283
|
-
customEvents: null,
|
284
|
-
|
285
|
-
/**
|
286
|
-
Whether the application should automatically start routing and render
|
287
|
-
templates to the `rootElement` on DOM ready. While default by true,
|
288
|
-
other environments such as FastBoot or a testing harness can set this
|
289
|
-
property to `false` and control the precise timing and behavior of the boot
|
290
|
-
process.
|
291
|
-
|
292
|
-
@property autoboot
|
293
|
-
@type Boolean
|
294
|
-
@default true
|
295
|
-
@private
|
296
|
-
*/
|
297
|
-
autoboot: true,
|
298
|
-
|
299
|
-
/**
|
300
|
-
Whether the application should be configured for the legacy "globals mode".
|
301
|
-
Under this mode, the Application object serves as a global namespace for all
|
302
|
-
classes.
|
303
|
-
|
304
|
-
```javascript
|
305
|
-
import Application from '@ember/application';
|
306
|
-
import Component from '@ember/component';
|
307
|
-
|
308
|
-
let App = Application.create({
|
309
|
-
...
|
310
|
-
});
|
311
|
-
|
312
|
-
App.Router.reopen({
|
313
|
-
location: 'none'
|
314
|
-
});
|
315
|
-
|
316
|
-
App.Router.map({
|
317
|
-
...
|
318
|
-
});
|
319
|
-
|
320
|
-
App.MyComponent = Component.extend({
|
321
|
-
...
|
322
|
-
});
|
323
|
-
```
|
324
|
-
|
325
|
-
This flag also exposes other internal APIs that assumes the existence of
|
326
|
-
a special "default instance", like `App.__container__.lookup(...)`.
|
327
|
-
|
328
|
-
This option is currently not configurable, its value is derived from
|
329
|
-
the `autoboot` flag – disabling `autoboot` also implies opting-out of
|
330
|
-
globals mode support, although they are ultimately orthogonal concerns.
|
331
|
-
|
332
|
-
Some of the global modes features are already deprecated in 1.x. The
|
333
|
-
existence of this flag is to untangle the globals mode code paths from
|
334
|
-
the autoboot code paths, so that these legacy features can be reviewed
|
335
|
-
for deprecation/removal separately.
|
336
|
-
|
337
|
-
Forcing the (autoboot=true, _globalsMode=false) here and running the tests
|
338
|
-
would reveal all the places where we are still relying on these legacy
|
339
|
-
behavior internally (mostly just tests).
|
340
|
-
|
341
|
-
@property _globalsMode
|
342
|
-
@type Boolean
|
343
|
-
@default true
|
344
|
-
@private
|
345
|
-
*/
|
346
|
-
_globalsMode: true,
|
347
|
-
|
348
|
-
/**
|
349
|
-
An array of application instances created by `buildInstance()`. Used
|
350
|
-
internally to ensure that all instances get destroyed.
|
351
|
-
|
352
|
-
@property _applicationInstances
|
353
|
-
@type Array
|
354
|
-
@default null
|
355
|
-
@private
|
356
|
-
*/
|
357
|
-
_applicationInstances: null,
|
358
|
-
|
359
|
-
init() {
|
360
|
-
// eslint-disable-line no-unused-vars
|
361
|
-
this._super(...arguments);
|
362
|
-
|
363
|
-
if (!this.$) {
|
364
|
-
this.$ = jQuery;
|
365
|
-
}
|
366
|
-
|
367
|
-
registerLibraries();
|
368
|
-
|
369
|
-
if (DEBUG) {
|
370
|
-
if (ENV.LOG_VERSION) {
|
371
|
-
// we only need to see this once per Application#init
|
372
|
-
ENV.LOG_VERSION = false;
|
373
|
-
libraries.logVersions();
|
374
|
-
}
|
375
|
-
}
|
376
|
-
|
377
|
-
// Start off the number of deferrals at 1. This will be decremented by
|
378
|
-
// the Application's own `boot` method.
|
379
|
-
this._readinessDeferrals = 1;
|
380
|
-
this._booted = false;
|
381
|
-
this._applicationInstances = new Set();
|
382
|
-
|
383
|
-
this.autoboot = this._globalsMode = !!this.autoboot;
|
384
|
-
|
385
|
-
if (this._globalsMode) {
|
386
|
-
this._prepareForGlobalsMode();
|
387
|
-
}
|
388
|
-
|
389
|
-
if (this.autoboot) {
|
390
|
-
this.waitForDOMReady();
|
391
|
-
}
|
392
|
-
},
|
393
|
-
|
394
|
-
/**
|
395
|
-
Create an ApplicationInstance for this application.
|
396
|
-
|
397
|
-
@private
|
398
|
-
@method buildInstance
|
399
|
-
@return {ApplicationInstance} the application instance
|
400
|
-
*/
|
401
|
-
buildInstance(options = {}) {
|
402
|
-
options.base = this;
|
403
|
-
options.application = this;
|
404
|
-
return ApplicationInstance.create(options);
|
405
|
-
},
|
406
|
-
|
407
|
-
/**
|
408
|
-
Start tracking an ApplicationInstance for this application.
|
409
|
-
Used when the ApplicationInstance is created.
|
410
|
-
|
411
|
-
@private
|
412
|
-
@method _watchInstance
|
413
|
-
*/
|
414
|
-
_watchInstance(instance) {
|
415
|
-
this._applicationInstances.add(instance);
|
416
|
-
},
|
417
|
-
|
418
|
-
/**
|
419
|
-
Stop tracking an ApplicationInstance for this application.
|
420
|
-
Used when the ApplicationInstance is about to be destroyed.
|
421
|
-
|
422
|
-
@private
|
423
|
-
@method _unwatchInstance
|
424
|
-
*/
|
425
|
-
_unwatchInstance(instance) {
|
426
|
-
return this._applicationInstances.delete(instance);
|
427
|
-
},
|
428
|
-
|
429
|
-
/**
|
430
|
-
Enable the legacy globals mode by allowing this application to act
|
431
|
-
as a global namespace. See the docs on the `_globalsMode` property
|
432
|
-
for details.
|
433
|
-
|
434
|
-
Most of these features are already deprecated in 1.x, so we can
|
435
|
-
stop using them internally and try to remove them.
|
436
|
-
|
437
|
-
@private
|
438
|
-
@method _prepareForGlobalsMode
|
439
|
-
*/
|
440
|
-
_prepareForGlobalsMode() {
|
441
|
-
// Create subclass of Router for this Application instance.
|
442
|
-
// This is to ensure that someone reopening `App.Router` does not
|
443
|
-
// tamper with the default `Router`.
|
444
|
-
this.Router = (this.Router || Router).extend();
|
445
|
-
|
446
|
-
this._buildDeprecatedInstance();
|
447
|
-
},
|
448
|
-
|
449
|
-
/*
|
450
|
-
Build the deprecated instance for legacy globals mode support.
|
451
|
-
Called when creating and resetting the application.
|
452
|
-
|
453
|
-
This is orthogonal to autoboot: the deprecated instance needs to
|
454
|
-
be created at Application construction (not boot) time to expose
|
455
|
-
App.__container__. If autoboot sees that this instance exists,
|
456
|
-
it will continue booting it to avoid doing unncessary work (as
|
457
|
-
opposed to building a new instance at boot time), but they are
|
458
|
-
otherwise unrelated.
|
459
|
-
|
460
|
-
@private
|
461
|
-
@method _buildDeprecatedInstance
|
462
|
-
*/
|
463
|
-
_buildDeprecatedInstance() {
|
464
|
-
// Build a default instance
|
465
|
-
let instance = this.buildInstance();
|
466
|
-
|
467
|
-
// Legacy support for App.__container__ and other global methods
|
468
|
-
// on App that rely on a single, default instance.
|
469
|
-
this.__deprecatedInstance__ = instance;
|
470
|
-
this.__container__ = instance.__container__;
|
471
|
-
},
|
472
|
-
|
473
|
-
/**
|
474
|
-
Automatically kick-off the boot process for the application once the
|
475
|
-
DOM has become ready.
|
476
|
-
|
477
|
-
The initialization itself is scheduled on the actions queue which
|
478
|
-
ensures that code-loading finishes before booting.
|
479
|
-
|
480
|
-
If you are asynchronously loading code, you should call `deferReadiness()`
|
481
|
-
to defer booting, and then call `advanceReadiness()` once all of your code
|
482
|
-
has finished loading.
|
483
|
-
|
484
|
-
@private
|
485
|
-
@method waitForDOMReady
|
486
|
-
*/
|
487
|
-
waitForDOMReady() {
|
488
|
-
if (!this.$ || this.$.isReady) {
|
489
|
-
schedule('actions', this, 'domReady');
|
490
|
-
} else {
|
491
|
-
this.$().ready(bind(this, 'domReady'));
|
492
|
-
}
|
493
|
-
},
|
494
|
-
|
495
|
-
/**
|
496
|
-
This is the autoboot flow:
|
497
|
-
|
498
|
-
1. Boot the app by calling `this.boot()`
|
499
|
-
2. Create an instance (or use the `__deprecatedInstance__` in globals mode)
|
500
|
-
3. Boot the instance by calling `instance.boot()`
|
501
|
-
4. Invoke the `App.ready()` callback
|
502
|
-
5. Kick-off routing on the instance
|
503
|
-
|
504
|
-
Ideally, this is all we would need to do:
|
505
|
-
|
506
|
-
```javascript
|
507
|
-
_autoBoot() {
|
508
|
-
this.boot().then(() => {
|
509
|
-
let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance();
|
510
|
-
return instance.boot();
|
511
|
-
}).then((instance) => {
|
512
|
-
App.ready();
|
513
|
-
instance.startRouting();
|
514
|
-
});
|
515
|
-
}
|
516
|
-
```
|
517
|
-
|
518
|
-
Unfortunately, we cannot actually write this because we need to participate
|
519
|
-
in the "synchronous" boot process. While the code above would work fine on
|
520
|
-
the initial boot (i.e. DOM ready), when `App.reset()` is called, we need to
|
521
|
-
boot a new instance synchronously (see the documentation on `_bootSync()`
|
522
|
-
for details).
|
523
|
-
|
524
|
-
Because of this restriction, the actual logic of this method is located
|
525
|
-
inside `didBecomeReady()`.
|
526
|
-
|
527
|
-
@private
|
528
|
-
@method domReady
|
529
|
-
*/
|
530
|
-
domReady() {
|
531
|
-
if (this.isDestroyed) {
|
532
|
-
return;
|
533
|
-
}
|
534
|
-
|
535
|
-
this._bootSync();
|
536
|
-
|
537
|
-
// Continues to `didBecomeReady`
|
538
|
-
},
|
539
|
-
|
540
|
-
/**
|
541
|
-
Use this to defer readiness until some condition is true.
|
542
|
-
|
543
|
-
Example:
|
544
|
-
|
545
|
-
```javascript
|
546
|
-
import Application from '@ember/application';
|
547
|
-
|
548
|
-
let App = Application.create();
|
549
|
-
|
550
|
-
App.deferReadiness();
|
551
|
-
|
552
|
-
// $ is a reference to the jQuery object/function
|
553
|
-
import $ from 'jquery;
|
554
|
-
|
555
|
-
$.getJSON('/auth-token', function(token) {
|
556
|
-
App.token = token;
|
557
|
-
App.advanceReadiness();
|
558
|
-
});
|
559
|
-
```
|
560
|
-
|
561
|
-
This allows you to perform asynchronous setup logic and defer
|
562
|
-
booting your application until the setup has finished.
|
563
|
-
|
564
|
-
However, if the setup requires a loading UI, it might be better
|
565
|
-
to use the router for this purpose.
|
566
|
-
|
567
|
-
@method deferReadiness
|
568
|
-
@public
|
569
|
-
*/
|
570
|
-
deferReadiness() {
|
571
|
-
assert(
|
572
|
-
'You must call deferReadiness on an instance of Application',
|
573
|
-
this instanceof Application
|
574
|
-
);
|
575
|
-
assert(
|
576
|
-
'You cannot defer readiness since the `ready()` hook has already been called.',
|
577
|
-
this._readinessDeferrals > 0
|
578
|
-
);
|
579
|
-
this._readinessDeferrals++;
|
580
|
-
},
|
581
|
-
|
582
|
-
/**
|
583
|
-
Call `advanceReadiness` after any asynchronous setup logic has completed.
|
584
|
-
Each call to `deferReadiness` must be matched by a call to `advanceReadiness`
|
585
|
-
or the application will never become ready and routing will not begin.
|
586
|
-
|
587
|
-
@method advanceReadiness
|
588
|
-
@see {Application#deferReadiness}
|
589
|
-
@public
|
590
|
-
*/
|
591
|
-
advanceReadiness() {
|
592
|
-
assert(
|
593
|
-
'You must call advanceReadiness on an instance of Application',
|
594
|
-
this instanceof Application
|
595
|
-
);
|
596
|
-
this._readinessDeferrals--;
|
597
|
-
|
598
|
-
if (this._readinessDeferrals === 0) {
|
599
|
-
once(this, this.didBecomeReady);
|
600
|
-
}
|
601
|
-
},
|
602
|
-
|
603
|
-
/**
|
604
|
-
Initialize the application and return a promise that resolves with the `Application`
|
605
|
-
object when the boot process is complete.
|
606
|
-
|
607
|
-
Run any application initializers and run the application load hook. These hooks may
|
608
|
-
choose to defer readiness. For example, an authentication hook might want to defer
|
609
|
-
readiness until the auth token has been retrieved.
|
610
|
-
|
611
|
-
By default, this method is called automatically on "DOM ready"; however, if autoboot
|
612
|
-
is disabled, this is automatically called when the first application instance is
|
613
|
-
created via `visit`.
|
614
|
-
|
615
|
-
@public
|
616
|
-
@method boot
|
617
|
-
@return {Promise<Application,Error>}
|
618
|
-
*/
|
619
|
-
boot() {
|
620
|
-
if (this._bootPromise) {
|
621
|
-
return this._bootPromise;
|
622
|
-
}
|
623
|
-
|
624
|
-
try {
|
625
|
-
this._bootSync();
|
626
|
-
} catch (_) {
|
627
|
-
// Ignore the error: in the asynchronous boot path, the error is already reflected
|
628
|
-
// in the promise rejection
|
629
|
-
}
|
630
|
-
|
631
|
-
return this._bootPromise;
|
632
|
-
},
|
633
|
-
|
634
|
-
/**
|
635
|
-
Unfortunately, a lot of existing code assumes the booting process is
|
636
|
-
"synchronous". Specifically, a lot of tests assumes the last call to
|
637
|
-
`app.advanceReadiness()` or `app.reset()` will result in the app being
|
638
|
-
fully-booted when the current runloop completes.
|
639
|
-
|
640
|
-
We would like new code (like the `visit` API) to stop making this assumption,
|
641
|
-
so we created the asynchronous version above that returns a promise. But until
|
642
|
-
we have migrated all the code, we would have to expose this method for use
|
643
|
-
*internally* in places where we need to boot an app "synchronously".
|
644
|
-
|
645
|
-
@private
|
646
|
-
*/
|
647
|
-
_bootSync() {
|
648
|
-
if (this._booted) {
|
649
|
-
return;
|
650
|
-
}
|
651
|
-
|
652
|
-
// Even though this returns synchronously, we still need to make sure the
|
653
|
-
// boot promise exists for book-keeping purposes: if anything went wrong in
|
654
|
-
// the boot process, we need to store the error as a rejection on the boot
|
655
|
-
// promise so that a future caller of `boot()` can tell what failed.
|
656
|
-
let defer = (this._bootResolver = RSVP.defer());
|
657
|
-
this._bootPromise = defer.promise;
|
658
|
-
|
659
|
-
try {
|
660
|
-
this.runInitializers();
|
661
|
-
runLoadHooks('application', this);
|
662
|
-
this.advanceReadiness();
|
663
|
-
// Continues to `didBecomeReady`
|
664
|
-
} catch (error) {
|
665
|
-
// For the asynchronous boot path
|
666
|
-
defer.reject(error);
|
667
|
-
|
668
|
-
// For the synchronous boot path
|
669
|
-
throw error;
|
670
|
-
}
|
671
|
-
},
|
672
|
-
|
673
|
-
/**
|
674
|
-
Reset the application. This is typically used only in tests. It cleans up
|
675
|
-
the application in the following order:
|
676
|
-
|
677
|
-
1. Deactivate existing routes
|
678
|
-
2. Destroy all objects in the container
|
679
|
-
3. Create a new application container
|
680
|
-
4. Re-route to the existing url
|
681
|
-
|
682
|
-
Typical Example:
|
683
|
-
|
684
|
-
```javascript
|
685
|
-
import Application from '@ember/application';
|
686
|
-
let App;
|
687
|
-
|
688
|
-
run(function() {
|
689
|
-
App = Application.create();
|
690
|
-
});
|
691
|
-
|
692
|
-
module('acceptance test', {
|
693
|
-
setup: function() {
|
694
|
-
App.reset();
|
695
|
-
}
|
696
|
-
});
|
697
|
-
|
698
|
-
test('first test', function() {
|
699
|
-
// App is freshly reset
|
700
|
-
});
|
701
|
-
|
702
|
-
test('second test', function() {
|
703
|
-
// App is again freshly reset
|
704
|
-
});
|
705
|
-
```
|
706
|
-
|
707
|
-
Advanced Example:
|
708
|
-
|
709
|
-
Occasionally you may want to prevent the app from initializing during
|
710
|
-
setup. This could enable extra configuration, or enable asserting prior
|
711
|
-
to the app becoming ready.
|
712
|
-
|
713
|
-
```javascript
|
714
|
-
import Application from '@ember/application';
|
715
|
-
let App;
|
716
|
-
|
717
|
-
run(function() {
|
718
|
-
App = Application.create();
|
719
|
-
});
|
720
|
-
|
721
|
-
module('acceptance test', {
|
722
|
-
setup: function() {
|
723
|
-
run(function() {
|
724
|
-
App.reset();
|
725
|
-
App.deferReadiness();
|
726
|
-
});
|
727
|
-
}
|
728
|
-
});
|
729
|
-
|
730
|
-
test('first test', function() {
|
731
|
-
ok(true, 'something before app is initialized');
|
732
|
-
|
733
|
-
run(function() {
|
734
|
-
App.advanceReadiness();
|
735
|
-
});
|
736
|
-
|
737
|
-
ok(true, 'something after app is initialized');
|
738
|
-
});
|
739
|
-
```
|
740
|
-
|
741
|
-
@method reset
|
742
|
-
@public
|
743
|
-
*/
|
744
|
-
reset() {
|
745
|
-
assert(
|
746
|
-
`Calling reset() on instances of \`Application\` is not
|
747
|
-
supported when globals mode is disabled; call \`visit()\` to
|
748
|
-
create new \`ApplicationInstance\`s and dispose them
|
749
|
-
via their \`destroy()\` method instead.`,
|
750
|
-
this._globalsMode && this.autoboot
|
751
|
-
);
|
752
|
-
|
753
|
-
let instance = this.__deprecatedInstance__;
|
754
|
-
|
755
|
-
this._readinessDeferrals = 1;
|
756
|
-
this._bootPromise = null;
|
757
|
-
this._bootResolver = null;
|
758
|
-
this._booted = false;
|
759
|
-
|
760
|
-
function handleReset() {
|
761
|
-
run(instance, 'destroy');
|
762
|
-
this._buildDeprecatedInstance();
|
763
|
-
schedule('actions', this, '_bootSync');
|
764
|
-
}
|
765
|
-
|
766
|
-
join(this, handleReset);
|
767
|
-
},
|
768
|
-
|
769
|
-
/**
|
770
|
-
@private
|
771
|
-
@method didBecomeReady
|
772
|
-
*/
|
773
|
-
didBecomeReady() {
|
774
|
-
try {
|
775
|
-
// TODO: Is this still needed for _globalsMode = false?
|
776
|
-
if (!isTesting()) {
|
777
|
-
// Eagerly name all classes that are already loaded
|
778
|
-
processAllNamespaces();
|
779
|
-
setNamespaceSearchDisabled(true);
|
780
|
-
}
|
781
|
-
|
782
|
-
// See documentation on `_autoboot()` for details
|
783
|
-
if (this.autoboot) {
|
784
|
-
let instance;
|
785
|
-
|
786
|
-
if (this._globalsMode) {
|
787
|
-
// If we already have the __deprecatedInstance__ lying around, boot it to
|
788
|
-
// avoid unnecessary work
|
789
|
-
instance = this.__deprecatedInstance__;
|
790
|
-
} else {
|
791
|
-
// Otherwise, build an instance and boot it. This is currently unreachable,
|
792
|
-
// because we forced _globalsMode to === autoboot; but having this branch
|
793
|
-
// allows us to locally toggle that flag for weeding out legacy globals mode
|
794
|
-
// dependencies independently
|
795
|
-
instance = this.buildInstance();
|
796
|
-
}
|
797
|
-
|
798
|
-
instance._bootSync();
|
799
|
-
|
800
|
-
// TODO: App.ready() is not called when autoboot is disabled, is this correct?
|
801
|
-
this.ready();
|
802
|
-
|
803
|
-
instance.startRouting();
|
804
|
-
}
|
805
|
-
|
806
|
-
// For the asynchronous boot path
|
807
|
-
this._bootResolver.resolve(this);
|
808
|
-
|
809
|
-
// For the synchronous boot path
|
810
|
-
this._booted = true;
|
811
|
-
} catch (error) {
|
812
|
-
// For the asynchronous boot path
|
813
|
-
this._bootResolver.reject(error);
|
814
|
-
|
815
|
-
// For the synchronous boot path
|
816
|
-
throw error;
|
817
|
-
}
|
818
|
-
},
|
819
|
-
|
820
|
-
/**
|
821
|
-
Called when the Application has become ready, immediately before routing
|
822
|
-
begins. The call will be delayed until the DOM has become ready.
|
823
|
-
|
824
|
-
@event ready
|
825
|
-
@public
|
826
|
-
*/
|
827
|
-
ready() {
|
828
|
-
return this;
|
829
|
-
},
|
830
|
-
|
831
|
-
// This method must be moved to the application instance object
|
832
|
-
willDestroy() {
|
833
|
-
this._super(...arguments);
|
834
|
-
setNamespaceSearchDisabled(false);
|
835
|
-
this._booted = false;
|
836
|
-
this._bootPromise = null;
|
837
|
-
this._bootResolver = null;
|
838
|
-
|
839
|
-
if (_loaded.application === this) {
|
840
|
-
_loaded.application = undefined;
|
841
|
-
}
|
842
|
-
|
843
|
-
if (this._applicationInstances.size) {
|
844
|
-
this._applicationInstances.forEach(i => i.destroy());
|
845
|
-
this._applicationInstances.clear();
|
846
|
-
}
|
847
|
-
},
|
848
|
-
|
849
|
-
/**
|
850
|
-
Boot a new instance of `ApplicationInstance` for the current
|
851
|
-
application and navigate it to the given `url`. Returns a `Promise` that
|
852
|
-
resolves with the instance when the initial routing and rendering is
|
853
|
-
complete, or rejects with any error that occurred during the boot process.
|
854
|
-
|
855
|
-
When `autoboot` is disabled, calling `visit` would first cause the
|
856
|
-
application to boot, which runs the application initializers.
|
857
|
-
|
858
|
-
This method also takes a hash of boot-time configuration options for
|
859
|
-
customizing the instance's behavior. See the documentation on
|
860
|
-
`ApplicationInstance.BootOptions` for details.
|
861
|
-
|
862
|
-
`ApplicationInstance.BootOptions` is an interface class that exists
|
863
|
-
purely to document the available options; you do not need to construct it
|
864
|
-
manually. Simply pass a regular JavaScript object containing of the
|
865
|
-
desired options:
|
866
|
-
|
867
|
-
```javascript
|
868
|
-
MyApp.visit("/", { location: "none", rootElement: "#container" });
|
869
|
-
```
|
870
|
-
|
871
|
-
### Supported Scenarios
|
872
|
-
|
873
|
-
While the `BootOptions` class exposes a large number of knobs, not all
|
874
|
-
combinations of them are valid; certain incompatible combinations might
|
875
|
-
result in unexpected behavior.
|
876
|
-
|
877
|
-
For example, booting the instance in the full browser environment
|
878
|
-
while specifying a foreign `document` object (e.g. `{ isBrowser: true,
|
879
|
-
document: iframe.contentDocument }`) does not work correctly today,
|
880
|
-
largely due to Ember's jQuery dependency.
|
881
|
-
|
882
|
-
Currently, there are three officially supported scenarios/configurations.
|
883
|
-
Usages outside of these scenarios are not guaranteed to work, but please
|
884
|
-
feel free to file bug reports documenting your experience and any issues
|
885
|
-
you encountered to help expand support.
|
886
|
-
|
887
|
-
#### Browser Applications (Manual Boot)
|
888
|
-
|
889
|
-
The setup is largely similar to how Ember works out-of-the-box. Normally,
|
890
|
-
Ember will boot a default instance for your Application on "DOM ready".
|
891
|
-
However, you can customize this behavior by disabling `autoboot`.
|
892
|
-
|
893
|
-
For example, this allows you to render a miniture demo of your application
|
894
|
-
into a specific area on your marketing website:
|
895
|
-
|
896
|
-
```javascript
|
897
|
-
import MyApp from 'my-app';
|
898
|
-
|
899
|
-
$(function() {
|
900
|
-
let App = MyApp.create({ autoboot: false });
|
901
|
-
|
902
|
-
let options = {
|
903
|
-
// Override the router's location adapter to prevent it from updating
|
904
|
-
// the URL in the address bar
|
905
|
-
location: 'none',
|
906
|
-
|
907
|
-
// Override the default `rootElement` on the app to render into a
|
908
|
-
// specific `div` on the page
|
909
|
-
rootElement: '#demo'
|
910
|
-
};
|
911
|
-
|
912
|
-
// Start the app at the special demo URL
|
913
|
-
App.visit('/demo', options);
|
914
|
-
});
|
915
|
-
```
|
916
|
-
|
917
|
-
Or perhaps you might want to boot two instances of your app on the same
|
918
|
-
page for a split-screen multiplayer experience:
|
919
|
-
|
920
|
-
```javascript
|
921
|
-
import MyApp from 'my-app';
|
922
|
-
|
923
|
-
$(function() {
|
924
|
-
let App = MyApp.create({ autoboot: false });
|
925
|
-
|
926
|
-
let sessionId = MyApp.generateSessionID();
|
927
|
-
|
928
|
-
let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' });
|
929
|
-
let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' });
|
930
|
-
|
931
|
-
Promise.all([player1, player2]).then(() => {
|
932
|
-
// Both apps have completed the initial render
|
933
|
-
$('#loading').fadeOut();
|
934
|
-
});
|
935
|
-
});
|
936
|
-
```
|
937
|
-
|
938
|
-
Do note that each app instance maintains their own registry/container, so
|
939
|
-
they will run in complete isolation by default.
|
940
|
-
|
941
|
-
#### Server-Side Rendering (also known as FastBoot)
|
942
|
-
|
943
|
-
This setup allows you to run your Ember app in a server environment using
|
944
|
-
Node.js and render its content into static HTML for SEO purposes.
|
945
|
-
|
946
|
-
```javascript
|
947
|
-
const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap);
|
948
|
-
|
949
|
-
function renderURL(url) {
|
950
|
-
let dom = new SimpleDOM.Document();
|
951
|
-
let rootElement = dom.body;
|
952
|
-
let options = { isBrowser: false, document: dom, rootElement: rootElement };
|
953
|
-
|
954
|
-
return MyApp.visit(options).then(instance => {
|
955
|
-
try {
|
956
|
-
return HTMLSerializer.serialize(rootElement.firstChild);
|
957
|
-
} finally {
|
958
|
-
instance.destroy();
|
959
|
-
}
|
960
|
-
});
|
961
|
-
}
|
962
|
-
```
|
963
|
-
|
964
|
-
In this scenario, because Ember does not have access to a global `document`
|
965
|
-
object in the Node.js environment, you must provide one explicitly. In practice,
|
966
|
-
in the non-browser environment, the stand-in `document` object only needs to
|
967
|
-
implement a limited subset of the full DOM API. The `SimpleDOM` library is known
|
968
|
-
to work.
|
969
|
-
|
970
|
-
Since there is no access to jQuery in the non-browser environment, you must also
|
971
|
-
specify a DOM `Element` object in the same `document` for the `rootElement` option
|
972
|
-
(as opposed to a selector string like `"body"`).
|
973
|
-
|
974
|
-
See the documentation on the `isBrowser`, `document` and `rootElement` properties
|
975
|
-
on `ApplicationInstance.BootOptions` for details.
|
976
|
-
|
977
|
-
#### Server-Side Resource Discovery
|
978
|
-
|
979
|
-
This setup allows you to run the routing layer of your Ember app in a server
|
980
|
-
environment using Node.js and completely disable rendering. This allows you
|
981
|
-
to simulate and discover the resources (i.e. AJAX requests) needed to fulfill
|
982
|
-
a given request and eagerly "push" these resources to the client.
|
983
|
-
|
984
|
-
```app/initializers/network-service.js
|
985
|
-
import BrowserNetworkService from 'app/services/network/browser';
|
986
|
-
import NodeNetworkService from 'app/services/network/node';
|
987
|
-
|
988
|
-
// Inject a (hypothetical) service for abstracting all AJAX calls and use
|
989
|
-
// the appropriate implementation on the client/server. This also allows the
|
990
|
-
// server to log all the AJAX calls made during a particular request and use
|
991
|
-
// that for resource-discovery purpose.
|
992
|
-
|
993
|
-
export function initialize(application) {
|
994
|
-
if (window) { // browser
|
995
|
-
application.register('service:network', BrowserNetworkService);
|
996
|
-
} else { // node
|
997
|
-
application.register('service:network', NodeNetworkService);
|
998
|
-
}
|
999
|
-
|
1000
|
-
application.inject('route', 'network', 'service:network');
|
1001
|
-
};
|
1002
|
-
|
1003
|
-
export default {
|
1004
|
-
name: 'network-service',
|
1005
|
-
initialize: initialize
|
1006
|
-
};
|
1007
|
-
```
|
1008
|
-
|
1009
|
-
```app/routes/post.js
|
1010
|
-
import Route from '@ember/routing/route';
|
1011
|
-
|
1012
|
-
// An example of how the (hypothetical) service is used in routes.
|
1013
|
-
|
1014
|
-
export default Route.extend({
|
1015
|
-
model(params) {
|
1016
|
-
return this.network.fetch(`/api/posts/${params.post_id}.json`);
|
1017
|
-
},
|
1018
|
-
|
1019
|
-
afterModel(post) {
|
1020
|
-
if (post.isExternalContent) {
|
1021
|
-
return this.network.fetch(`/api/external/?url=${post.externalURL}`);
|
1022
|
-
} else {
|
1023
|
-
return post;
|
1024
|
-
}
|
1025
|
-
}
|
1026
|
-
});
|
1027
|
-
```
|
1028
|
-
|
1029
|
-
```javascript
|
1030
|
-
// Finally, put all the pieces together
|
1031
|
-
|
1032
|
-
function discoverResourcesFor(url) {
|
1033
|
-
return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => {
|
1034
|
-
let networkService = instance.lookup('service:network');
|
1035
|
-
return networkService.requests; // => { "/api/posts/123.json": "..." }
|
1036
|
-
});
|
1037
|
-
}
|
1038
|
-
```
|
1039
|
-
|
1040
|
-
@public
|
1041
|
-
@method visit
|
1042
|
-
@param url {String} The initial URL to navigate to
|
1043
|
-
@param options {ApplicationInstance.BootOptions}
|
1044
|
-
@return {Promise<ApplicationInstance, Error>}
|
1045
|
-
*/
|
1046
|
-
visit(url, options) {
|
1047
|
-
return this.boot().then(() => {
|
1048
|
-
let instance = this.buildInstance();
|
1049
|
-
|
1050
|
-
return instance
|
1051
|
-
.boot(options)
|
1052
|
-
.then(() => instance.visit(url))
|
1053
|
-
.catch(error => {
|
1054
|
-
run(instance, 'destroy');
|
1055
|
-
throw error;
|
1056
|
-
});
|
1057
|
-
});
|
1058
|
-
},
|
1059
|
-
});
|
1060
|
-
|
1061
|
-
Application.reopenClass({
|
1062
|
-
/**
|
1063
|
-
This creates a registry with the default Ember naming conventions.
|
1064
|
-
|
1065
|
-
It also configures the registry:
|
1066
|
-
|
1067
|
-
* registered views are created every time they are looked up (they are
|
1068
|
-
not singletons)
|
1069
|
-
* registered templates are not factories; the registered value is
|
1070
|
-
returned directly.
|
1071
|
-
* the router receives the application as its `namespace` property
|
1072
|
-
* all controllers receive the router as their `target` and `controllers`
|
1073
|
-
properties
|
1074
|
-
* all controllers receive the application as their `namespace` property
|
1075
|
-
* the application view receives the application controller as its
|
1076
|
-
`controller` property
|
1077
|
-
* the application view receives the application template as its
|
1078
|
-
`defaultTemplate` property
|
1079
|
-
|
1080
|
-
@method buildRegistry
|
1081
|
-
@static
|
1082
|
-
@param {Application} namespace the application for which to
|
1083
|
-
build the registry
|
1084
|
-
@return {Ember.Registry} the built registry
|
1085
|
-
@private
|
1086
|
-
*/
|
1087
|
-
buildRegistry() {
|
1088
|
-
// eslint-disable-line no-unused-vars
|
1089
|
-
let registry = this._super(...arguments);
|
1090
|
-
|
1091
|
-
commonSetupRegistry(registry);
|
1092
|
-
|
1093
|
-
setupApplicationRegistry(registry);
|
1094
|
-
|
1095
|
-
return registry;
|
1096
|
-
},
|
1097
|
-
});
|
1098
|
-
|
1099
|
-
function commonSetupRegistry(registry) {
|
1100
|
-
registry.register('router:main', Router.extend());
|
1101
|
-
registry.register('-view-registry:main', {
|
1102
|
-
create() {
|
1103
|
-
return dictionary(null);
|
1104
|
-
},
|
1105
|
-
});
|
1106
|
-
|
1107
|
-
registry.register('route:basic', Route);
|
1108
|
-
registry.register('event_dispatcher:main', EventDispatcher);
|
1109
|
-
|
1110
|
-
registry.injection('router:main', 'namespace', 'application:main');
|
1111
|
-
|
1112
|
-
registry.register('location:auto', AutoLocation);
|
1113
|
-
registry.register('location:hash', HashLocation);
|
1114
|
-
registry.register('location:history', HistoryLocation);
|
1115
|
-
registry.register('location:none', NoneLocation);
|
1116
|
-
|
1117
|
-
registry.register(P`-bucket-cache:main`, {
|
1118
|
-
create() {
|
1119
|
-
return new BucketCache();
|
1120
|
-
},
|
1121
|
-
});
|
1122
|
-
|
1123
|
-
if (EMBER_ROUTING_ROUTER_SERVICE) {
|
1124
|
-
registry.register('service:router', RouterService);
|
1125
|
-
registry.injection('service:router', '_router', 'router:main');
|
1126
|
-
}
|
1127
|
-
}
|
1128
|
-
|
1129
|
-
function registerLibraries() {
|
1130
|
-
if (!librariesRegistered) {
|
1131
|
-
librariesRegistered = true;
|
1132
|
-
|
1133
|
-
if (hasDOM && !jQueryDisabled) {
|
1134
|
-
libraries.registerCoreLibrary('jQuery', jQuery().jquery);
|
1135
|
-
}
|
1136
|
-
}
|
1137
|
-
}
|
1138
|
-
|
1139
|
-
export default Application;
|