Skip to content

feat: add unregisterFilter method - #946

Merged
harttle merged 2 commits into
harttle:masterfrom
YacovGold:feat/unregister-filter
Aug 11, 2026
Merged

feat: add unregisterFilter method#946
harttle merged 2 commits into
harttle:masterfrom
YacovGold:feat/unregister-filter

Conversation

@YacovGold

Copy link
Copy Markdown
Contributor

Summary

  • Add Liquid#unregisterFilter(name)
  • Support removing custom and built-in filters
  • Allow filters to be registered again after removal
  • Document restoring built-in filters through the exported filters object
  • Document behavior with strictFilters

Motivation

This provides a supported API for removing filters without directly modifying the filter registry.

When strictFilters is disabled, an unregistered filter is skipped. When enabled, using it throws an undefined-filter error. Unregistering an unknown
filter is a no-op.

Built-in filters can be restored using the existing registerFilter() API:

import { filters } from 'liquidjs'

engine.registerFilter('plus', filters.plus)

@harttle
harttle merged commit 69b2c58 into harttle:master Aug 11, 2026
14 checks passed
@harttle

harttle commented Aug 11, 2026

Copy link
Copy Markdown
Owner

@all-contributors please add @YacovGold for code

@allcontributors

Copy link
Copy Markdown
Contributor

@harttle

I've put up a pull request to add @YacovGold! 🎉

@YacovGold
YacovGold deleted the feat/unregister-filter branch August 11, 2026 12:31
github-actions Bot pushed a commit that referenced this pull request Aug 11, 2026
# [10.29.0](v10.28.0...v10.29.0) (2026-08-11)

### Features

* add unregisterFilter method ([#946](#946)) ([69b2c58](69b2c58))
* **filters:** add squish filter ([#943](#943)) ([875513f](875513f))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 10.29.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants