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

Add anticheck for not detecting TLA in injected code #12

Merged
merged 7 commits into from
Oct 23, 2024

Conversation

perbergland
Copy link

@perbergland perbergland commented Oct 22, 2024

Adding specific check for #11 so that the await visitor ignores reify’s own injected code.

Also fixing run.sh to use npx (picking up mocha from node_modules instead of an expected global install) and adding support for MOCHA_GREP for quicker local development.

Added a unit test, the bug only happens when reify is used via the babel plugin wrapper.

@perbergland perbergland changed the title Add workaround for #11 Add workaround for TLA detection of injected code Oct 22, 2024
@perbergland
Copy link
Author

perbergland commented Oct 22, 2024

@zodern if you have any ideas on how to write a unit test in this repo that can reproduce the issue, that would be great. I don’t understand the real root cause yet.

Update: no need, I figured it out

@perbergland
Copy link
Author

I understand the code better now and added a unit tests in the test/babel-plugin-tests.js file.

The code that inserts the await reifyWaitForDeps() is run in the "enter" phase of the plugin and the TLA detection happens later, in the "exit" phase so the code change is not just a hack but a bona fide check that needs to be there.

@perbergland perbergland changed the title Add workaround for TLA detection of injected code Add anticheck for not detecting TLA in injected code Oct 22, 2024
@leonardoventurini leonardoventurini merged commit f59788d into meteor:main Oct 23, 2024
6 checks passed
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.

2 participants