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

Directly depend on global variables store in expression stores #1084

Merged
merged 3 commits into from
Jan 2, 2025

Conversation

shueja
Copy link
Collaborator

@shueja shueja commented Dec 31, 2024

I don't like having to do this, but we were already injecting this instance into every ExpressionStore through Variables.createExpression. (See former line 590 in ExpressionStore.tsx)

Unfortunately, undoing an operation that deletes an ExpressionStore (through deleting a waypoint, constraint, etc) does not use createExpression, so restored ExpressionStores did not get the injection. This worked in most cases because the Variables instance was injected two different ways, but only when the store was created after the Variables instance was created. In short, the existing system is fragile and puts annoying constraints on initialization order just to avoid a direct import as a way to access a global constant.

@shueja shueja added this to the 2025-kickoff milestone Jan 1, 2025
@shueja shueja merged commit 19f688e into SleipnirGroup:main Jan 2, 2025
33 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.

1 participant