Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[deprecation warning]: ostruct.rb was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0 #1824

Closed
francois opened this issue Oct 16, 2024 · 2 comments

Comments

@francois
Copy link

Just following instructions!

/Users/francois/.rvm/gems/ruby-3.3.5/gems/ruby_event_store-2.15.0/lib/ruby_event_store.rb:6: warning: /Users/francois/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/ostruct.rb was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add ostruct to your Gemfile or gemspec to silence this warning.
Also please contact the author of ruby_event_store-2.15.0 to request adding ostruct into its gemspec.

OpenStruct is known to not be super performant. I have not investigated how/where it is used. Can OpenStruct be replaced, without going to an outside library?

@lukaszreszke
Copy link
Contributor

Hi @francois. Thanks for reporting. I'll check that with the team and let you know.

fidel added a commit that referenced this issue Dec 31, 2024
Since Ruby 3.5 ostruct won't come as bundled gem, it's currently triggering
warning in projects using RailsEventStore as it's required in PreserveTypes:

  - #1824
  - https://bugs.ruby-lang.org/issues/20309
  - ruby/json#565

We don't rely on OpenStruct, but just support it being present in events'
data and metadata. RailsEventStore::JSONClient has been modified to
support OpenStruct only if it's present in project's bundle — we assume
that if someone made a decision to use this library, it was an informed
decision.

Still, it has to become development dependency.
@fidel
Copy link
Contributor

fidel commented Dec 31, 2024

Hey @francois!

Fix for deprecation warning is not yet released, but you can use it by providing github: "RailsEventStore/rails_event_store" option in Gemfile along with this specific ref: 291e0b0

Happy New Year!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants