Harfang release 1.0.0-alpha.2 - we're headed towards beta!

55 views
Skip to first unread message

Nicolas Juneau

unread,
Apr 17, 2016, 8:42:54 PM4/17/16
to Haxe language and help discussion group
Hello fellow Haxers,

I just uploaded Harfang release 1.0.0 alpha 2 to both Haxelib and
Github. For all the juicy details:

* https://github.com/njuneau/Harfang/tree/1.0.0-alpha.2
* https://github.com/njuneau/Harfang/blob/1.0.0-alpha.2/CHANGES

For alpha 2, there's been an internal cleanup and some API changes.
Nothing much in terms of functionality, but hopefully good improvements
on readability. Namely:

- harfang.server.* packages moved to harfang.*

This was done since well... Harfang is a server-side framework and the
server package was redundant. At some point in the past I must have said
to myself "maybe there's going to be a client-side part", but I don't
see this happening.

This will affect mostly the macro configuration since
"harfang.server.ServerMain" is now "harfang.ServerMain". I'll have to
update the docs and tutorials for that.

The class names have been kept, so migrating the code should be as
simple as removing the "server" part from import statements and macro
configuration in the build files.

- ERegURLMapping / URLMapping is now stateless

This is more an internal change, but this can affect your code if you
have custom URLMapping classes. Basically, all of the logic for
resolving an URL can be done in a single method called "resolve". The
new "ResolutionResult" class will hold all of the information that the
dispatcher needs to proceed further.

ERegURLMapping's constructor also has changed. In order to make the
class more stateless, the "EReg" object is no longer stored as an
attribute. Therefore, the mapping's constructor now sports the arguments
needed to create an EReg object instead of having an argument consisting
of the EReg object itself.

- Controller class "handleRequest" and "handlePostRequest" renamed

The methods could cause confusion as this had nothing to do with
GET/POST request handling. They have been renamed "beforeRequest" and
"afterRequest", which is a way more precise name for the task they do.

- Module class "addURLMapping" changes

The module class now sports two methods for adding mappings :
"addURLMapping" can be used to add any generic URLMapping
implementation. "addERegURLMapping" can be used to add ERegURLMapping
instances. The method will take care of actually creating the instance
so you don't have to.

As always, feedback is appreciated! Enjoy!
--
Nicolas Juneau
Reply all
Reply to author
Forward
0 new messages