marko-js-archive / marko-widgets

[LEGACY] Module to support binding of behavior to rendered UI components rendered on the server or client
http://v3.markojs.com/docs/marko-widgets/
MIT License
141 stars 40 forks source link

Change defineRenderer to defineWidget #107

Closed ianma closed 8 years ago

patrick-steele-idem commented 8 years ago

Hey @ianma. Thanks for the PR. After looking more closely at the docs it looks like that last sentence should be similar to the following:


defineWidget(def)

The defineWidget(def) function can be used to define a UI component's client-side behavior independent of the code to render the UI component. This can be beneficial when a UI component needs to only be rendered on the server and it is desirable to avoid sending down the template and rendering logic to the browser. For UI components that are only rendered on the server, only the client-side behavior really needs to be be sent to the browser.

The return value of defineWidget(def) will be a widget constructor function that is used to instantiate new widget instances.


Does that work for you?

ianma commented 8 years ago

LGTM.

Something, in addition, that would have helped me is a tabular representation of the differences between the define functions.

defineRenderer defineWidget defineComponent
server-side rendering :x: :x: :x:
client-side rendering :x:
client-side behavior :x: :x:
patrick-steele-idem commented 8 years ago

Updated docs: https://github.com/marko-js/marko-widgets/commit/be707ade5729d1c8d519c62dfec116c29b3effda