Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 04 00:44
    Blackmoses32 starred hanami/controller
  • Dec 03 19:08
    ianks commented #359
  • Dec 03 19:08
    ianks synchronize #359
  • Dec 03 17:56
    wholesomedonut starred hanami/hanami
  • Dec 03 15:39
    cllns commented #356
  • Dec 03 15:37
    cllns synchronize #356
  • Dec 03 15:37

    cllns on raise-error-for-missing-view

    Include action class name in er… (compare)

  • Dec 03 14:04

    jodosha on main

    Prepare for v2.0.0.alpha4 (compare)

  • Dec 03 13:52

    jodosha on main

    Prepare for v2.0.0.alpha4 (compare)

  • Dec 03 12:02

    waiting-for-dev on remove_circleci_config

    (compare)

  • Dec 03 12:02

    waiting-for-dev on main

    Remove leftover CircleCI config… (compare)

  • Dec 03 12:02
    waiting-for-dev closed #1134
  • Dec 03 12:02
    jodosha milestoned #1134
  • Dec 03 12:02
    jodosha assigned #1134
  • Dec 03 12:01
    waiting-for-dev review_requested #1134
  • Dec 03 12:00
    waiting-for-dev opened #1134
  • Dec 03 12:00

    waiting-for-dev on remove_circleci_config

    Remove leftover CircleCI config… (compare)

  • Dec 03 05:46
    waiting-for-dev synchronize #197
  • Dec 03 05:46

    waiting-for-dev on routes_helper

    Access application routes from … (compare)

  • Dec 03 05:42

    waiting-for-dev on context_provider

    (compare)

Seb Wilgosz
@swilgosz
@ume-san:matrix.org this unnecessary redundant namespacing is exactly what Tim Riley worked on last month! The recent dry-system release solves exactly this problem and the next Hanami 2 alpha release will have simplified file structure:)
See the dry-system changes here: github.com/dry-rb/dry-system/blob/52e197b0aa8bd0301befc5afeb55e19a4ff6e8d6/spec/integration/container/auto_registration/component_dir_namespaces/multiple_namespaces_spec.rb
Seb Wilgosz
@swilgosz
And you may expect more details in the next Open Source update article:)
Edit: And you may expect more details in the next Tim's Open Source update article:)
ume-san
@ume-san:matrix.org
[m]
It sounds really great ! Simplified structure must be beneficial when migrating from 1.3 to 2.0 !! Thank you for you guys efforts !!
Seb Wilgosz
@swilgosz
BTW, Again, I strongly suggest to move to discourse.hanamirb.org as it's way easier to to track multiple threads and we would be able easier for us to help more people simultanously :). You may expect official announcement soon, similar as for rom-rb gitter chat.
ume-san
@ume-san:matrix.org
[m]
Pinned post on question category of discourse.hanamirb.org lead me here...
1 reply
Next time, I will post there!
postmodern
@postmodern:matrix.org
[m]
have you thought about setting up an unofficial Discord server? It's actually much nicer than Slack, and supports creating Threads that auto-expire.
Seb Wilgosz
@swilgosz
@ume-san:matrix.org :xD ! That's fine:) . I don't mind chatting a bit ;)
@postmodern:matrix.org I am unaware of the community preferences, feel free to open a forum thread and collect feedback!:). I personally love discord, but I use pretty much everything so I'm not the best person to vote.
ume-san
@ume-san:matrix.org
[m]
👍️
Andreas Haller
@ahx
Hi. I have a question about hanami-router / hanami-api.
It is not possible to use scope with a path variable like scope ':tenant_id', am I right?
Would that be even possible with the trie based router?
4 replies
Seb Wilgosz
@swilgosz
Hi all, if anyone is struggling with persistence layer in Hanami 2.0, I've just published the complete guide for this topic as a new Hanami Mastery episode. Feel free to check it out! https://hanamimastery.com/episodes/9-guide-to-models-in-hanami-and-rom
Jeffrey 'jf' Lim
@jf

is anybody aware of an issue with the "Getting Started" guide? I'm working through it and am just before "Displaying Validation Errors", and then I hit this issue with Hanami booting:

An error occurred while loading spec_helper.
Failure/Error: Hanami.boot

NoMethodError:
  undefined method `size' for nil:NilClass
# /home/x/.rbenv/versions/2.7.4/gemsets/hnm/gems/dry-validation-0.11.0/lib/dry/validation/schema/deprecated.rb:11:in `input_processor'
# /home/x/.rbenv/versions/2.7.4/gemsets/hnm/gems/dry-validation-0.11.0/lib/dry/validation/schema/class_interface.rb:165:in `default_options'
# /home/x/.rbenv/versions/2.7.4/gemsets/hnm/gems/dry-validation-0.11.0/lib/dry/validation/schema/class_interface.rb:35:in `new'
# /home/x/.rbenv/versions/2.7.4/gemsets/hnm/gems/hanami-validations-1.3.7/lib/hanami/validations.rb:109:in `validations'
# /home/x/.rbenv/versions/2.7.4/gemsets/hnm/gems/hanami-controller-1.3.3/lib/hanami/action/params.rb:152:in `params'
# /home/x/.rbenv/versions/2.7.4/gemsets/hnm/gems/hanami-controller-1.3.3/lib/hanami/action/validatable.rb:100:in `block in params'
# /home/x/.rbenv/versions/2.7.4/gemsets/hnm/gems/hanami-controller-1.3.3/lib/hanami/action/validatable.rb:100:in `class_eval'
# /home/x/.rbenv/versions/2.7.4/gemsets/hnm/gems/hanami-controller-1.3.3/lib/hanami/action/validatable.rb:100:in `params'
# ./apps/web/controllers/books/create.rb:9:in `<class:Create>'
# ./apps/web/controllers/books/create.rb:4:in `<module:Books>'
# ./apps/web/controllers/books/create.rb:3:in `<module:Controllers>'
# ./apps/web/controllers/books/create.rb:2:in `<module:Web>'
# ./apps/web/controllers/books/create.rb:1:in `<top (required)>'
# /home/x/.rbenv/versions/2.7.4/gemsets/hnm/gems/hanami-utils-1.3.8/lib/hanami/utils.rb:56:in `require_relative'
...

This is most unexpected. I've dug through some of the gems... and arrived at dry-validation-0.11.0/lib/dry/validation/schema/deprecated.rb, where this is the offending line (apparently type_map is not expected to be nil):
elsif type_map.size > 0 && config.input_processor != :noop

I don't know where type_map is set though

2 replies
Seb Wilgosz
@swilgosz
I personally am only helping with 2.0 and I strongly suggest to start from there. I have already published video resources helping to create a blog application on http://hanamimastery.com . I do work on guides for hanami 2.0 and I do support my GH sponsors directly aside of helping in these official channels. I think if you will start from the development version, hanami template repo, you will have ton of time saved in the longer run :)
1 reply
For 1.3 I will only be concerned to help people update to 2.0
Seb Wilgosz
@swilgosz
I do understand your frustration. I don't tell you to drop it, It's just my friendly advice that I believe will save you a lot of time, because hanami 2.0 is a rewriting of the framework, and a lot of concepts just changed completely. You could be more frustrated to spend months on Hanami 1.3 just to realize that for 2.0 you need to learn a big part of the framework again. Hanami 2 is already in alpha, next alpha version will be released soon, and I don't see much sense to learn deeply version that will be outdated soon. I am publishing content about Hanami 2 to manage limited time resources I have, want to recird videos that will last for a while. And about episodes themselves: you don't need to go through all, I have a hanami tag, where you can just filter by hanami tutorials. I also have a complete source code for each episode, https://github.com/swilgosz/hanamimastery . Those are showcases though, I am doing my best, but its not complete and not all cases are covered yet. The Hanami guides (official) I am also doing in my free time, while learning the framework in parallel! As this is an in-development version, there are parts I need to figure out on my own or find workarounds until proper feature is implemented. While I am in the close contact with the core team, they are really busy with developing the 2.0 releases, so it's easier to get support with that one, even though you may encounter more problems.
Hanami Mastery is not named because I am the master, but rather to reflect my journey to become master in the future, while helping others do the same but easier :)
Seb Wilgosz
@swilgosz
I honestly think that HanamiMastery is currently the best starting point in the world to play with Hanami 2, until the 2.0 guides are in place. Then HM will become just an addition. Keep in mind, I am doing all this work voluntarily as a standalone person, not being in the core Hanami team because I want to speed up the process of releasing Hanami 2 and the adoption by the ruby community. Because of that I am sorry if I make mistakes or will cause you troubles. I always try to helo as much as I can though.
Update: I always try to help*....
Seb Wilgosz
@swilgosz
And sorry for lonking wrong repo above. Here is correct one: https://github.com/hanamimastery/episodes
Jeffrey 'jf' Lim
@jf
ok. I understand and appreciate the explanation. I have no idea what's coming down the pipeline besides the official website. That's what I've been using so far. If a 2.0 is coming and it's better to simply wait, or go elsewhere for other resources, I think it would be good to mention it on the official websites, whether that be at the main page of hanamirb.org, in the guide/s, and/or github.
Seb Wilgosz
@swilgosz
That's a very good point actually! Will try to do sth about it!
Seb Wilgosz
@swilgosz
I've changed my job to get high Hanami exposure in commercial projects. I'd not post about it here, but wanted to let you know, that this is a change that will highly affect my engagement in everything hanami-related.
https://hanamimastery.com/articles/secret-of-stunning-oss-contributions
Aestimo
@iamaestimo

Hey guys. I'm using the Hanami 2 template to build an app and so far hit a load error 👇

Hanami load error

I've bundled the required gems and even created an env.development file and since Hanami 2 alpha is bundled, am wondering why it can't seem to find that file. What am I doing wrong?

Luca Guidi
@jodosha
@iamaestimo This morning I added Gemfile.lock to the app template. The app boots (specs are passing). Please try again.
Aestimo
@iamaestimo
@jodosha lemme see
Sebastjan Hribar
@sebastjan-hribar

Hi all, I'd like to ask for you input on this use case: I'd like to move some rake tasks to UI actions. These tasks import CSV data, parse them and create DB records. Currently admin needs to run these inside the container. Since these need to be run more than once I need to make things simpler. The CSV files do not need to be stored on the server. So I'm thinking to have a file selection UI element that reads the file into memory and does the same processing as the rake tasks.

So I would use JS to read in the file and pass it in memory as a param to an interactor on a designated action. Is this the way to go? And should I take any special security measures?

Seb Wilgosz
@swilgosz

Edit: @sebastjan-hribar what about the size of the file? Won't it be a memory issue if you'd work with big files? I see it as a bit risky if you need to load all the content without checking the max file size first. I would still save the file on the server, even in the temporary storage, and clean it up after processing finishes. This way I would introduce two endpoints, for file upload creation, and the second one for processing it. You could still merge those endpoints if that's a requirement.

PS: Sorry for typos in my original message, I really need to stop answering from mobile :)

Sebastjan Hribar
@sebastjan-hribar
@swilgosz Thank you. Right you are, but I'd rather check for file size using JS before reading the file into memory.
Paweł Synowiec
@synusynu

Hello! :) i have few questions following custom helpers

  1. i notices changing order of load_paths impacts code loading, if i add 'helpers' dir last:

       load_paths << [
         'controllers',
         'views',
         'helpers'
       ]

    then my Helper's don't get loaded, i get uninitialized constant Web::Helpers during Hanami.boot

  2. How do you gyus test helpers? Some helpers i have are dependent on params or HtmlBuilder
    Now I created a DummyView and test this helper the same way as view, but maybe it would be possible to test this helper in isolation? some ideas? :)

9 replies
Paweł Synowiec
@synusynu
ok, i see in hanami/helpers that it's the best way to go probably :)
Paweł Synowiec
@synusynu
ok, another question: what are slices? I found some information about this feature, but no info in guides. Are they called apps now? If no, what is the difference between those concepts? Maybe someone could share some articles about this or something? :)
Seb Wilgosz
@swilgosz
There is no info yet in the official guides, as guides for 2.0 are in progress, vut will be added soon. Also, here @timriley talked about them a bit here: https://5by5.tv/rubyonrails/353
And finally, I have mentioned slices in the Ruby Rogues podcast episode last week, but this one is yet to be released. You can join my newsletter at hanamimastery.com or follow my twitter to get the info when it's released.
Paweł Synowiec
@synusynu

yup, i read your article. The problem is there is only some brief mention about this topic, i would love to see some examples about what it is and how to use it :)
Are there maybe guides for older version covering this topic?

Thx, i'll check out those talks :)

Sebastjan Hribar
@sebastjan-hribar
Hi all, could someone help me debug an issue with my gem rokku? The tests pass, but when used in production it fails when generating policies. To test just crate a blank 1.3 Hanami app, add rokku to gemfile and run the policy generation command in project root. I'd really appreciate any help. I suspect it's related to the executable, but I'm not sure.
Luca Guidi
@jodosha
Paweł Synowiec
@synusynu

question: i want to add 'log out' link. I have DELETE route for destroying user's session. I want to add it on template, in navbar, but it has to be form (as i need to make DELETE request). But then unit test for Layout fails, because of form helper:

     NoMethodError:
       undefined method `params' for #<Web::Views::ApplicationLayout:0x000055b1bfa7b1a8>

Some ideas? I could change route for GET and use normal link. Or try to disable CSRF protection somehow maybe? Or fix my test somehow :)

Luca Guidi
@jodosha

:mega: Announcement

Folks, as you may have read in the alpha3 announcement, we’re going to release :point_right: monthly alphas :point_left:.

How?

So far the alpha releases were scope bound :chart_with_upwards_trend:.
When the scope was developed, we used to release it.

Now that the ground work is done (thanks Tim :pray: ), we can change the release strategy and make it time bound :stopwatch:.

Once a month, we :shipit: a new alpha, with the improvements that we made since the previous release.
This puts us in a position to release often and build momentum. :fire:

What?

We will focus on the cleanup of the application template. https://github.com/hanami/hanami-2-application-template

The template is a working Hanami 2 app.
By cleaning up it, we can reverse engineer what we need to implement in the framework.

:call_me_hand: If you want to contribute to Hanami, please start from the application template needs, and the work backward to enhance Hanami.

Seb Wilgosz
@swilgosz
Awesome news!
Edouard
@inouire_twitter
Amazing !
Sebastjan Hribar
@sebastjan-hribar
I've fixed issues with CLI for rokku. The new version is now 0.6.2. Don't use lower versions. The authorization checking logic is the same, but building policy files was broken.
Paweł Synowiec
@synusynu
Hello! Is it possible to connect two repositories to the same table?
3 replies
Sebastjan Hribar
@sebastjan-hribar

This is my first part of my yesterday's question. I've removed the gem list:

I'm experiencing a really odd issue. I'm getting TypeError at no implicit conversion of Integer into String for this line: session[:session_start_time] + @validity_time.to_i < Time.now. This started on a development branch where the only change that might impact this is the gemfile or gemfile.lock. On master, session[:session_start_time] is a NilClass and on the development the session[:session_start_time] is a String class. I did delete the gemfile.lock on the development and ran a fresh bundle install. The session[:session_start_time] is set as Time.now.
I've checked Tachiban and irb for the comparison and it runs fine, as well as on the master branch.

Now for the solution:
I've found the culprit. It was hanami 1.5.0. Reverting it back to hanami 1.3.0 solves the problem. Now I don't know, does this qualify for an issue for Hanami or Tachiban?