Angular 2 – What’s In A Framework

a2

I’ve been working through changes necessitated by RC1.  The new imports actually make sense and seem to position the framework for future changes without importing version-specific files, i.e. angular2/core becomes angular3/core.

The framework files are currently distributed unbundled.  As a sneaky dev. who can not resist poking around ‘under the hood,’ I had to see what set of files would be loaded in a minimal A2 application.

The following list does not include framework shims and lists the subset of RxJs files requested from a small A2 application that does not include HTTP or Routing.  

This exercise was mostly done for curiosity, although I have spent a few hours working through some of the corresponding TS code.  It also underscores the necessity for a good framework bundler in production :)

      // @angular/common
      'node_modules/@angular/common/index.js',

      'node_modules/@angular/common/src/common_directives.js',
      'node_modules/@angular/common/src/directives.js',
      'node_modules/@angular/common/src/forms.js',
      'node_modules/@angular/common/src/pipes.js',
      'node_modules/@angular/common/src/location.js',

      'node_modules/@angular/common/src/directives/core_directives.js',
      'node_modules/@angular/common/src/directives/ng_class.js',
      'node_modules/@angular/common/src/directives/ng_for.js',
      'node_modules/@angular/common/src/directives/ng_if.js',
      'node_modules/@angular/common/src/directives/ng_plural.js',
      'node_modules/@angular/common/src/directives/ng_style.js',
      'node_modules/@angular/common/src/directives/ng_switch.js',
      'node_modules/@angular/common/src/directives/ng_template_outlet.js',
      'node_modules/@angular/common/src/directives/observable_list_diff.js',

      'node_modules/@angular/common/src/facade/async.js',
      'node_modules/@angular/common/src/facade/base_wrapped_exception.js',
      'node_modules/@angular/common/src/facade/collection.js',
      'node_modules/@angular/common/src/facade/exceptions.js',
      'node_modules/@angular/common/src/facade/exception_handler.js',
      'node_modules/@angular/common/src/facade/intl.js',
      'node_modules/@angular/common/src/facade/lang.js',
      'node_modules/@angular/common/src/facade/promise.js',

      'node_modules/@angular/common/src/forms/directives.js',
      'node_modules/@angular/common/src/forms/form_builder.js',
      'node_modules/@angular/common/src/forms/model.js',
      'node_modules/@angular/common/src/forms/validators.js',

      'node_modules/@angular/common/src/forms/directives/abstract_control_directive.js',
      'node_modules/@angular/common/src/forms/directives/checkbox_value_accessor.js',
      'node_modules/@angular/common/src/forms/directives/control_container.js',
      'node_modules/@angular/common/src/forms/directives/control_value_accessor.js',
      'node_modules/@angular/common/src/forms/directives/default_value_accessor.js',
      'node_modules/@angular/common/src/forms/directives/ng_control.js',
      'node_modules/@angular/common/src/forms/directives/ng_control_group.js',
      'node_modules/@angular/common/src/forms/directives/ng_control_name.js',
      'node_modules/@angular/common/src/forms/directives/ng_control_status.js',
      'node_modules/@angular/common/src/forms/directives/ng_form.js',
      'node_modules/@angular/common/src/forms/directives/ng_form_control.js',
      'node_modules/@angular/common/src/forms/directives/ng_form_model.js',
      'node_modules/@angular/common/src/forms/directives/ng_model.js',
      'node_modules/@angular/common/src/forms/directives/normalize_validator.js',
      'node_modules/@angular/common/src/forms/directives/number_value_accessor.js',
      'node_modules/@angular/common/src/forms/directives/radio_control_value_accessor.js',
      'node_modules/@angular/common/src/forms/directives/select_control_value_accessor.js',
      'node_modules/@angular/common/src/forms/directives/shared.js',
      'node_modules/@angular/common/src/forms/directives/validators.js',

      'node_modules/@angular/common/src/location/hash_location_strategy.js',
      'node_modules/@angular/common/src/location/location.js',
      'node_modules/@angular/common/src/location/location_strategy.js',
      'node_modules/@angular/common/src/location/path_location_strategy.js',
      'node_modules/@angular/common/src/location/platform_location.js',

      'node_modules/@angular/common/src/pipes/async_pipe.js',
      'node_modules/@angular/common/src/pipes/common_pipes.js',
      'node_modules/@angular/common/src/pipes/date_pipe.js',
      'node_modules/@angular/common/src/pipes/i18n_plural_pipe.js',
      'node_modules/@angular/common/src/pipes/i18n_select_pipe.js',
      'node_modules/@angular/common/src/pipes/invalid_pipe_argument_exception.js',
      'node_modules/@angular/common/src/pipes/json_pipe.js',
      'node_modules/@angular/common/src/pipes/lowercase_pipe.js',
      'node_modules/@angular/common/src/pipes/number_pipe.js',
      'node_modules/@angular/common/src/pipes/replace_pipe.js',
      'node_modules/@angular/common/src/pipes/slice_pipe.js',
      'node_modules/@angular/common/src/pipes/uppercase_pipe.js',

      // @angular/compiler
      'node_modules/@angular/compiler/compiler.js',
      'node_modules/@angular/compiler/index.js',
      'node_modules/@angular/compiler/private_export.js',

      'node_modules/@angular/compiler/src/assertions.js',
      'node_modules/@angular/compiler/src/compiler.js',
      'node_modules/@angular/compiler/src/config.js',
      'node_modules/@angular/compiler/src/compile_metadata.js',
      'node_modules/@angular/compiler/core_private.js',
      'node_modules/@angular/compiler/src/directive_lifecycle_reflector.js',
      'node_modules/@angular/compiler/src/directive_normalizer.js',
      'node_modules/@angular/compiler/src/directive_resolver.js',
      'node_modules/@angular/compiler/src/html_ast.js',
      'node_modules/@angular/compiler/src/html_lexer.js',
      'node_modules/@angular/compiler/src/html_parser.js',
      'node_modules/@angular/compiler/src/html_tags.js',
      'node_modules/@angular/compiler/src/identifiers.js',
      'node_modules/@angular/compiler/src/metadata_resolver.js',
      'node_modules/@angular/compiler/src/offline_compiler.js',
      'node_modules/@angular/compiler/src/parse_util.js',
      'node_modules/@angular/compiler/src/output/path_util.js',
      'node_modules/@angular/compiler/src/pipe_resolver.js',
      'node_modules/@angular/compiler/src/provider_parser.js',
      'node_modules/@angular/compiler/src/runtime_compiler.js',
      'node_modules/@angular/compiler/src/runt26ime_compiler.js',    // ???
      'node_modules/@angular/compiler/src/selector.js',
      'node_modules/@angular/compiler/src/shadow_css.js',
      'node_modules/@angular/compiler/src/style_compiler.js',
      'node_modules/@angular/compiler/src/style_url_resolver.js',
      'node_modules/@angular/compiler/src/template_ast.js',
      'node_modules/@angular/compiler/src/template_parser.js',
      'node_modules/@angular/compiler/src/template_preparser.js',
      'node_modules/@angular/compiler/src/url_resolver.js',
      'node_modules/@angular/compiler/src/util.js',
      'node_modules/@angular/compiler/src/view_resolver.js',
      'node_modules/@angular/compiler/src/xhr.js',

      'node_modules/@angular/compiler/src/expression_parser/ast.js',
      'node_modules/@angular/compiler/src/expression_parser/lexer.js',
      'node_modules/@angular/compiler/src/expression_parser/parser.js',

      'node_modules/@angular/compiler/src/facade/async.js',
      'node_modules/@angular/compiler/src/facade/base_wrapped_exception.js',
      'node_modules/@angular/compiler/src/facade/collection.js',
      'node_modules/@angular/compiler/src/facade/exceptions.js',
      'node_modules/@angular/compiler/src/facade/exception_handler.js',
      'node_modules/@angular/compiler/src/facade/lang.js',
      'node_modules/@angular/compiler/src/facade/promise.js',

      'node_modules/@angular/compiler/src/output/abstract_emitter.js',
      'node_modules/@angular/compiler/src/output/abstract_js_emitter.js',
      'node_modules/@angular/compiler/src/output/dart_emitter.js',
      'node_modules/@angular/compiler/src/output/interpretive_view.js',
      'node_modules/@angular/compiler/src/output/output_ast.js',
      'node_modules/@angular/compiler/src/output/output_interpreter.js',
      'node_modules/@angular/compiler/src/output/output_jit.js',
      'node_modules/@angular/compiler/src/output/ts_emitter.js',

      'node_modules/@angular/compiler/src/schema/dom_element_schema_registry.js',
      'node_modules/@angular/compiler/src/schema/element_schema_registry.js',

      'node_modules/@angular/compiler/src/view_compiler/compile_binding.js',
      'node_modules/@angular/compiler/src/view_compiler/compile_element.js',
      'node_modules/@angular/compiler/src/view_compiler/compile_method.js',
      'node_modules/@angular/compiler/src/view_compiler/compile_pipe.js',
      'node_modules/@angular/compiler/src/view_compiler/compile_query.js',
      'node_modules/@angular/compiler/src/view_compiler/compile_view.js',
      'node_modules/@angular/compiler/src/view_compiler/constants.js',
      'node_modules/@angular/compiler/src/view_compiler/event_binder.js',
      'node_modules/@angular/compiler/src/view_compiler/expression_converter.js',
      'node_modules/@angular/compiler/src/view_compiler/lifecycle_binder.js',
      'node_modules/@angular/compiler/src/view_compiler/property_binder.js',
      'node_modules/@angular/compiler/src/view_compiler/util.js',
      'node_modules/@angular/compiler/src/view_compiler/view_binder.js',
      'node_modules/@angular/compiler/src/view_compiler/view_builder.js',
      'node_modules/@angular/compiler/src/view_compiler/view_compiler.js',


      // @angular/core
      'node_modules/@angular/core/index.js',
      'node_modules/@angular/core/private_export.js',

      'node_modules/@angular/core/src/application_common_providers.js',
      'node_modules/@angular/core/src/application_ref.js',
      'node_modules/@angular/core/src/application_tokens.js',
      'node_modules/@angular/core/src/change_detection.js',
      'node_modules/@angular/core/src/console.js',
      'node_modules/@angular/core/src/di.js',
      'node_modules/@angular/core/src/linker.js',
      'node_modules/@angular/core/src/metadata.js',
      'node_modules/@angular/core/src/platform_common_providers.js',
      'node_modules/@angular/core/src/platform_directives_and_pipes.js',
      'node_modules/@angular/core/src/render.js',
      'node_modules/@angular/core/src/security.js',
      'node_modules/@angular/core/src/util.js',
      'node_modules/@angular/core/src/zone.js',

      'node_modules/@angular/core/src/change_detection/change_detection.js',
      'node_modules/@angular/core/src/change_detection/change_detection_util.js',
      'node_modules/@angular/core/src/change_detection/change_detector_ref.js',
      'node_modules/@angular/core/src/change_detection/constants.js',

      'node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.js',
      'node_modules/@angular/core/src/change_detection/differs/default_iterable_differ.js',
      'node_modules/@angular/core/src/change_detection/differs/iterable_differs.js',
      'node_modules/@angular/core/src/change_detection/differs/keyvalue_differs.js',

      'node_modules/@angular/core/src/debug/debug_node.js',
      'node_modules/@angular/core/src/debug/debug_renderer.js',

      'node_modules/@angular/core/src/di/decorators.js',
      'node_modules/@angular/core/src/di/forward_ref.js',
      'node_modules/@angular/core/src/di/injector.js',
      'node_modules/@angular/core/src/di/metadata.js',
      'node_modules/@angular/core/src/di/opaque_token.js',
      'node_modules/@angular/core/src/di/provider.js',
      'node_modules/@angular/core/src/di/provider_util.js',
      'node_modules/@angular/core/src/di/reflective_exceptions.js',
      'node_modules/@angular/core/src/di/reflective_injector.js',
      'node_modules/@angular/core/src/di/reflective_key.js',
      'node_modules/@angular/core/src/di/reflective_provider.js',

      'node_modules/@angular/core/src/facade/async.js',
      'node_modules/@angular/core/src/facade/base_wrapped_exception.js',
      'node_modules/@angular/core/src/facade/collection.js',
      'node_modules/@angular/core/src/facade/exceptions.js',
      'node_modules/@angular/core/src/facade/exception_handler.js',
      'node_modules/@angular/core/src/facade/lang.js',
      'node_modules/@angular/core/src/facade/promise.js',

      'node_modules/@angular/core/src/linker/component_factory.js',
      'node_modules/@angular/core/src/linker/component_resolver.js',
      'node_modules/@angular/core/src/linker/debug_context.js',
      'node_modules/@angular/core/src/linker/dynamic_component_loader.js',
      'node_modules/@angular/core/src/linker/element.js',
      'node_modules/@angular/core/src/linker/element_injector.js',
      'node_modules/@angular/core/src/linker/element_ref.js',
      'node_modules/@angular/core/src/linker/exceptions.js',
      'node_modules/@angular/core/src/linker/query_list.js',
      'node_modules/@angular/core/src/linker/template_ref.js',
      'node_modules/@angular/core/src/linker/view.js',
      'node_modules/@angular/core/src/linker/view_container_ref.js',
      'node_modules/@angular/core/src/linker/view_ref.js',
      'node_modules/@angular/core/src/linker/view_type.js',
      'node_modules/@angular/core/src/linker/view_utils.js',

      'node_modules/@angular/core/src/metadata/di.js',
      'node_modules/@angular/core/src/metadata/directives.js',
      'node_modules/@angular/core/src/metadata/lifecycle_hooks.js',
      'node_modules/@angular/core/src/metadata/view.js',

      'node_modules/@angular/core/src/profile/profile.js',
      'node_modules/@angular/core/src/profile/wtf_impl.js',
      'node_modules/@angular/core/src/profile/wtf_init.js',

      'node_modules/@angular/core/src/reflection/reflection.js',
      'node_modules/@angular/core/src/reflection/reflection_capabilities.js',
      'node_modules/@angular/core/src/reflection/reflector.js',
      'node_modules/@angular/core/src/reflection/reflector_reader.js',

      'node_modules/@angular/core/src/render/api.js',

      'node_modules/@angular/core/src/testability/testability.js',

      'node_modules/@angular/core/src/util/decorators.js',

      'node_modules/@angular/core/src/zone/ng_zone.js',
      'node_modules/@angular/core/src/zone/ng_zone_impl.js',


      // @angular/platform-browser
      'node_modules/@angular/platform-browser/core_private.js',
      'node_modules/@angular/platform-browser/index.js',
      'node_modules/@angular/platform-browser/private_export.js',

      'node_modules/@angular/platform-browser/src/browser_common.js',
      'node_modules/@angular/platform-browser/src/platform_browser.js',
      'node_modules/@angular/platform-browser/src/platform_browser_static.js',

      'node_modules/@angular/platform-browser/src/animate/animation.js',
      'node_modules/@angular/platform-browser/src/animate/animation_builder.js',
      'node_modules/@angular/platform-browser/src/animate/browser_details.js',
      'node_modules/@angular/platform-browser/src/animate/css_animation_builder.js',
      'node_modules/@angular/platform-browser/src/animate/css_animation_options.js',

      'node_modules/@angular/platform-browser/src/browser/browser_adapter.js',
      'node_modules/@angular/platform-browser/src/browser/generic_browser_adapter.js',
      'node_modules/@angular/platform-browser/src/browser/testability.js',
      'node_modules/@angular/platform-browser/src/browser/title.js',

      'node_modules/@angular/platform-browser/src/browser/location/browser_platform_location.js',

      'node_modules/@angular/platform-browser/src/browser/tools/common_tools.js',
      'node_modules/@angular/platform-browser/src/browser/tools/tools.js',

      'node_modules/@angular/platform-browser/src/dom/dom_adapter.js',
      'node_modules/@angular/platform-browser/src/dom/dom_tokens.js',
      'node_modules/@angular/platform-browser/src/dom/dom_renderer.js',
      'node_modules/@angular/platform-browser/src/dom/shared_styles_host.js',
      'node_modules/@angular/platform-browser/src/dom/util.js',

      'node_modules/@angular/platform-browser/src/dom/debug/by.js',
      'node_modules/@angular/platform-browser/src/dom/debug/ng_probe.js',

      'node_modules/@angular/platform-browser/src/dom/events/dom_events.js',
      'node_modules/@angular/platform-browser/src/dom/events/event_manager.js',
      'node_modules/@angular/platform-browser/src/dom/events/hammer_common.js',
      'node_modules/@angular/platform-browser/src/dom/events/hammer_gestures.js',
      'node_modules/@angular/platform-browser/src/dom/events/key_events.js',

      'node_modules/@angular/platform-browser/src/facade/base_wrapped_exception.js',
      'node_modules/@angular/platform-browser/src/facade/browser.js',
      'node_modules/@angular/platform-browser/src/facade/collection.js',
      'node_modules/@angular/platform-browser/src/facade/exceptions.js',
      'node_modules/@angular/platform-browser/src/facade/exception_handler.js',
      'node_modules/@angular/platform-browser/src/facade/lang.js',
      'node_modules/@angular/platform-browser/src/facade/math.js',

      'node_modules/@angular/platform-browser/src/security/dom_sanitization_service.js',
      'node_modules/@angular/platform-browser/src/security/style_sanitizer.js',
      'node_modules/@angular/platform-browser/src/security/url_sanitizer.js',


      //@angular/platform-browser-dynamic
      'node_modules/@angular/platform-browser-dynamic/core_private.js',
      'node_modules/@angular/platform-browser-dynamic/index.js',
      'node_modules/@angular/platform-browser-dynamic/platform_browser_dynamic.js',

      'node_modules/@angular/platform-browser-dynamic/src/facade/base_wrapped_exception.js',
      'node_modules/@angular/platform-browser-dynamic/src/facade/collection.js',
      'node_modules/@angular/platform-browser-dynamic/src/facade/exceptions.js',
      'node_modules/@angular/platform-browser-dynamic/src/facade/exception_handler.js',
      'node_modules/@angular/platform-browser-dynamic/src/facade/lang.js',
      'node_modules/@angular/platform-browser-dynamic/src/facade/promise.js',

      'node_modules/@angular/platform-browser-dynamic/src/xhr/xhr_cache.js',
      'node_modules/@angular/platform-browser-dynamic/src/xhr/xhr_impl.js',

      // RxJs
      'node_modules/rxjs/Observable.js',
      'node_modules/rxjs/Observer.js',
      'node_modules/rxjs/Subject.js',
      'node_modules/rxjs/SubjectSubscription.js',
      'node_modules/rxjs/Subscriber.js',
      'node_modules/rxjs/Subscription.js',

      'node_modules/rxjs/observable/PromiseObservable.js',
      'node_modules/rxjs/operator/toPromise.js',

      'node_modules/rxjs/symbol/observable.js',
      'node_modules/rxjs/symbol/rxSubscriber.js',

      'node_modules/rxjs/util/errorObject.js',
      'node_modules/rxjs/util/isArray.js',
      'node_modules/rxjs/util/isFunction.js',
      'node_modules/rxjs/util/isObject.js',
      'node_modules/rxjs/util/ObjectUnsubscribedError.js',
      'node_modules/rxjs/util/root.js',
      'node_modules/rxjs/util/throwError.js',
      'node_modules/rxjs/util/toSubscriber.js',
      'node_modules/rxjs/util/tryCatch.js',
      'node_modules/rxjs/util/UnsubscriptionError.js'

Well, that was an interesting experiment. I’ll have a new A2 and D3 sample out soon to illustrate how to build a basic application with the release candidate (unless the production framework is announced at Google I/O this week).

Comments are closed.