Skip to content

Releases: DoclerLabs/hexMachina

1.0.0-alpha.7

31 Jan 17:17
Compare
Choose a tag to compare

1.0.0-alpha.6

19 Oct 09:21
03bb481
Compare
Choose a tag to compare

1.0.0-alpha.5

17 Sep 16:40
03bb481
Compare
Choose a tag to compare

in progress

1.0.0-alpha.4

24 Jul 10:30
03bb481
Compare
Choose a tag to compare

Features

  • hexCommand is now an official part of the framework. Unit tests covered and available on js, cpp, php, php7, flash and neko. We're waiting for a fix to have it working with HashLink.

Breaking change

  • Each context got its own unique generated package. This is a big twist, that totally changes the compilation/building process. If you don't have your own compiler implementation, and don't use context package names (normally you shouldn't, it's hidden information), this change won't break your code.

Enhancements

  • Better error reporting during DSL compilation. Before the compilation process was hiding many exceptions, now they are bubbled to the stack. We've added some workarounds to highlight some tricky cases that can only fail during final parsing of generated expressions.
  • Prevent DCE from removing needed classes/methods used in the DSL.
  • CodeLocator uses references instead of reflection.
  • Remove reflection from CoreFactory.
  • Anonymous structures edge cases. Assignments allow: Recursivity, static call, closure call, method call...
@context( name = 'applicationContext' )
{
	@public
	foo = new hex.mock.ConstructorWithAnonStruct( { s: Std.string(5) } );
	
	@public
	o = { s: Std.string(5) };
	
	@public
	o2 = { s: foo.getString() };
	
	@public
	foo2 = new hex.mock.ConstructorWithAnonStruct( { s: foo.getString() } );
	
	@public
	foo3 = new hex.mock.ConstructorWithAnonStruct( { s: closure() } );
	
	closure = foo.getString.bind();
}
  • Allow assignment from instance method call
@context
{
	@public 
	gateway = service.getGatewayURL( url, page );
	
	@public
	service = new hex.mock.MockService();
	
	url = "http://localhost/amfphp/";
	page = "gateway.php";
}
  • Allow assignment from bound method call
@context
{
	@public 
	cloned = closure( service );
	
	service = new hex.mock.MockService();
	closure = hex.mock.MockService.clone.bind( _, gateway );
	gateway = "http://localhost/amfphp/gateway.php";
}
@context
{
	@public 
	gateway = closure( url );
	
	@public
	service = new hex.mock.MockService();
	
	url = "http://localhost/amfphp/";
	page = "gateway.php";

	closure = service.getGatewayURL.bind( _, page );
}

Bugfixes

  • Context import feature restored in flow and xml compilers.
  • #284
  • #285
  • #286
  • #290
  • #289
  • #294
  • #293
  • Double public accessors removed in injection building.

Experimental

  • hexModular is in development. The goal is to have a modular DSL compiler for JavaScript. It's not official yet because it still lacks tests.

0.35.0

19 Feb 15:28
c0e6e7d
Compare
Choose a tag to compare

Features

  • Unit tests are generated at compile time. It removes the need of reflection at runtime and allows better compilation workflow (ie: Use Closure compiler in advanced mode).
  • Mappings consistency are checked at compile time in Flow DSL between mapped type and: Class name, reference or primitive value.
  • bind added to Flow DSL. Mapping checking works with bind as well.
    See examples below:
@context
{
	recursive.f3 = sample.testBind.bind( _, i );
	recursive.f4 = hex.mock.Sample.testStaticBind.bind( _, i );
	
	@public
	binded = sample.testBind.bind( _, i );
	
	@public
	staticBinded = hex.mock.Sample.testStaticBind.bind( _, i );
	
	@public
	recursive = new hex.mock.ConstructorWithClosureArgs( sample.testBind.bind( _, i ), hex.mock.Sample.testStaticBind.bind( _, i ) );
	recursive.callWithClosureArgs( sample.testBind.bind( _, i ), hex.mock.Sample.testStaticBind.bind( _, i ) );
	result = hex.mock.ConstructorWithClosureArgs.staticallWithClosureArgs( sample.testBind.bind( _, i ), hex.mock.Sample.testStaticBind.bind( _, i ) );
	
	@public
	mapping1 = mapping( { fromType: "String->String", toValue: binded } );
	
	@public
	mapping2 = mapping( { fromType: "String->String", toValue: hex.mock.Sample.testStaticBind.bind( _, i ) } );
	
	sample = new hex.mock.Sample();
	i = 3;
}
  • ExMachinaUnitCore.addRuntimeTest gives retro-behavior to add tests at runtime in the runner.
  • MacroUtil.getTypeFromString returns haxe.macro.Type from a given stringified fcqn.
  • MacroUtil.getIdent returns expr ident if there's one.

Breaking change

  • MethodRunner.asyncHandler( callback : Void->Void) should be used for asynchronous tests. It triggers the final callback for ending the asynchronous test.
    Example:
        Timer.delay( MethodRunner.asyncHandler( this._onCompleteTestAsyncTransitionsWithHandlers ), 200 );
       //becomes
        Timer.delay( MethodRunner.asyncHandler.bind( this._onCompleteTestAsyncTransitionsWithHandlers ) , 200 );

Example with argument callback

        acb.onComplete( MethodRunner.asyncHandler( this._onTestExecuteComplete, [ service, acb ] ) );
        //becomes
        acb.onComplete( function( result : String ) 
                MethodRunner.asyncHandler( function() this._onTestExecuteComplete( result, service, acb ) ) );

Enhancements

  • MacroUtil.getClassType can be called in silent mode (to prevent error throwing)
  • ReflectionBuilder throws exception for annotated virtual getters/setters.

Bugfixes

  • tink_macro dependency set to 16.1
  • Conflict between IsLoggable and IInjectable when they extend the same interface. #245

Experimental

  • hexCommand is still in development. The final goal is to deprecate hexIoC and hexMVC to go to final release without reflection.

0.34.0

15 Jan 16:00
c75bb10
Compare
Choose a tag to compare

Features

  • ClassDescriptorGenerator generate class descriptors recursively at compile time.
        var classDescriptor = ClassDescriptorGenerator.generate( HexUnitSuite );
  • #genhexunit compiler argument added to activate unit test compile time features.
  • CommandTrigger handles local variable injection with @Optional (parameters are working as well with static var replacement)
  • MacroUtil.getClassName added.
  • MacroUtil.compressField added.

Breaking change

  • Dataprovider's API uses only one argument.

This...

    public static var namedAndUnnamedParametersConstructorDataProvider:Array<Array<Dynamic>> = [
        [MixedParametersConstructorInjectee],
        [MixedParametersConstructorInjecteeConst],
        [MixedParametersConstructorInjecteeConstOutside],
        [MixedParametersConstructorInjecteeConstOutsideFQCN]
];

... becomes now:

    public static var namedAndUnnamedParametersConstructorDataProvider:Array<Class<Dynamic>> = [
        MixedParametersConstructorInjectee,
        MixedParametersConstructorInjecteeConst,
        MixedParametersConstructorInjecteeConstOutside,
        MixedParametersConstructorInjecteeConstOutsideFQCN
    ];

Enhancements

  • Unit test framework refactoring. Business logic extracted from data structures. (ClassDescriptor, MethodDescriptor...)
  • ArrayUtil cleaned, no more short lambda macro emulation.
  • AsyncResponder class removed.
  • We don't print anymore reflection data in exported code except with #debugReflection compiler argument.
  • Old annotation system removed (13 classes).
  • Old injectors classes removed. (44 classes).
  • During reflection merging we get rid of duplicated existing data and we keep super constructor data only if there's no constructor data available.
  • Injector generated methods are saved from DCE.
  • Useless php/conditional removed in Injector class.
  • Macro code coverage with enum injection. (24 tests)

Bugfixes

  • MacroUtil.getFQCNFromComplexType doesn't handle class with packaged type parameters belonging to another module.
  • MacroUtil.getFQCNFromComplexType doesn't return right fully qualified type for method closure without arguments.
  • Method reflection doesn't cover specific signatures #247
  • ReflectionBuilder uses class name instead of module's name.
  • Conflict between IsLoggable and IInjectable when they extend the same interface. #245
  • @Optional is set to false when it has no value
  • Injectors cannot handle function argument correctly as a constructor dependency. #247
  • Missing mapping exceptions are not thrown with the new injector in specific situations.
  • @lazy needs to be @public to work. #251
  • Abstract type is not used for local variables. #253
  • CommandTriggerBuilder doesn't request reflection update for module and injector annotated properties.

Experimental

  • hexCommand repository maintained and fine tuned to replace hexMVC soon.

0.33.0

21 Nov 14:12
c75bb10
Compare
Choose a tag to compare

AnnotationTransformer replaces FastAnnotationReader. This class was used to generate reflection footprints initially and was designed previously for automatic DI. AnnotationTransformer add fields and remove the need of Reflect API for DI frameworks. In a nutshell, for automatic DI, it offers faster performances and size reduction + the possibility to inject members with private attribute.

0.32.0

31 Oct 12:41
Compare
Choose a tag to compare

Features

@public added for BasicStaticFlowCompiler. Every id that is not declared public won't be accessible and visible from the context locator or another file/context.

Set isPublic visible from outside with @public annotation
@context
{
	@public
	isPublic = 'isPublic';
	
	isPrivate = 'isPrivate';
}

Enhancements

  • Invalid flow expressions should throw an error #242
  • Module runtime dependencies checking happens only in debug mode. #241

Bugfixes

  • Fix @AfterMapping scope issue #239
  • state keyword is failing with flow when it's declared alone. #240

Experimental

  • hexCommand repository added. It's a lightweight fork of hexMVC best practices. More infos will come in future releases.

0.31.0

11 Oct 10:17
Compare
Choose a tag to compare

Features

Add State support on StaticCompiler [FrancisBourre/hexIoC@8f7e033]

0.30.0

04 Oct 06:40
Compare
Choose a tag to compare

Features

State behaviors can be described with flow

Simple example with native states transitions
@context( name = 'applicationContext' )
{
	assemblingStart = 
	state( ref( applicationContext.state.ASSEMBLING_START ) )
		.enter( hex.ioc.parser.xml.assembler.mock.MockStateCommand )
		.exit( hex.ioc.parser.xml.assembler.mock.MockStateCommand );

	objectsBuilt = 
	state( ref( applicationContext.state.OBJECTS_BUILT ) )
		.enter( hex.ioc.parser.xml.assembler.mock.MockStateCommand )
		.exit( hex.ioc.parser.xml.assembler.mock.MockStateCommand );
	
	domainListenersAssigned =
	state( ref( applicationContext.state.DOMAIN_LISTENERS_ASSIGNED ) )
		.enter( hex.ioc.parser.xml.assembler.mock.MockStateCommand )
		.exit( hex.ioc.parser.xml.assembler.mock.MockStateCommand );
	
	methodsCalled =
	state( ref( applicationContext.state.METHODS_CALLED ) )
		.enter( hex.ioc.parser.xml.assembler.mock.MockStateCommand )
		.exit( hex.ioc.parser.xml.assembler.mock.MockStateCommand );
	
	modulesInitialized =
	state( ref( applicationContext.state.MODULES_INITIALIZED ) )
		.enter( hex.ioc.parser.xml.assembler.mock.MockStateCommand )
		.exit( hex.ioc.parser.xml.assembler.mock.MockStateCommand );
	
	assemblingEnd =
	state( ref( applicationContext.state.ASSEMBLING_END ) )
		.enter( hex.ioc.parser.xml.assembler.mock.MockStateCommand )
		.exit( hex.ioc.parser.xml.assembler.mock.MockStateCommand );
}
Example of extension of native states transitions
@context( 
			name = 'applicationContext', 
			type = hex.ioc.parser.xml.assembler.mock.MockApplicationContext )
{
	customState = state( ref( this.state.CUSTOM_STATE ) )
		.enter( hex.ioc.parser.xml.assembler.mock.MockStateCommandWithModule, contextOwner( anotherModule ) );

	anotherState = state( ref( this.state.ANOTHER_STATE ) )
		.enter( hex.ioc.parser.xml.assembler.mock.MockStateCommand, fireOnce );
	
	@map_type( 'hex.module.IModule' )
	module = new hex.ioc.parser.xml.assembler.mock.MockModule();
	
	@map_type( 'hex.module.IModule' )
	anotherModule = new hex.ioc.parser.xml.assembler.mock.MockModule();
}
Example of building custom states transitions
@context
{
	messageID = new hex.event.MessageType( 'messageName' );
	anotherMessageID = new hex.event.MessageType( 'anotherMessageName' );
	
	customState = state()
		.enter( method(module.callback) )
		.transition( messageID, anotherCustomState );
	
	anotherCustomState = state()
		.enter( hex.ioc.parser.xml.assembler.mock.MockStateCommand )
		.exit( hex.ioc.parser.xml.assembler.mock.MockExitStateCommand )
		.transition( anotherMessageID, customState );
		
	@map_type( 'hex.module.IModule' )
	module = new hex.ioc.parser.xml.assembler.mock.MockModule();
}

Enhancements

  • @optional argument is optional for IInjectorContainer [#237]
  • Haxe 4 nightly build support on JS, neko and Flash targets

Bugfixes

  • reference.property passed as a constructor argument of an instance of IDependencyOwner with flow prevents from compiling.