HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.1k stars 647 forks source link

Dispatch.hx easier debug #6581

Closed sebpatu closed 6 years ago

sebpatu commented 6 years ago

Hi, in haxe.web.Dispatch.hx runtimeDispatch function use a try catch that will make loose the debug stack trace when we have an issue in dispatchers code.

I think it would be great to keep the try catch only in release mode.

Thanks Seb

Simn commented 6 years ago

Dispatch will be removed from the standard library for Haxe 4.

sebpatu commented 6 years ago

but its not removed yet. i suppose that for backward compatibility, there will be a new haxelib containing the Dispatch code, where the request should be added.

jonasmalacofilho commented 6 years ago

@sebpatu its new home is hx3compat, but I'm not sure what the plans are for future work on those modules. (EDIT: asked about this in HaxeFoundation/hx3compat#2)

I actually use a forked implementation that takes into account the HTTP method during the dispatch (doFoo() vs. getFoo() vs. postFoo()). If you think it's useful for your use case, you can post the issue there as well...

jdonaldson commented 6 years ago

I'm working on a replacement for Dispatch here: https://github.com/jdonaldson/golgi

It's macro based rather than reflection based, and already it's much faster. However, it's still a work in progress. Like Dispatch, it doesn't have features specific to http routing.

tink_web is also pretty similar, more focused on http routing, and much more mature : https://haxetink.github.io/tink_web/#/