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

TypeScript: Convert utils folder #12740

Closed
barklund opened this issue Nov 28, 2022 · 2 comments · Fixed by #12737
Closed

TypeScript: Convert utils folder #12740

barklund opened this issue Nov 28, 2022 · 2 comments · Fixed by #12737
Assignees
Labels
P2 Should do soon Type: Code Quality Things that need a refactor, rewrite or just some good old developer ❤️ Type: Enhancement New feature or improvement of an existing feature

Comments

@barklund
Copy link
Contributor

barklund commented Nov 28, 2022

Feature Description

Most of the utility functions inside the story-editor package are isolated and only dependent on other already-converted packages. However, many providers inside the story-editor package depend on utilities and can't easily be converted unless their utilities are done so as well.

There are a few exceptions to the above though:

  • contrastUtils depend on the external library @ap.cx/hues which does not appear to be typed or have types available
  • getUpdatedSizeAndPosition and presetUtils depend on un-converted functions inside the element-library package
  • storyPageToCanvas and storyPageToDataUrl depend on storyPageToNode, and
  • storyPageToNode depends on the font provider and the canvas component
  • useAddPreset depends on the story provider
  • useApplyTextAutoStyle depends on the pageCanvas provider and the style panel component
  • useCORSProxy depends on the api provider
  • useElementPolygon depends on the story and canvas providers
  • useElementWithLink depends on the story and canvas providers
  • useIsUploadingToStory depends on the story and localMedia providers
  • useShapeMask depends on the story and canvas providers
  • useShapeMaskElements depends on the story provider

These functions should be moved to their respective providers (mostly to live inside the story provider) and or other relevant parts of the codebase, or their dependency types should be mocked.

@barklund barklund added the Type: Enhancement New feature or improvement of an existing feature label Nov 28, 2022
@barklund barklund self-assigned this Nov 28, 2022
@swissspidy
Copy link
Collaborator

@barklund Coordinate with @spacedmonkey who started converting some utils in #12737

@barklund
Copy link
Contributor Author

@barklund Coordinate with @spacedmonkey who started converting some utils in #12737

Oh, I tried searching for a matching ticket and didn't find this one. My bad. I'll coordinate.

@barklund barklund assigned spacedmonkey and unassigned barklund Nov 28, 2022
@barklund barklund added Type: Code Quality Things that need a refactor, rewrite or just some good old developer ❤️ Pod: Prometheus P2 Should do soon labels Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Should do soon Type: Code Quality Things that need a refactor, rewrite or just some good old developer ❤️ Type: Enhancement New feature or improvement of an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants