LaxarJS / laxar-patterns

Utilities to implement standard event patterns in LaxarJS widgets
MIT License
5 stars 2 forks source link

Fix API doc parameters and documentation (Angular specific, and others) #78

Closed alex3683 closed 7 years ago

alex3683 commented 7 years ago

There are some parameters still containing "scope" (for example registerFlagFromFeature in the flag handler). This must be changed into something universal, for example "context".

x1B commented 7 years ago

Renamed issue, let's include non-Angular-related API doc cleanup work as well.

alex3683 commented 7 years ago
alex3683 commented 7 years ago

Breaking:

alex3683 commented 7 years ago

Implemented on master (v2.0.0)

Breaking Change

Since LaxarJS is independent from AngularJS starting with 2.x all occurrences of scope (which referenced the AngularJS widget scope) are renamed to context (generic AxContext instance provided by the widget runtime). The latter is agnostic of any widget implementation technology. In fact for AngularJS the scope extends the AxContext instance. For the flags library not only the documentation needed to be changed, but also the scopeKey option of registerFlag and registerFlagFromFeature. So this

flags.handlerFor( context )
   .registerFlagFromFeature( 'superFeature.superAttribute.disableOn', {
        scopeKey: 'flags.disabled',
   } );

becomes this

flags.handlerFor( context )
   .registerFlagFromFeature( 'superFeature.superAttribute.disableOn', {
        contextKey: 'flags.disabled',
   } );

The same applies to registerFlag.