angular/packages/core/src
Pete Bacon Darwin 2bf5606bbe feat(ivy): i18n - reorganize entry-points for better reuse (#32488)
This is a refactoring that moves the source code around to provide a better
platform for adding the compile-time inlining.

1. Move the global side-effect import from the primary entry-point to a
   secondary entry-point @angular/localize/init.

   This has two benefits: first it allows the top level entry-point to
   contain tree-shakable shareable code; second it gives the side-effect
   import more of an "action" oriented name, which indicates that importing
   it does something tangible

2. Move all the source code into the top src folder, and import the localize
   related functions into the localize/init/index.ts entry-point.

   This allows the different parts of the package to share code without
   a proliferation of secondary entry-points (i.e. localize/utils).

3. Avoid publicly exporting any utilities at this time - the only public
   API at this point are the global `$localize` function and the two runtime
   helpers `loadTranslations()` and `clearTranslations()`.
   This does not mean that we will not expose additional helpers for 3rd
   party tooling in the future, but it avoid us preemptively exposing
   something that we might want to change in the near future.

Notes:

It is not possible to have the `$localize` code in the same Bazel package
as the rest of the code. If we did this, then the bundled `@angular/localize/init`
entry-point code contains all of the helper code, even though most of it is not used.

Equally it is not possible to have the `$localize` types (i.e. `LocalizeFn`
and `TranslateFn`) defined in the `@angular/localize/init` entry-point because
these types are needed for the runtime code, which is inside the primary
entry-point. Importing them from `@angular/localize/init` would run the
side-effect.

The solution is to have a Bazel sub-package at `//packages/localize/src/localize`
which contains these types and the `$localize` function implementation.
The primary `//packages/localize` entry-point imports the types without
any side-effect.
The secondary `//packages/localize/init` entry-point imports the `$localize`
function and attaches it to the global scope as a side-effect, without
bringing with it all the other utility functions.

BREAKING CHANGES:

The entry-points have changed:

* To attach the `$localize` function to the global scope import from
`@angular/localize/init`. Previously it was `@angular/localize`.

* To access the `loadTranslations()` and `clearTranslations()` functions,
import from `@angular/localize`. Previously it was `@angular/localize/run_time`.

PR Close #32488
2019-09-12 15:35:34 -07:00
..
change_detection docs: api doc cleanup (#31377) 2019-07-08 09:51:59 -07:00
compiler refactor(ivy): move directive, component and pipe factories to ngFactoryFn (#31953) 2019-08-27 13:57:00 -07:00
debug revert: refactor(ivy): remove styling state storage and introduce direct style writing (#32259) 2019-09-11 15:24:10 -07:00
di fix(ivy): unable to override ComponentFactoryResolver provider in tests (#32512) 2019-09-10 14:53:08 -04:00
i18n fix(ivy): set LOCALE_ID when using the injector (#31566) 2019-07-26 14:04:47 -07:00
interface feat(core): Add "AbstractType<T>" interface (#29295) 2019-04-02 16:07:22 -07:00
linker build: TypeScript 3.5 upgrade (#31615) 2019-07-25 17:05:23 -07:00
metadata feat(compiler): allow selector-less directives as base classes (#31379) 2019-08-14 12:03:05 -07:00
profile feat(core): deprecate integration with the Web Tracing Framework (WTF) (#30642) 2019-05-23 15:09:48 -07:00
reflection perf: don't create holey arrays (#32155) 2019-08-21 08:27:43 -07:00
render fix(ivy): ensure element removal triggers host removal animations (#28162) 2019-01-17 09:58:50 -08:00
render3 feat(ivy): i18n - reorganize entry-points for better reuse (#32488) 2019-09-12 15:35:34 -07:00
sanitization revert: refactor(ivy): remove styling state storage and introduce direct style writing (#32259) 2019-09-11 15:24:10 -07:00
testability build: update zone.js to 0.9.0 (#28219) 2019-03-26 12:50:38 -07:00
util fix(core): initialize global ngDevMode without toplevel side effects (#32079) 2019-09-11 20:31:14 -04:00
view feat(core): Adds DI support for providedIn: 'platform'|'any' (#32154) 2019-08-29 21:51:56 -07:00
zone refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
application_init.ts docs: update core to use @publicApi tags (#26595) 2018-10-19 14:35:53 -07:00
application_module.ts fix(ivy): set LOCALE_ID when using the injector (#31566) 2019-07-26 14:04:47 -07:00
application_ref.ts perf(core): Make PlatformLocation tree-shakable (#32154) 2019-08-29 21:51:56 -07:00
application_tokens.ts docs: convert all @experimental tags to @publicApi tags (#26595) 2018-10-19 14:35:52 -07:00
change_detection.ts refactor(core): remove deprecated TrackByFn (#18757) 2017-08-18 13:23:46 -05:00
codegen_private_exports.ts fix(ivy): align NgModule registration timing with ViewEngine (#30244) 2019-05-13 11:13:25 -07:00
console.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
core.externs.js fix(ivy): add missing closure extern for \$localize (#32460) 2019-09-03 11:55:16 -07:00
core.ts feat(ivy): i18n - reorganize entry-points for better reuse (#32488) 2019-09-12 15:35:34 -07:00
core_private_export.ts feat(core): Adds DI support for providedIn: 'platform'|'any' (#32154) 2019-08-29 21:51:56 -07:00
core_render3_private_export.ts revert: refactor(ivy): remove styling state storage and introduce direct style writing (#32259) 2019-09-11 15:24:10 -07:00
di.ts refactor(ivy): create Injector interface; remove dependency on Ivy (#28066) 2019-01-11 16:24:03 -08:00
error_handler.ts refactor(ivy): refactor more files in DI to prepare it for bazel packages (#28098) 2019-01-14 09:55:30 -08:00
errors.ts build: extract interface and util sub compilation from core (#28028) 2019-01-10 16:31:44 -08:00
event_emitter.ts docs: correct description of output decorator and add links to guide (#31780) 2019-08-08 12:15:29 -07:00
ivy_switch.ts refactor(ivy): obviate the Bazel component of the ivy_switch (#26550) 2018-10-19 09:23:05 -07:00
linker.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
metadata.ts docs: fix and add decorator api doc (#28986) 2019-03-04 11:47:30 -08:00
platform_core_providers.ts docs: convert all @experimental tags to @publicApi tags (#26595) 2018-10-19 14:35:52 -07:00
r3_symbols.ts refactor(ivy): Move instructions back to ɵɵ (#30546) 2019-05-20 16:37:47 -07:00
render.ts refactor(core): use flags in Renderer2.setStyle instead of booleans (#15045) 2017-03-13 09:45:04 -07:00
version.ts docs: update core to use @publicApi tags (#26595) 2018-10-19 14:35:53 -07:00
zone.ts feat(router): warn if navigation triggered outside Angular zone (#24959) 2018-09-05 09:35:14 -07:00