{"record":{"id":"b798e4341864c60d","repo":"Shopify/liquid","slug":"deprecation-name-is-deprecated-use-alterna","errorCode":null,"errorMessage":"[DEPRECATION] #{name} is deprecated. Use #{alternative} instead. Called from #{caller_location}\\n","messagePattern":"\\[DEPRECATION\\] #(.+?) is deprecated\\. Use #(.+?) instead\\. Called from #(.+?)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"lib/liquid/deprecations.rb","lineNumber":18,"sourceCode":"# frozen_string_literal: true\n\nrequire \"set\"\n\nmodule Liquid\n  class Deprecations\n    class << self\n      attr_accessor :warned\n\n      Deprecations.warned = Set.new\n\n      def warn(name, alternative)\n        return if warned.include?(name)\n\n        warned << name\n\n        caller_location = caller_locations(2, 1).first\n        Warning.warn(\"[DEPRECATION] #{name} is deprecated. Use #{alternative} instead. Called from #{caller_location}\\n\")\n      end\n    end\n  end\nend\n","sourceCodeStart":1,"sourceCodeEnd":23,"githubUrl":"https://github.com/Shopify/liquid/blob/807d45a6b3d4568e64e86b375e3702df2c7c860c/lib/liquid/deprecations.rb#L1-L23","documentation":"Liquid::Deprecations.warn is the internal deprecation reporting helper: it records the deprecated name once per process and writes a [DEPRECATION] line to Warning.warn naming the replacement and the caller location. Seeing this message means the code path taken uses a deprecated Liquid API that will be removed in a future release.","triggerScenarios":"Any deprecated Liquid API call, e.g. Template.error_mode=, Template.file_system=, Template.register_tag/register_filter, Template.default_* setters, Condition#evaluate without context, :rigid error mode — each forwards through this warn.","commonSituations":"App or gem initializers written against pre-Environment Liquid APIs; test suites surfacing warnings only when run with -W or a custom Warning handler.","solutions":["Follow the message's 'Use X instead' guidance and migrate to the Environment API","Call each deprecated API at most once or filter warnings, since the message is emitted once per name per process","Route Warning.warn to your logger to inventory which deprecated calls fire at boot"],"exampleFix":"// before\nLiquid::Template.register_tag('mytag', MyTag)\n// after\nLiquid::Environment.default.register_tag('mytag', MyTag)","handlingStrategy":"fallback","validationCode":"Liquid::Warning.method(:warn) # route to logger to inventory deprecated calls","typeGuard":null,"tryCatchPattern":"# custom warning handler\ndef MyLogger.warn(msg)\n  Rails.logger.warn(msg) if msg.include?('[DEPRECATION]')\nend","preventionTips":["Override Warning.warn in boot to log and deduplicate Liquid deprecations","Migrate to the Environment API for all global configuration","Track the Liquid CHANGELOG when bumping the gem version"],"tags":["ruby","liquid","deprecation"],"backgroundTag":"deprecated-api-usage","analyzedSha":"807d45a6b3d4568e64e86b375e3702df2c7c860c","analyzedAt":"2026-09-08T11:31:38.917Z","contentChangedAt":"2026-09-08T11:31:38.917Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}