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

More flexibility in function targetting #7

Open
deBhal opened this issue Feb 12, 2016 · 0 comments
Open

More flexibility in function targetting #7

deBhal opened this issue Feb 12, 2016 · 0 comments

Comments

@deBhal
Copy link
Contributor

deBhal commented Feb 12, 2016

One of the strengths of xgettext-js is that it does one thing well, namely finding functions that match a pattern.

However, javascript moves fast, and there are some odd issues that have cropped up and will likely continue to crop up.

For example, pr #6 addresses an issue caused by an odd quirk in transpiling es6 module syntax in babel. This is a very specific and temporary problem, and arguably does not belong in xgettext-js. Luckily, the solution for is benign enough that there's very little downside to including the fix in xgettext-js itself, but we might not be so lucky in the future.

What we need to avoid this problem in the future is something to allow us to intervene before the matching logic does it's work.

There are a range of options trading off flexibility for complexity. #6 would have been solvable with a relatively simple hook to preprocess just the CallExpression itself before xgettext-js tries to match against it, which might be a good place to start.

Hooks like that could also be used for some pretty cool things, like composable filters - if the node matches some criteria, don't pass it on.

This is all pretty low priority speculation that should probably be driven by real needs rather than "just in case". We don't actually have a use case for filtering right now, for example. It would be cool, but not useful.

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

No branches or pull requests

1 participant