Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: remove Testabiliy and TestabilityRegistry from minimal application and make it injectable #28

Merged

Conversation

ykmnkmi
Copy link

@ykmnkmi ykmnkmi commented Oct 8, 2022

Testability is the only API that relies on the js package (not js_util) and that increases the build size. Now, in order to use the Testability API, you need to inject it manually using GenerateInjector with testabilityProvider:

@GenerateInjector([testabilityProvider])
final InjectorFactory appInjector = ng.appInjector$Injector;

void main() {
  runApp(ng.MyAppComponentNgFactory, createInjector: appInjector);
}

For example, the build size of the hello_world (without js package) example was 163,315 and is now 101,983.

Also some ToDo fixes.

@ykmnkmi ykmnkmi marked this pull request as ready for review October 10, 2022 14:30
@ykmnkmi
Copy link
Author

ykmnkmi commented Oct 10, 2022

Or remove Testability API?

@GZGavinZhao
Copy link

Nice code size reduction!

I agree with this mostly, but maybe not remove it for now. I think it is still useful to be able to know the state (particularly the isStable stuff) from the JS side for testing & potentially SSR. Not automatically injecting it is enough.

@GZGavinZhao GZGavinZhao self-requested a review October 11, 2022 11:31
@GZGavinZhao GZGavinZhao merged commit 40afd0e into angulardart-community:master Oct 14, 2022
@ykmnkmi ykmnkmi deleted the optional-testability branch February 22, 2023 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants