Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Refactor new->edit transition to avoid editor re-renders #949

Merged

Conversation

kevinansfield
Copy link
Collaborator

@kevinansfield kevinansfield commented Jan 16, 2018

closes TryGhost/Ghost#8287
closes TryGhost/Ghost#8750

  • moved all editor model functionality into the new editor route+controller
  • moved editor template from editor/edit.hbs to editor.hbs
  • refactored editor controller and the editor.new/editor.edit routes to work with a persistent editor rather than a teardown/re-render when transitioning from new->edit
  • fixed issue in {{gh-markdown-editor}} for autofocus behaviour when the component isn't re-rendered
  • fixed issue in {{gh-simplemde}} that was causing multiple updates to the value property when a new value is passed in to the component
  • added {{gh-scheduled-post-countdown}} component to lower the noise in the editor controller
  • removed editor route/controller mixins
  • removed the editor.edit and editor.new controllers

TODOs

  • re-implement loading behaviour for the edit route

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 71.637% when pulling 39a2040 on kevinansfield:refactor-new-edit-transition into 8b3c92e on TryGhost:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.003%) to 71.655% when pulling afbb4d5 on kevinansfield:refactor-new-edit-transition into 8b3c92e on TryGhost:master.

@kevinansfield kevinansfield changed the title [WIP] Refactor new->edit transition to avoid editor re-renders Refactor new->edit transition to avoid editor re-renders Jan 16, 2018
closes TryGhost/Ghost#8287
closes TryGhost/Ghost#8750
- moved all editor model functionality into the new `editor` route+controller
- moved editor template from `editor/edit.hbs` to `editor.hbs`
- refactored `editor` controller and the `editor.new`/`editor.edit` routes to work with a persistent editor rather than a teardown/re-render when transitioning from new->edit
- fixed issue in `{{gh-markdown-editor}}` for `autofocus` behaviour when the component isn't re-rendered
- fixed issue in `{{gh-simplemde}}` that was causing multiple updates to the `value` property when a new value is passed in to the component
- added `{{gh-scheduled-post-countdown}}` component to lower the noise in the editor controller
- removed editor route/controller mixins
- removed the `editor.edit` and `editor.new` controllers
@coveralls
Copy link

coveralls commented Jan 16, 2018

Coverage Status

Coverage increased (+0.003%) to 71.655% when pulling 2ce3f57 on kevinansfield:refactor-new-edit-transition into 5a54a60 on TryGhost:master.

@kirrg001
Copy link
Contributor

When i add a new post and select the title, then type and open the PSM, the PSM closes very fast and auto-saves. Expected? 🤔

@kevinansfield
Copy link
Collaborator Author

Yes, that's the same as the current behaviour. Maybe something we can open a separate issue for if it's a pain.

@kevinansfield
Copy link
Collaborator Author

Not sure why Travis says it failed, all the tests passed and the coverage report was triggered! Going to merge as-is because it was ✅ and nothing changed apart from commits being squashed.

@kevinansfield kevinansfield merged commit 51e890b into TryGhost:master Jan 17, 2018
@kevinansfield kevinansfield deleted the refactor-new-edit-transition branch January 17, 2018 13:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants