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

Replace NormalizerFactory with a faster implementation #210

merged 11 commits into from Dec 26, 2019


Copy link

bastnic commented Dec 18, 2019

Replacing NormalizerFactory with a simpler Normalizer that load only model normalizers we need. You can choose to have this Normalizer by using 'normalizer-factory' => false option in your Jane configuration file.
Blackfire compare profile
This example is on a very big API with 509 Normalizers so the impact is really huge.

We still keep NormalizerFactory by default to avoid BC break, but it will become deprecated and will be remove with Jane ^6.0 release.


  • Update Generator
  • Fixture tests
  • Add new parameters to documentation
  • Add deprecation notice for old NormalizerFactory generation
  • Always generate both Normalizers and use LazyNormalizer in NormalizerFactory + update documentation & deprecation notice
bastnic and others added 6 commits Dec 18, 2019
@Korbeil Korbeil marked this pull request as ready for review Dec 18, 2019
Korbeil added 2 commits Dec 19, 2019
documentation/JsonSchema/usage.rst Outdated Show resolved Hide resolved

This comment has been minimized.

Copy link
Contributor Author

bastnic commented Dec 19, 2019

I can't validate because I'm the PR owner but big +1 ;).

- Removing `normalizer-factory` option
- LazyNormalizer is always generated
- Added deprecation notices on NormalizerFactory (and related phpdoc)
- NormalizerFactory internally use LazyNormalizer (except for
Symfony's ArrayNormalizer)
- Update documentation
- Update all fixtures (for both JsonSchema & OpenApi)
Korbeil added 2 commits Dec 19, 2019
@Korbeil Korbeil merged commit b1f53ae into janephp:master Dec 26, 2019
5 checks passed
5 checks passed
cs-check cs-check
tests-7.2 tests-7.2
tests-7.3 tests-7.3
tests-7.4 tests-7.4
coverage coverage
@bastnic bastnic deleted the bastnic:feature/better-normalizer-factory branch Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.