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: shuffle functions #643

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

refactor: shuffle functions #643

wants to merge 4 commits into from

Conversation

Pascal-Delange
Copy link
Contributor

@Pascal-Delange Pascal-Delange commented Jan 2, 2025

Context

First half of a refactor I wanted to do on the models for ast nodes & operators.
The diff is likely a bit hard to read - try to read it commit by commit if you must.
I'm mostly doing two things here. Before this PR, there were two fairly large models files: packages/app-builder/src/models/ast-node.ts and packages/app-builder/src/models/editable-operators.ts.

Things I'm trying to improve

  • The former was 700+ lines long, without clear hierarchy, and contained the interfaces and helper functions for all the types of ast nodes we are manipulating. It was just hard to deal with due to its size and lack of structure.
  • The latter was annoying me more, because it contained a mix of logic related to actual "ast operators" (nodes in our AST), to "modale operators" (selectors of things like aggregation filters that are not AST nodes), interfaces and helper functions related to the "AST structure" in our builder, and display logic (translations) of all of the above.
  • (I also deleted a whole file, whose logic had been refactored elsewhere but where dead code remained, see packages/app-builder/src/components/Decisions/RulesExecutions/RuleExecutionDetail.tsx)

Up next

This PR only moves things around, to try to make the file structure make more sense by separating things that should be separate. This is only half of what I wanted to do, and the other half where I actually change logic will follow in another PR (else it would be really impossible to properly read).
Continued in #646

@Pascal-Delange Pascal-Delange requested a review from a team January 3, 2025 20:40
@Pascal-Delange Pascal-Delange marked this pull request as ready for review January 3, 2025 20:40
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