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

Fixes and improvements for beans pre-compilation #1760

Merged
merged 2 commits into from Mar 9, 2017

Conversation

Projects
None yet
2 participants
@divdavem
Copy link
Member

divdavem commented Mar 7, 2017

This PR contains a set of fixes and improvements linked to beans pre-compilation, introduced in #1759:

  • the ATDebug flag when compiling beans is now removed because it also caused all templates to be compiled in debug mode (with line numbers)
  • there are new checks in BeanExtractor to be sure that the configuration in the JsonValidator is correct for the extraction with the given options to be successful
  • an issue with default values which were not correctly normalized in non debug mode is now fixed
  • the value returned by the generated $getDefault functions is no longer fully normalized, but it is expanded in $fastNorm in order to reduce the size of compiled beans
  • beans which are not used in the fast normalization process are now discarded by the bean extractor when onlyFastNorm is true, in order to reduce the size of the resulting file
  • functions returning typical default values ({}, [], and null) are now cached to avoid generating them multiple times and to reduce the size of compiled beans
  • the generated fast normalization functions now call the fast normalization function generated for the parent bean when it is useful and possible, in order to reduce the size of compiled beans
  • a consistency issue between fast and slow normalization is now fixed by removing early normalization of default values. Default values are no longer normalized at the time a bean is pre-processed. At the time a default value is used, its copy is normalized in the context where it is used. This can change the result of normalization in case a bean overrides the default value of some of its parent properties and inherits from the default value of its parent (which is no longer normalized).

@divdavem divdavem force-pushed the divdavem:ATDebugFlag branch from e4ded35 to 953e7de Mar 8, 2017

divdavem added a commit to divdavem/ariatemplates that referenced this pull request Mar 8, 2017

fix/feat ariatemplates#1760 fixes and improvements for beans pre-comp…
…ilation

This commit contains a set of fixes and improvements linked to beans
pre-compilation, introduced in ariatemplates#1759:
 - the ATDebug flag when compiling beans is now removed because it also
caused all templates to be compiled in debug mode (with line numbers)
 - there are new checks in BeanExtractor to be sure that the configuration
in the JsonValidator is correct for the extraction with the given options
to be successful
 - an issue with default values which were not correctly normalized in non
debug mode is now fixed
 - the bean extractor now further improves the size of output files when
onlyFastNorm is used by completely excluding some beans which are not used
in the fast normalization process
 - functions returning typical default values ({}, [], and null) are now
cached to avoid generating them multiple times and saving space in the
output of the bean extractor

close ariatemplates#1760

@divdavem divdavem changed the title fix ATDebug flag introduced in #1759 and error messages in BeanExtractor Fixes and improvements for beans pre-compilation Mar 8, 2017

@divdavem divdavem force-pushed the divdavem:ATDebugFlag branch from 953e7de to f67d5b7 Mar 8, 2017

divdavem added a commit to divdavem/ariatemplates that referenced this pull request Mar 8, 2017

fix/feat ariatemplates#1760 fixes and improvements for beans pre-comp…
…ilation

This commit contains a set of fixes and improvements linked to beans
pre-compilation, introduced in ariatemplates#1759:
 - the ATDebug flag when compiling beans is now removed because it also
caused all templates to be compiled in debug mode (with line numbers)
 - there are new checks in BeanExtractor to be sure that the configuration
in the JsonValidator is correct for the extraction with the given options
to be successful
 - an issue with default values which were not correctly normalized in non
debug mode is now fixed
 - the bean extractor now further improves the size of output files when
onlyFastNorm is used by completely excluding some beans which are not used
in the fast normalization process
 - functions returning typical default values ({}, [], and null) are now
cached to avoid generating them multiple times and to save space in the
output of the bean extractor

close ariatemplates#1760
feat #1760 fixes and improvements for beans pre-compilation
This commit contains a set of fixes and improvements linked to beans
pre-compilation, introduced in #1759:
 - the ATDebug flag when compiling beans is now removed because it also
caused all templates to be compiled in debug mode (with line numbers)
 - there are new checks in BeanExtractor to be sure that the configuration
in the JsonValidator is correct for the extraction with the given options
to be successful
 - an issue with default values which were not correctly normalized in non
debug mode is now fixed
 - the value returned by the generated $getDefault functions is no longer
fully normalized, but it is expanded in $fastNorm in order to reduce the
size of compiled beans
 - beans which are not used in the fast normalization process are now
discarded by the bean extractor when onlyFastNorm is true, in order to
reduce the size of the resulting file
 - functions returning typical default values ({}, [], and null) are now
cached to avoid generating them multiple times and to reduce the size of
compiled beans
 - the generated fast normalization functions now call the fast
normalization function generated for the parent bean when it is useful and
possible, in order to reduce the size of compiled beans

close #1760

@divdavem divdavem force-pushed the divdavem:ATDebugFlag branch 5 times, most recently from b72ca20 to f24207b Mar 8, 2017

feat #1760 Disabling early normalization of default values
This commit fixes a consistency issue between fast and slow normalization
by removing early normalization of default values.
Default values are no longer normalized at the time a bean is
pre-processed. At the time a default value is used, its copy is normalized
in the context where it is used. This can change the result of
normalization in case a bean overrides the default value of some of its
parent properties and inherits from the default value of its parent (which
is no longer normalized).

@divdavem divdavem force-pushed the divdavem:ATDebugFlag branch from f24207b to 1b9751e Mar 9, 2017

@fbasso

fbasso approved these changes Mar 9, 2017

@divdavem

This comment has been minimized.

Copy link
Member Author

divdavem commented Mar 9, 2017

@fbasso Thank you for your review!

@divdavem divdavem merged commit 1b9751e into ariatemplates:master Mar 9, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@divdavem divdavem added this to the 1.8.3 milestone Mar 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.