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

Make the filter name configurable independently of the attributes #204

Merged
merged 1 commit into from
Mar 19, 2020
Merged

Make the filter name configurable independently of the attributes #204

merged 1 commit into from
Mar 19, 2020

Conversation

cmlenz
Copy link
Contributor

@cmlenz cmlenz commented Mar 18, 2020

We had a case where we needed to use a custom filter, but continue to use the regular angular-gettext directive. So we need to configure the filter name independently of the attributes. This PR does that.

Projects using a custom attribute and filter will need to set the filterName option accordingly, so this is a breaking changes.

@rubenv
Copy link
Owner

rubenv commented Mar 18, 2020

Projects using a custom attribute and filter will need to set the filterName option accordingly, so this is a breaking changes.

That makes it pretty much a no-no. No breaking changes allowed anymore.

Is there any way to make this non-breaking?

Copy link
Owner

@rubenv rubenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, in the interest of preventing regressions, you should never edit existing unit tests. Only add new ones. This ensures that existing code keeps working.

@cmlenz
Copy link
Contributor Author

cmlenz commented Mar 18, 2020

Oh, I didn't expect you were still reviewing the PRs here. I created it more for the record. Sorry.

If there's a chance that changes still get integrated, I would put more work into the PR to make it a non-breaking change.

@rubenv
Copy link
Owner

rubenv commented Mar 18, 2020

If it's purely additive and non-breaking, sure, why not.

@cmlenz
Copy link
Contributor Author

cmlenz commented Mar 18, 2020

I have updated the PR to make this a non-breaking change as requested.

If you don't specify the new filterName option, the extractor will continue to use options.attribute just like before. It's only when options.filterName is set that it will be used instead.

Also, I have added new tests instead of changing the existing ones.

Copy link
Owner

@rubenv rubenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, thanks a lot!

@rubenv rubenv merged commit 3ffe27c into rubenv:master Mar 19, 2020
@rubenv
Copy link
Owner

rubenv commented Mar 19, 2020

Released to NPM as v2.5.2

@cmlenz
Copy link
Contributor Author

cmlenz commented Mar 19, 2020

Thank you for the very quick release!

@cmlenz cmlenz deleted the feature/filter-name branch March 19, 2020 12:44
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

Successfully merging this pull request may close these issues.

None yet

2 participants