apotonick / declarative

DSL for nested schemas.
MIT License
22 stars 8 forks source link

Declarative::Variables::Append(ary) deprecation warning #6

Open jamesbebbington opened 4 years ago

jamesbebbington commented 4 years ago

A few months back, having upgraded trailblazer and some of its dependencies, we started getting the following warning on app boot:

$ rails c
[Declarative] Defaults#merge! and #call still accept arrays and automatically prepend those. This is now deprecated, you should replace `ary` with `Declarative::Variables::Append(ary)`.
Loading development environment (Rails 6.0.3)
2.6.5 :001 > 

Apologies, I should have noted down which update caused this to start happening.

I've just now tracked down where it's being generated from. I get that it's just a deprecation warning, but it taunts me (and at least one other) on every boot and test run. Is it get rid-able? Many thanks.

Backtrace for gem load error is:
gems/declarative-0.0.10/lib/declarative/defaults.rb:32:in `handle_array_and_deprecate'
gems/declarative-0.0.10/lib/declarative/defaults.rb:25:in `call'
gems/declarative-0.0.10/lib/declarative/definitions.rb:40:in `add'
gems/declarative-0.0.10/lib/declarative/schema.rb:55:in `build_definition'
gems/representable-3.0.4/lib/representable/cached.rb:6:in `build_definition'
gems/declarative-0.0.10/lib/declarative/schema.rb:25:in `property'
gems/representable-3.0.4/lib/representable/declarative.rb:10:in `collection'
gems/trailblazer-developer-0.0.12/lib/trailblazer/developer/generate.rb:20:in `block in <class:Activity>'
gems/declarative-0.0.10/lib/declarative/schema.rb:69:in `class_eval'
gems/declarative-0.0.10/lib/declarative/schema.rb:69:in `block (2 levels) in <module:DSL>'
gems/declarative-0.0.10/lib/declarative/schema.rb:67:in `initialize'
gems/declarative-0.0.10/lib/declarative/schema.rb:67:in `new'
gems/declarative-0.0.10/lib/declarative/schema.rb:67:in `block in <module:DSL>'
gems/declarative-0.0.10/lib/declarative/definitions.rb:71:in `build_nested'
gems/declarative-0.0.10/lib/declarative/definitions.rb:49:in `add'
gems/declarative-0.0.10/lib/declarative/schema.rb:55:in `build_definition'
gems/representable-3.0.4/lib/representable/cached.rb:6:in `build_definition'
gems/declarative-0.0.10/lib/declarative/schema.rb:25:in `property'
gems/representable-3.0.4/lib/representable/declarative.rb:10:in `collection'
gems/trailblazer-developer-0.0.12/lib/trailblazer/developer/generate.rb:17:in `<class:Activity>'
gems/trailblazer-developer-0.0.12/lib/trailblazer/developer/generate.rb:14:in `<module:Representer>'
gems/trailblazer-developer-0.0.12/lib/trailblazer/developer/generate.rb:13:in `<module:Generate>'
gems/trailblazer-developer-0.0.12/lib/trailblazer/developer/generate.rb:7:in `<module:Developer>'
gems/trailblazer-developer-0.0.12/lib/trailblazer/developer/generate.rb:5:in `<module:Trailblazer>'
gems/trailblazer-developer-0.0.12/lib/trailblazer/developer/generate.rb:4:in `<main>'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
gems/skylight-core-4.3.0/lib/skylight/core/probes.rb:118:in `require'
gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `block in require'
gems/activesupport-6.0.3/lib/active_support/dependencies.rb:291:in `load_dependency'
gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `require'
gems/trailblazer-developer-0.0.12/lib/trailblazer/developer.rb:15:in `<main>'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
gems/skylight-core-4.3.0/lib/skylight/core/probes.rb:118:in `require'
gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `block in require'
gems/activesupport-6.0.3/lib/active_support/dependencies.rb:291:in `load_dependency'
gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `require'
gems/trailblazer-operation-0.6.2/lib/trailblazer/operation.rb:70:in `<main>'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
gems/skylight-core-4.3.0/lib/skylight/core/probes.rb:118:in `require'
gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `block in require'
gems/activesupport-6.0.3/lib/active_support/dependencies.rb:291:in `load_dependency'
gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `require'
gems/trailblazer-2.1.0/lib/trailblazer.rb:2:in `<main>'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
gems/bundler-1.17.3/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
gems/bundler-1.17.3/lib/bundler/runtime.rb:76:in `each'
gems/bundler-1.17.3/lib/bundler/runtime.rb:76:in `block in require'
gems/bundler-1.17.3/lib/bundler/runtime.rb:65:in `each'
gems/bundler-1.17.3/lib/bundler/runtime.rb:65:in `require'
gems/bundler-1.17.3/lib/bundler.rb:114:in `require'
my_app/config/application.rb:9:in `<main>'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `block in require'
gems/activesupport-6.0.3/lib/active_support/dependencies.rb:291:in `load_dependency'
gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `require'
gems/railties-6.0.3/lib/rails/command/actions.rb:22:in `require_application!'
gems/railties-6.0.3/lib/rails/command/actions.rb:14:in `require_application_and_environment!'
gems/railties-6.0.3/lib/rails/commands/console/console_command.rb:101:in `perform'
gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
gems/railties-6.0.3/lib/rails/command/base.rb:69:in `perform'
gems/railties-6.0.3/lib/rails/command.rb:46:in `invoke'
gems/railties-6.0.3/lib/rails/commands.rb:18:in `<main>'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `block in require'
gems/activesupport-6.0.3/lib/active_support/dependencies.rb:291:in `load_dependency'
gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `require'
bin/rails:4:in `<main>'
apotonick commented 4 years ago

Hi James, thanks for digging! I've seen this warning too many times, I think it's time to fix it now! Thanks :beers:

4tolexx commented 1 year ago

Hi @apotonick! i don't know if you had finally had the time to fix the warning issue. we seem are having the same issue as well. thanks.