Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

finish docs, cleanup, finalize #21

Closed
3 tasks done
x1B opened this issue Feb 10, 2017 · 8 comments
Closed
3 tasks done

finish docs, cleanup, finalize #21

x1B opened this issue Feb 10, 2017 · 8 comments

Comments

@x1B
Copy link
Member

x1B commented Feb 10, 2017

Make sure that this adapter has everything required for LaxarJS v2:

  • widget area support
  • working spec tests
  • up-to-date docs
@jonaswjs
Copy link
Member

jonaswjs commented Mar 17, 2017

The hint about the Documentation will not only be visible at the GitHub site but also on the npm package information site. We should use a different phrase.

<span class="laxar-developer-view">This is the developer version. Take a look at our <a href="http://www.laxarjs.org/docs/laxar-react-adapter">documentation site</a> with the released version.</span>

And fix the link: http://www.laxarjs.org/docs/laxar-react-adapter should be http://www.laxarjs.org/docs/laxar-react-adapter-latest

@x1B
Copy link
Member Author

x1B commented Mar 17, 2017

Good points!

@x1B
Copy link
Member Author

x1B commented Mar 17, 2017

I recommend the following text:

<span class="laxar-developer-view">
   Take a look at the <a href="http://www.laxarjs.org/docs/laxar-react-adapter-latest">documentation site</a> to browse documentation for all releases of this artifact.
</span>

@alex3683
Copy link
Member

alex3683 commented Apr 5, 2017

Cool thing, but I don't quite understand the meaning of laxar-developer-view. From what I understand that the class does, something like laxar-external-documentation-hint would be more suitable.

@x1B
Copy link
Member Author

x1B commented Apr 5, 2017

@alex3683 @jonaswjs agreed, the class name laxar-external-documentation-hint makes more sense.

@x1B x1B self-assigned this Apr 10, 2017
@alex3683
Copy link
Member

alex3683 commented Apr 10, 2017

@x1B Two more things:

  • use ES2015 class syntax instead of React.createClass() (there is already a deprecation warning from React)
  • In the controls part, a description on how to use the control within a widget is missing

@x1B
Copy link
Member Author

x1B commented Apr 11, 2017

Implemented on master (v2.0.0).

BREAKING CHANGE

The "react" integration technology was simplified in an incompatible manner for LaxarJS v2.
The following things were modified:

  • the widget's create export is now expected to return just a render function,
  • the axReactRender method no longer takes arguments,
  • the AxWidgetArea was changed: the areaName prop was renamed to name. The axVisibility prop is only required if the visible prop (now true by default) is also used.

For numerous examples, refer to the README.md.

@jpommerening
Copy link
Member

Short recipe on how to quickly adapt to the breaking change:

  • change the create function to return the render function instead of { onDomAvailable }
  • change the render function to return React elements instead of passing them to reactRender()
  • replace calls to render() with calls to reactRender()
  • replace the areaName property with name
  • continue with Request for comments: allow users to export plain React components #27 👍

Before:

function create( reactRender ) {
   function render() {
      reactRender(<em>Yo</em>);
   };

   setTimeout(render, 2000);

   return {
      onDomAvailable: () => render()
   };
};

After:

function create( reactRender ) {
   function render() {
      return <em>Yo</em>;
   };

   setTimeout(reactRender, 2000);

   return render;
};

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants