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: Clean up the Style compiler #817

Merged
merged 14 commits into from Jan 12, 2022
Merged

refactor: Clean up the Style compiler #817

merged 14 commits into from Jan 12, 2022

Conversation

samestep
Copy link
Collaborator

@samestep samestep commented Jan 11, 2022

Description

This PR cleans up compiler/Style:

  • Make nameAnonBlock linear time
  • Eliminate all ESLint warnings
  • Remove a lot of throws via switch instead of if/else, and also better typing
  • Add zip2 and zip3 utils to replace poorly-typed usages of _.zip
  • Remove unused findSubstsProg

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new ESLint warnings

Open questions

  • There are still several quadratic-time things that should really be linear-time (mostly using concat)
  • There are still a few places where we throw "unknown tag" errors that we should clean up

@cloudflare-pages
Copy link

cloudflare-pages bot commented Jan 11, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 816647d
Status: ✅  Deploy successful!
Preview URL: https://241a6068.penrose-panes.pages.dev

View logs

@codecov
Copy link

codecov bot commented Jan 11, 2022

Codecov Report

Merging #817 (816647d) into main (7552b75) will increase coverage by 0.05%.
The diff coverage is 79.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #817      +/-   ##
==========================================
+ Coverage   67.81%   67.86%   +0.05%     
==========================================
  Files          61       61              
  Lines        7643     7640       -3     
  Branches     1378     1375       -3     
==========================================
+ Hits         5183     5185       +2     
+ Misses       2451     2445       -6     
- Partials        9       10       +1     
Impacted Files Coverage Δ
packages/core/src/compiler/Style.ts 86.51% <79.12%> (+0.32%) ⬆️
packages/core/src/engine/Optimizer.ts 81.25% <83.33%> (ø)
packages/core/src/utils/Util.ts 66.17% <87.50%> (+1.34%) ⬆️
packages/core/src/compiler/Substance.ts 91.22% <100.00%> (+0.02%) ⬆️
packages/core/src/engine/Evaluator.ts 64.75% <100.00%> (ø)
packages/core/src/renderer/Resample.ts 24.07% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7552b75...816647d. Read the comment docs.

@samestep samestep changed the title refactor: Improve Style compiler refactor: Clean up the Style compiler Jan 12, 2022
@samestep samestep requested a review from wodeni January 12, 2022 17:11
@samestep samestep marked this pull request as ready for review January 12, 2022 17:11
@samestep samestep merged commit fb7783d into main Jan 12, 2022
@samestep samestep deleted the improve-style-compiler branch January 12, 2022 18:16
@samestep samestep mentioned this pull request Jan 19, 2022
2 tasks
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.

None yet

2 participants