MLH-Fellowship / scheduling-profiler-prototype

Custom profiler prototype for React's concurrent mode
https://react-scheduling-profiler.vercel.app/
6 stars 0 forks source link

Reorganize layout and canvas folders #120

Closed taneliang closed 4 years ago

taneliang commented 4 years ago

Summary of changes:

  1. canvas folder:
    1. Renamed canvas folder to content-views, and inverted the views and the rest of the stuff in the old canvas folder. I think this makes more sense given that the canvas folder mainly stored views.
    2. Deleted dead canvas utils and inline those that are only used once. Moved the remaining positioning utils into a utils/positioning.ts file.
    3. Canvas constants:
      1. Kill almost all dead canvas constants. I didn't clear all canvas colors, and I also didn't remove LABEL_FONT_SIZE since we'll likely need it in #73.
      2. Inline computed constants.
      3. Renamed a few constants that had names that no longer corresponded to how they were actually used.
      4. Move constants used by HorizontalPanAndZoomView and VerticalScrollView into the layout folder.
  2. layout folder:
    1. Renamed layout folder to view-base.
    2. Move useCanvasInteraction into the new view-base folder.

The new view-base code no longer depends on any external code apart from react and memoize-one :tada:

Resolves #54.

May conflict with #113, but since that only changes 9 lines it'll be easy to rebase that onto this PR. The COLORS constants are now in src/content-views/constants.ts.

Unblocks work on tests.

Test Plan

vercel[bot] commented 4 years ago

This pull request is being automatically deployed with Vercel (learn more). To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/mlh-fellowship/scheduling-profiler-prototype/866deqj72 ✅ Preview: https://scheduling-profiler-prototype-git-eliang-reorg-canvas.mlh-fellowship.vercel.app