Skip to content
Snippets Groups Projects

Clean code and separate concerns

Merged Emmanuel Vodor requested to merge cleaning into beta
4 unresolved threads
  • Installed Prettier with conf
  • Format code
  • Moved all the plugins outside of the main component
  • Moved Deferred into a utils file
  • Renamed plugins with correct prefixes

Note:

  • converse-xxx plugins are related to converse itself (adds feature or fixes a bug)
  • sib-xxx plugins are related to the chat component itself

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
57 57 "sass": "^1.32.5"
58 58 },
59 59 "devDependencies": {
60 "prettier": "^2.2.1",
  • .prettierrc 0 → 100644
    1 {
    2 "arrowParens": "avoid",
    3 "trailingComma": "es5",
    4 "tabWidth": 4,
  • 1 /**
    2 * Register a new event to move the converse element
    3 * into another component.
    4 */
    5 converse.plugins.add('sib-chat-navigation', {
    6 initialize() {
    7 const _converse = this._converse;
    8 const { api } = _converse;
    9
    10 window.addEventListener('sib-change-chat', async ev => {
  • 96 }, contactsURL);
    97 }
    98 }
    99 }, 100);
    100 }
    101 await converse_sib.connected_deferred;
    102
    103 window.dispatchEvent(new CustomEvent('sib-change-chat', {
    104 detail: {
    105 jid: this.jid,
    106 is_groupchat: await this.resource.jabberRoom,
    107 root: this.element.shadowRoot,
    108 },
    109 }));
    110
    111 window.dispatchEvent(new CustomEvent('read', {
  • Commented few things, overall I'm fine with your changes. Feel free to merge on beta whenever you want.

  • Emmanuel Vodor added 2 commits

    added 2 commits

    • 1cb3f6c9 - remove prettier from project (user pref)
    • 79970238 - Merge remote-tracking branch 'origin/cleaning' into cleaning

    Compare with previous version

  • Emmanuel Vodor added 1 commit

    added 1 commit

    • 9fb243e9 - format code with 2 spaces as indent size

    Compare with previous version

  • Emmanuel Vodor mentioned in commit de90f7f8

    mentioned in commit de90f7f8

  • Please register or sign in to reply
    Loading