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

refactor(json): Remove expression-eval dependency #9070

Merged
merged 4 commits into from
Aug 21, 2024

Conversation

donmccurdy
Copy link
Collaborator

The expression-eval dependency was deprecated in mid-2023. (Disclaimer: I'm the previous maintainer of this dependency). Much of the original code was originally from jsep, included in their codebase as part of the test suite but not as a public API. I've been informed that the deprecated expression-eval dependency, and particularly its lack of a package.json#exports field, is causing an issue for some Pydeck users.

Maintained forks of expression-eval exist, but I have misgivings about using these forks, or creating a new public fork. I'll share details about this elsewhere, with deckgl maintainers.

Instead, I would suggest that we simply inline the code, for internal use by @deck.gl/json. In this PR I've made very light modifications to make stricter TypeScript checks pass, otherwise everything is the same as the last-published version. We're not using the async evaluation feature – that could be removed in a future PR, to considerably simplify the inlined code.

@coveralls
Copy link

coveralls commented Aug 2, 2024

Coverage Status

coverage: 89.221% (+0.03%) from 89.196%
when pulling 8835f8a on donmccurdy/refactor-json-remove-expression-eval
into beedfad on master.

Copy link
Collaborator

@ibgreen ibgreen left a comment

Choose a reason for hiding this comment

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

LGTM

@Pessimistress
Copy link
Collaborator

Is there any tests you can port over as well?

@donmccurdy
Copy link
Collaborator Author

Yes, unit tests here:

https://github.com/donmccurdy/expression-eval/blob/main/test.js

I'm out of office for the next two weeks, so it'll be a bit before I can move those.

@donmccurdy
Copy link
Collaborator Author

Unit tests are now included. ✅

@donmccurdy donmccurdy merged commit bf7b002 into master Aug 21, 2024
4 checks passed
@donmccurdy donmccurdy deleted the donmccurdy/refactor-json-remove-expression-eval branch August 21, 2024 10:22
donmccurdy added a commit that referenced this pull request Oct 8, 2024
* refactor(json): Remove expression-eval dependency
* chore(json): Add tests for expression-eval
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.

4 participants