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

Migrate CKEditor 5 to TypeScript - follow-ups #12027

Closed
11 of 12 tasks
arkflpc opened this issue Jul 7, 2022 · 8 comments
Closed
11 of 12 tasks

Migrate CKEditor 5 to TypeScript - follow-ups #12027

arkflpc opened this issue Jul 7, 2022 · 8 comments
Labels
domain:ts Epic resolution:expired This issue was closed due to lack of feedback. squad:core Issue to be handled by the Core team.

Comments

@arkflpc
Copy link
Contributor

arkflpc commented Jul 7, 2022

This issue serves as an umbrella for all the tasks that need to be done after migrating the project to TypeScript, including bug fixes, code refactoring, and feature enhancements.

Additionally, this issue is also a platform for the community to share their feedback and suggestions regarding the TypeScript migration.

Tasks

Community Feedback

We encourage the community to share their feedback and suggestions regarding the TypeScript migration. If you encounter any bugs or issues related to the migration, please report them here. We value your feedback and will use it to improve the quality of the project. Thank you for your support and contribution.

@arkflpc arkflpc added type:task This issue reports a chore (non-production change) and other types of "todos". Epic squad:core Issue to be handled by the Core team. domain:ts and removed type:task This issue reports a chore (non-production change) and other types of "todos". labels Jul 7, 2022
@Reinmar Reinmar changed the title Migrate CKEditor 5 to TypeScript Followup Migrate CKEditor 5 to TypeScript followups Jul 7, 2022
@CKEditorBot CKEditorBot added status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. and removed status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. labels Jul 19, 2022
@CKEditorBot CKEditorBot added the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Aug 31, 2022
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Jan 19, 2023
@Witoso Witoso changed the title Migrate CKEditor 5 to TypeScript followups Migrate CKEditor 5 to TypeScript - follow-ups Apr 4, 2023
mmichaelis added a commit to CoreMedia/ckeditor-plugins that referenced this issue Apr 12, 2023
In ckeditor/ckeditor5#12027, CKSource collects feedback
regarding TypeScript upgrade as shipped with CKEditor 37.x.
Added some references to the issue and provided feedback
to affected code.
@mmichaelis
Copy link

Replace "export type" by "export" in index.ts

We are just at upgrading to CKEditor 37.x, thankfully being able to incorporate your TypeScript typings!

We stumbled across some "export type", though, in index.ts, where we require a full export. From discussion, our perception is, that index.ts is the "declared public API" and direct imports like from imageinline should be prevented – but are the only workaround for us now.

We would require the following to be full exports instead:

export type { default as ImageInline } from './imageinline';

export type { default as ImageUtils } from './imageutils';

export type { default as ImageBlockEditing } from './image/imageblockediting';

We may provide details, why we need these. For ImageInline, for example, we do not support ImageBlock, so that we directly need to reference ImageInline instead of the aggregator Image.

Add to index.ts

And the following, we would like to be exported in the corresponding index.ts:

export default class CommandCollection implements Iterable<[ string, Command ]> {

export default class LinkActionsView extends View {

export default class LinkFormView extends View {

export default class ClassicEditorUIView extends BoxedEditorUIView {

Same as above, we may provide details, why we require them, so that we may discuss alternative paths we could take.

For Reference: Our Usages

We added a comment to our upgrade PR to reference issues reported here: CoreMedia/ckeditor-plugins#145 (e.g., CoreMedia/ckeditor-plugins@55200cb).

Similar to:

// See ckeditor/ckeditor5#12027.

So, you may see, for example, that we only require CommandCollection on integration test level. Thus, it may be completely valid to state, that it should not go into index.ts just for this purpose.

@Witoso
Copy link
Member

Witoso commented Apr 12, 2023

@mmichaelis we appreciate the feedback! We will review it here: #13864

@CKEditorBot CKEditorBot added the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Apr 13, 2023
@mmichaelis
Copy link

Just created another issue in this context:

@CKEditorBot CKEditorBot added status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. and removed status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. labels Apr 20, 2023
@Inviz
Copy link
Contributor

Inviz commented May 5, 2023

Cant find a way to import ViewTreeWalker from engine. Having to use ReturnType<ViewPosition['getWalker']> for now

@Inviz
Copy link
Contributor

Inviz commented May 5, 2023

Also please add inferred types for event listeners. It's backwards now, type has to be provided and that validates the event name. Currently, i can not import types like ViewDocumentCopyEvent for example to listen to event.

@arkflpc
Copy link
Contributor Author

arkflpc commented May 15, 2023

Hi @Inviz ,

I've created a ticket to provide ViewTreeWalker (#14158).

Regarding the events: You can import ViewDocumentCopyEvent from ckeditor5-clipboard. I.e.

import { ViewDocumentCopyEvent } from '@ckeditor/ckeditor5-clipboard'

We tried to provide automatic type inference for event listeners, like lib.dom.d.ts do. However, it turned out to be very difficult with the event system we have in ckeditor5. The option to refactor events was out-of-scope, because almost everything relies on this. If you are interested in solutions we tried, please read this comment.

@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Jul 16, 2023
@CKEditorBot
Copy link
Collaborator

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

@CKEditorBot
Copy link
Collaborator

We've closed your issue due to inactivity. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).

@CKEditorBot CKEditorBot added resolution:expired This issue was closed due to lack of feedback. and removed status:stale labels Jun 15, 2024
@CKEditorBot CKEditorBot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:ts Epic resolution:expired This issue was closed due to lack of feedback. squad:core Issue to be handled by the Core team.
Projects
None yet
Development

No branches or pull requests

5 participants