Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Sep 20 08:32
    vladfaust transferred #85
  • Sep 20 08:32
    watzon opened #25
  • Sep 19 23:51
    watzon opened #85
  • Aug 25 17:33
    t-richards opened #84
  • Aug 13 11:21
    vladfaust closed #7
  • Aug 13 11:19
    vladfaust closed #108
  • Aug 13 11:19
    vladfaust closed #109
  • Aug 13 11:17
    vladfaust closed #24
  • Aug 09 08:46
    vladfaust review_requested #109
  • Aug 09 08:46
    vladfaust review_requested #7
  • Aug 08 20:13
    arubinofaux opened #7
  • Aug 08 20:13
    arubinofaux opened #109
  • Aug 02 11:31
    RemiKalbe edited #24
  • Aug 02 11:29
    RemiKalbe opened #24
  • Aug 01 12:52
    RemiKalbe edited #83
  • Aug 01 12:51
    RemiKalbe opened #83
  • Jul 30 18:36
    vladfaust closed #23
  • Jul 30 18:33
    vladfaust transferred #82
  • Jul 30 18:33
    RemiKalbe opened #23
  • Jul 30 15:55
    RemiKalbe opened #82
Jack
@wontruefree
I have now built a project in onyx and like it but my fear is that the lack of convince will slow adoption.
It is super unfortunate but convince drives adoption of frameworks
Vlad Faust
@vladfaust
Um. Resource concept (a.k.a. controllers) is not "convenient", it brings many flaws when resources become somewhat complex. For example, "users/posts" -- should it lie under Users or Posts controller? It's simpler to have endpoints with given routes. There are some QoL improvements needed, indeed. One of them is named routes, which would allow to have nested routes resulting in lesser routes code
CRUD differs from app-to-app. Different conditions before creation or updating, different fields to update, different resource representation.
Vlad Faust
@vladfaust
Also endpoints are modules. You can make use of composition, putting repeated code into separate modules
Jack
@wontruefree
I don't disagree. Just thinking of the QoL
Adrian Madrid
@aemadrid
I’d like to run my specs with something like https://github.com/c910335/mass-spec
but I’m not sure how to build the server
@vladfaust can you point me in the right direction?
I could also use what https://github.com/kemalcr/spec-kemal/blob/master/src/spec-kemal.cr is doing if I can figure out how to build the main handler
Vlad Faust
@vladfaust
I’m sorry I’m away from computer. You could always get the top-level singletone server instance. See onyxframework/onyx/src/http.cr. Or you could spawn your specs like I do in vladfaust/onyx-todo (find in my profile)
That’s all I can do for now, gonna sleep and respond tomorrow morning!
Adrian Madrid
@aemadrid
@vladfaust thx! I’m looking at your specs in todo and it works but it feels dirty to run a real server
I’d rather do it like spec-kemal
Dainel Vera
@arubinofaux
hi everyone
Vlad Faust
@vladfaust
@aemadrid yeah, I see. I'm thinking of implementing something similar to spec-kemal
@arubinofaux hello!
To everyone here: I'm still working on Onyx, everything is alright. I have a bunch of imrovements on my local machine and on dev branches, but I don't want to release them yet while working on Worcr (because these improvements API may change occasionaly while I'm writing Worcr features)
Adrian Madrid
@aemadrid
@vladfaust if you point me in the right direction I can take a stab at it
Vlad Faust
@vladfaust
I've opened #17. RFC if you have anything to add. However, it is blocked a bit by Worcr development -- I'm currently in stage when I can't build the code which means I can't stress-test EDA. Upcoming EDA update along with #16 would require to rewrite any spec helper implementation if it's done right now. Therefore you'll have to wait. I hope to deal with extremely hard (for me) Worcr tagging+limiting algorithm in a couple of days, @aemadrid
Adrian Madrid
@aemadrid
@vladfaust very cool, can wait on it, no hurry
Marwan Rabbâa
@waghanza
can I constraint a route using a regexp ?
Jack
@wontruefree
after a brief look at the router I do not see support for a regex. You could add it to the controller itself.
Marwan Rabbâa
@waghanza
could be a great addition @vladfaust no ?
Jack
@wontruefree
I think so
Adrian Madrid
@aemadrid
+1
Jack
@wontruefree
amber framework pushes the regex sanitation down to the node level
in onxy that is an endpoint
so it might make sense to have something on the endpoint
but that is probably more for vlad to figure out
Vlad Faust
@vladfaust
What's the usecase?
Marwan Rabbâa
@waghanza
@vladfaust I wish to add an endpont that match only on /user/1 and not /user/foo
Vlad Faust
@vladfaust
Usually you'd have path param id : Int32 which would return 400 error
I'm trying to find specs to prove that having two identical routes with regex limitations is bad
Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical.
Onyx Router relies on https://github.com/luislavena/radix, and it does not support Regexes.
Vlad Faust
@vladfaust
But honestly I had ideas on creating binding for r3, which would allow faster routing and matching regexes
Vlad Faust
@vladfaust
Well, no: c9s/r3#118
Vlad Faust
@vladfaust
Upd: the issue above is not relevant (the author forgot brackets). But r3 still lacks in wildcard support
Adrian Madrid
@aemadrid
I can think of a usecase where you want to format the param as a string, say a UID
Marwan Rabbâa
@waghanza
uuid, no ?
Adrian Madrid
@aemadrid
sure
Adrian Madrid
@aemadrid
not a big deal though
Ed
@drum445
@vladfaust do you have a sample project of using MySQL without an orm, just the crystal-mysql lib?
Vlad Faust
@vladfaust
No, I don’t use MySQL at all
Adrian Madrid
@aemadrid
@vladfaust what’s up with Onyx?
Vlad Faust
@vladfaust
What’s up with it? It’s still MIT and got updates in its development branches
Vlad Faust
@vladfaust
There is nothing critical to fix or ship, so I’m not in hurry here. If you’re concerned about testing, it will be done soon. It’s still possible to test endpoints without much problem using fibers