dartemis_transformer

Build Status Coverage Status Pub

dartemis_transformer is a transformer for dartemis.

The transformer converts your Components into PooledComponents and it creates the code required to initialize Mappers, Managers and EntitySystems in your Managers and EntitySystems initialize()-method.

If you are importing libraries from other packages with Managers or EntitySystems you are using in your own code, you have to inform the transformer about them by passing a list of those libraries to the transformer:

transformers:
- dartemis
    additionalLibraries:
    - otherLib/otherLib.dart
    - moreLibs/moreLibs.dart

If those libraries need to be transformed as well, you have to add the transformer to their pubspec.yaml.

It's also possible to disable parts of the transformer:

transformers:
- dartemis
    pooling: false
    initializeMethod: false

If you set pooling to false your Components will not be converted into PooledComponents. If you set initializeMethod to false your Mappers, EntitySystems and Managers will not contain generated code for the initialization. Setting both to false is the same as not including the transformer at all.

Caveats

  • If you have a component wth a constructor with a function body, use this to reference class variables and methods. The transformer will not analyze whether a variable in the body is locally scoped or not and only turns this into pooledComponent.

  • The transformer is not tested with cases where a library is imported using an alias. Please file a new issue if it doesn't work and you have to use an alias.

  • Debugging a transformed file in the Dart Editor is not possible because lines don't match but it works fine in Dartium.

Libraries

dartemis_transformer