raty icon indicating copy to clipboard operation
raty copied to clipboard

Proposal: introduce modular plugin system

Open bukhtiyarov-a-v opened this issue 3 years ago • 2 comments

Сurrent solution is heavily tied to operations on DOM elements and their state, which in turn complicates the separation of business logic and visualisation.

We would like to be able to separate the business logic and visualisation to be able to easily extend either of them. A bonus would be the ability to unit test each part of the library.

We propose to split the plugin into two parts: core and DOM. Also, we propose to add the ability to easily extend the application through the plugin system.

The inspiration for this idea comes from the DayJS plugin system.

import Raty from 'raty/core'
import RatyDOM from 'raty/dom'

// Adding plugin
import 'raty/half-star'

const instance = Raty.create(options)

RatyDOM.render(instance, element)

bukhtiyarov-a-v avatar Oct 15 '22 19:10 bukhtiyarov-a-v

@wbotelhos what do you think? :)

bukhtiyarov-a-v avatar Oct 15 '22 19:10 bukhtiyarov-a-v

Hi, @bukhtiyarov-a-v ! you're doing a great job, so thanks until here.

I loved the idea, I'm really excited about that. I'll pay you not one, but two beers for that! ❤️

wbotelhos avatar Oct 15 '22 20:10 wbotelhos