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

Convert Extract to TypeScript #6381

Merged
merged 6 commits into from
Feb 11, 2020
Merged

Convert Extract to TypeScript #6381

merged 6 commits into from
Feb 11, 2020

Conversation

Zyie
Copy link
Member

@Zyie Zyie commented Feb 3, 2020

Description of change
Pre-Merge Checklist
  • Tests and/or benchmarks are included
  • Documentation is changed or added
  • Lint process passed (npm run lint)
  • Tests passed (npm run test)

@codecov-io
Copy link

codecov-io commented Feb 3, 2020

Codecov Report

Merging #6381 into dev will increase coverage by 0.06%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##             dev    #6381      +/-   ##
=========================================
+ Coverage   76.7%   76.76%   +0.06%     
=========================================
  Files         76       70       -6     
  Lines       4142     4028     -114     
=========================================
- Hits        3177     3092      -85     
+ Misses       965      936      -29
Impacted Files Coverage Δ
...nvas/canvas-graphics/src/CanvasGraphicsRenderer.js 33.7% <56.75%> (+6.13%) ⬆️
packages/canvas/canvas-renderer/src/canvasUtils.js 40.2% <92.85%> (+37.85%) ⬆️

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 41be0fe...d99c8b0. Read the comment docs.

@bigtimebuddy bigtimebuddy added this to the v5.3.0 milestone Feb 3, 2020
Copy link
Collaborator

@ivanpopelyshev ivanpopelyshev left a comment

Choose a reason for hiding this comment

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

ez.

@bigtimebuddy
Copy link
Member

Do you think it makes sense to create a IRendererPlugin interface that Extract, Prepare, etc that they can all implement? This would basically just take renderer as a single constructor argument. Not sure if there are any other methods called by Renderer. I like hardening plugin types for users to implement to.

@Zyie
Copy link
Member Author

Zyie commented Feb 3, 2020

Do you think it makes sense to create a IRendererPlugin interface that Extract, Prepare, etc that they can all implement? This would basically just take renderer as a single constructor argument. Not sure if there are any other methods called by Renderer. I like hardening plugin types for users to implement to.

I didn't think it was possible to implement an interface that defines a constructor? Could you point to an example for me.

We could create a base class that plugins extend from if an interface doesn't work?

@bigtimebuddy
Copy link
Member

bigtimebuddy commented Feb 3, 2020

Would probably look something like this:

interface IRendererPluginConstructor {
  new (renderer: Renderer): IRendererPlugin;
}

interface IRendererPlugin {
  destroy(): void;
}

So the Renderer here would be:

static registerPlugin(pluginName: string, ctor: IRendererPluginConstructor): void

@bigtimebuddy
Copy link
Member

Is this good to go, @Zyie? Was there something else you wanted to do?

@Zyie
Copy link
Member Author

Zyie commented Feb 10, 2020

Is this good to go, @Zyie? Was there something else you wanted to do?

Sorry got super busy last week. Just updated this to add the IRendererPlugin like you suggested.

So this is now good to go

@Zyie Zyie marked this pull request as ready for review February 10, 2020 21:33
@bigtimebuddy bigtimebuddy merged commit 6491fb6 into dev Feb 11, 2020
@bigtimebuddy bigtimebuddy deleted the dev-extract-typescript branch February 11, 2020 03:50
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

4 participants