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
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 added a commit to divdavem/ariatemplates that referenced this pull request Mar 8, 2017

fix/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 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 #1760

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

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

fix/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 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 #1760

divdavem added some commits Mar 8, 2017

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
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).
@fbasso

fbasso approved these changes Mar 9, 2017

@divdavem

This comment has been minimized.

Show comment
Hide comment
@divdavem

divdavem Mar 9, 2017

Member

@fbasso Thank you for your review!

Member

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