Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
S
SiB Core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 110
    • Issues 110
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Packages
    • Packages
    • Container Registry
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Startin blox
  • framework
  • SiB Core
  • Issues
  • #468

Closed
Open
Opened Sep 06, 2019 by Jean-Baptiste Pasquier@jbpasquier
  • Report abuse
Report abuse

[Feedback] Writing a component with sib-core

@alexandre @sylvain @clement @matthieu

As our implementation of sib-chat did not works with Converse 5, and due to time drain at debugging it, I rewrote it with sib-core@0.8 and I wanted to give you a feedback of trouble that I get.

https://git.happy-dev.fr/startinblox/components/sib-chat/blob/sib-chat-next/sib-chat.js

Overall, there is a lack of documentation on SIBTemplateElement, even if it does not really do a lot more than an HTMLElement. Example is fine, but only if you want some kind of simple "static widget".

For sib-chat, I had no use of template & need to use a shadowRoot for conversejs, so the use of a SIBTemplateElement is more a sib-way than a need.

There were two black points:

  • I didn't find a simple way to have a dataSrc like a sib-display & access to a resource within my component, so I directly called the store. Not really handy to use, undocumented too, had to manage with a lot of promises everywhere. Promises are more a converse + sib issue than just a core issue.
  • I needed an event "navigate" + "route has binded resource of this component", I did it like this https://git.happy-dev.fr/startinblox/components/sib-chat/blob/sib-chat-next/sib-chat.js#L35-37 but I'm pretty sure we can implement an helper to avoid the use of 1x listener by component instance.

Also some little points:

  • navigate event detail.resource had an id but not an @id as expected by sib-notification https://git.happy-dev.fr/startinblox/components/sib-chat/blob/sib-chat-next/sib-chat.js#L51
  • I used window to set an application wide variable. I know that I can define another component & use it to set my variable, like for sib-auth, but I'm not sure if that's the best way.
  • Sometimes, component loads too fast & I get undefined on props, used promises as workaround.

Globally, it's the lack of documentation & way to know what sib-core can / cannot do without having to dig the code that take me most of time beside converse.

Feel free for advice or if you see improvement.

Assignee
Assign to
0.10
Milestone
0.10
Assign milestone
Time tracking
None
Due date
None
2
Labels
P3 documentation
Assign labels
  • View project labels
Reference: startinblox/framework/sib-core#468