-
-
Notifications
You must be signed in to change notification settings - Fork 264
feat(filters): Add base64_encode and base64_decode filters for Shopify compatibility #828
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
Conversation
Pull Request Test Coverage Report for Build 18834524874Details
💛 - Coveralls |
|
atob doesn’t work for non alphabetic characters. Let’s stick with your original solution. |
|
@rosomri thanks for the effort! |
|
@harttle happy to contribute whenever needed! |
|
@all-contributors please add @rosomri for code |
|
I've put up a pull request to add @rosomri! 🎉 |
# [10.24.0](v10.23.0...v10.24.0) (2025-10-27) ### Features * **filters:** Add base64_encode and base64_decode filters for Shopify compatibility ([#828](#828)) ([86fc135](86fc135))
|
🎉 This PR is included in version 10.24.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
…JS implementation (#240862) ### PR Description We previously implemented custom base64 filters as a workaround when LiquidJS didn't have native base64 support. After [contributing these filters to the LiquidJS open source project](harttle/liquidjs#828), they are now available natively in v10.24.0, making our custom implementation redundant. ### Changes - Updated LiquidJS dependency from v10.22.0 to v10.24.0 - Removed custom base64 filters and related tests --------- Co-authored-by: kibanamachine <[email protected]>
…JS implementation (elastic#240862) ### PR Description We previously implemented custom base64 filters as a workaround when LiquidJS didn't have native base64 support. After [contributing these filters to the LiquidJS open source project](harttle/liquidjs#828), they are now available natively in v10.24.0, making our custom implementation redundant. ### Changes - Updated LiquidJS dependency from v10.22.0 to v10.24.0 - Removed custom base64 filters and related tests --------- Co-authored-by: kibanamachine <[email protected]>
…JS implementation (elastic#240862) ### PR Description We previously implemented custom base64 filters as a workaround when LiquidJS didn't have native base64 support. After [contributing these filters to the LiquidJS open source project](harttle/liquidjs#828), they are now available natively in v10.24.0, making our custom implementation redundant. ### Changes - Updated LiquidJS dependency from v10.22.0 to v10.24.0 - Removed custom base64 filters and related tests --------- Co-authored-by: kibanamachine <[email protected]>
…JS implementation (elastic#240862) ### PR Description We previously implemented custom base64 filters as a workaround when LiquidJS didn't have native base64 support. After [contributing these filters to the LiquidJS open source project](harttle/liquidjs#828), they are now available natively in v10.24.0, making our custom implementation redundant. ### Changes - Updated LiquidJS dependency from v10.22.0 to v10.24.0 - Removed custom base64 filters and related tests --------- Co-authored-by: kibanamachine <[email protected]>
Summary
This PR adds two standard Shopify filters (
base64_encodeandbase64_decode) to LiquidJS core to improve Shopify compatibility. These filters are part of the standard Shopify Liquid filter set but were not previously implemented in LiquidJS.#827
Changes
base64_encodeandbase64_decodefilters with full Shopify compatibilityBuffer.from()for optimal performancebtoa/atobwith proper Unicode handlingImplementation Details
src/filters/base64.ts- Main filter implementationsrc/filters/base64-impl.ts- Node.js implementation using Buffersrc/build/base64-impl-browser.ts- Browser implementation using btoa/atobtest/integration/filters/base64.spec.ts- Integration testssrc/build/base64-impl-browser.spec.ts- Browser-specific unit testsrollup.config.mjswith platform-specific bundlingShopify Compatibility
{{ 'one two three' | base64_encode }}→b25lIHR3byB0aHJlZQ==Testing
Breaking Changes
None