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

Merged
merged 13 commits into from
Jan 16, 2025
Merged

refactor: shuffle functions #643

merged 13 commits into from
Jan 16, 2025

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 force-pushed the pascal/refactor branch 2 times, most recently from 6dd050f to 3606c59 Compare January 3, 2025 09:54
@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
Copy link
Contributor

@ChibiBlasphem ChibiBlasphem left a comment

Choose a reason for hiding this comment

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

LGTM, that's a great work. I really like how you separated concerns.

@Pascal-Delange Pascal-Delange merged commit f88d5a5 into main Jan 16, 2025
3 checks passed
@Pascal-Delange Pascal-Delange deleted the pascal/refactor branch January 16, 2025 08:45
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