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

various cleanup chores in the editor #136

Merged
merged 19 commits into from
Jul 30, 2021
Merged

various cleanup chores in the editor #136

merged 19 commits into from
Jul 30, 2021

Conversation

nvdk
Copy link
Member

@nvdk nvdk commented Jul 23, 2021

  • convert ContentEditable component to glimmer
  • convert ContentEditable component to typescript
  • upgrade ember-concurrency
  • convert RdfaEditor component to glimmer
  • convert RdfaEditor component to typescript

@nvdk nvdk requested review from abeforgit and RobbeDP July 23, 2021 10:21
@nvdk
Copy link
Member Author

nvdk commented Jul 23, 2021

somewhat coincidentally this also fixes https://binnenland.atlassian.net/browse/GN-2318

@nvdk nvdk added the internal Version bumps, chores, tooling label Jul 23, 2021
*/
@tracked editor;
@tracked editor?: PernetRawEditor;
Copy link
Contributor

@RobbeDP RobbeDP Jul 23, 2021

Choose a reason for hiding this comment

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

since this can now be undefined, there need to be some extra undefined checks when editor is accessed

Copy link
Member

Choose a reason for hiding this comment

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

one option is a getter that throws when editor is null (nothing should try to run before editor is initialized, this may also alert us to some initialization bugs we were having)
if that generates too many problems, simply asserting this is non-null (@tracked editor!: PernetRawEditor) is also an option, though we should avoid that if possible

Copy link
Contributor

Choose a reason for hiding this comment

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

such a getter should also be added in rdfa-editor.ts, since we have the same problem here as in content-editable.ts

Copy link
Member Author

@nvdk nvdk Jul 28, 2021

Choose a reason for hiding this comment

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

that won't work there though, since the editor is used in the template before init. all usages do check if editor is null though so less use to do so there

Copy link
Member

@abeforgit abeforgit left a comment

Choose a reason for hiding this comment

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

Love this, typescript ahoi!

*/
@tracked editor;
@tracked editor?: PernetRawEditor;
Copy link
Member

Choose a reason for hiding this comment

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

one option is a getter that throws when editor is null (nothing should try to run before editor is initialized, this may also alert us to some initialization bugs we were having)
if that generates too many problems, simply asserting this is non-null (@tracked editor!: PernetRawEditor) is also an option, though we should avoid that if possible

if (this.profile != this.eventProcessor.profile) {
@action
updateProfile() {
if (this.eventProcessor && this.profile != this.eventProcessor.profile) {
Copy link
Member

Choose a reason for hiding this comment

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

might be worth going through and making sure we use triple equals everywhere (kinda surprised and slightly alarmed this doesn't trigger the linter)

Copy link
Member Author

Choose a reason for hiding this comment

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

that would be a lot of linter errors:

nielsv@smallbox ~/Code/say-editor/ember-rdfa-editor $ grep -r ' == ' addon/ | wc -l
164
nielsv@smallbox ~/Code/say-editor/ember-rdfa-editor $ grep -r ' != ' addon/ | wc -l
27

@abeforgit
Copy link
Member

@nvdk WARNING: base branch master

@nvdk nvdk changed the base branch from master to development July 27, 2021 07:09
addon/components/ce/content-editable.ts Outdated Show resolved Hide resolved
addon/components/ce/content-editable.ts Outdated Show resolved Hide resolved
addon/components/ce/content-editable.ts Show resolved Hide resolved
*/
@tracked editor;
@tracked editor?: PernetRawEditor;
Copy link
Contributor

Choose a reason for hiding this comment

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

such a getter should also be added in rdfa-editor.ts, since we have the same problem here as in content-editable.ts

@nvdk
Copy link
Member Author

nvdk commented Jul 29, 2021

@abeforgit shall I merge?

@nvdk nvdk merged commit 25d9fba into development Jul 30, 2021
@nvdk nvdk deleted the chore/cleanup branch July 30, 2021 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Version bumps, chores, tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants