Skip to content

URGENT ! TypeThunk broke everything for Angular Production Builds #176

Description

@amoscatelli

When compiled with production flags (optimization, aot, buildOptimizer to true) TypedJSON is now broken for Angular since TypedJSON 1.7 version (and also 1.8 RC of course).

The problem is the introduction of TypeThunk :

type: () => createArrayType(ensureTypeDescriptor(typeThunk()), dimensions),

To explain the issue I must clarify that when compiled without productions flags, Angular turns this :

@jsonObject export class FindCriteriaDTO { }

into this :

var FindCriteriaDTO =
/** @Class */
function () {
function FindCriteriaDTO() {}

FindCriteriaDTO = __decorate([typedjson_1.jsonObject], FindCriteriaDTO);
return FindCriteriaDTO;
}();

With production flags this is compiled into this :

var FindCriteriaDTO = __decorate([typedjson_1.jsonObject], function() {});

typeThunk() function calls the MaybeTypeThunk function, that is, the __decorate function with anonymous function parameter and that returns undefined.

With 1.6 version that was not a problem since TypeThunks were not used :

type: createArrayType(ensureTypeDescriptor(elementConstructor), dimensions),

This is urgent since it breaks production builds !

Please let me know as soon as possible
Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions