Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

reason-react

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reason-react - npm Package Versions

1245

0.5.2

Diff

chenglou
published 0.5.1 •

chenglou
published 0.5.0 •

Changelog

Source

0.5.0

This release requires bs-platform 4.0.3.

Small breaking change (only if you haven't upgraded for a while). The migration/upgrade script, as always, is here.

Event Changes

ReactEventRe is now deprecated in favor of ReactEvent. They're similar but the latter comes with the big quality-of-life improvement of turning our old:

ReactDOMRe.domElementToObj(ReactEventRe.Form.target(event))##value

into:

event->ReactEvent.Form.target##value

Aka, you can use the -> fast pipe now (|. in OCaml syntax), and we've changed the definition of target in the various ReactEvent modules to directly give you back a Js.t object instead of Dom.element. Same applies to other such attributes.

We've also changed things like ReactEventRe.Mouse._type into ReactEventRe.Mouse.type_ to abide by the Reason idiom.

Lastly, bs.send.pipe is informally deprecated, so we've removed the usage of those too. Instead of e |> ReactEventRe.Mouse.preventDefault, use either e->ReactEvent.Mouse.preventDefault or ReactEvent.Mouse.preventDefault(e). bs.send.pipe is, all things considered, the heaviest BuckleScript special annotation. If your library uses it, please consider removing it too. Thanks!

JSX

Fragment has landed! <> child1 child2 </>. For more info, check ReactJS' docs on Fragment. Note that we currently don't support:

  • Keyed fragment.
  • Fragment with ref.
  • Fragment spread (ReasonReact-specific): <> ...children </>.

The latter will be supported next. Fragment requires React 16.

Additionally, DOM component children spread <div>...foo</div> now works. No more need to use the ReasonReact.createDomElement fallback!

Removal of Previously Deprecated Features

  • The DOM props _type, _open, and others (see 0.4.2 release notes below) are officially removed. Use type_, open_, etc.
  • The field subscriptions was deprecated and is now removed completely. Please use the new subscriptions helper instead.
  • ReasonReact.stringToElement, nullElement, arrayToElement are also gone for good. Use ReasonReact.string, null, array. The previous migration script in 0.4.0 already took care of this.
  • ReasonReact.Callback module removed.

Deprecations

  • ReasonReact.createDomElement is changed in favor of ReactDOMRe.createElementVariadic. This is more consistent with ReactDOMRe.createElement. Both are used by the JSX transform; the latter, when it's a children spread for DOM elements (mentioned above) and has a small perf cost.

Thanks for the wait, and enjoy!

chenglou
published 0.4.2 •

Changelog

Source

0.4.2

This release requires bs-platform 3.1.4.

  • DOM components now support aria-* attributes without needing hacks: <div ariaLabel="foo" />. The camelCase ariaStuff will compile to aria-stuff.
  • For DOM props, instead of _open, _type, _begin, _end, _in, _to, use the new trailing underscore version for consistency: open_, type_, etc. The former leading underscore versions are now deprecated.
chenglou
published 0.4.1 •

Changelog

Source

0.4.1

  • Restore ReasonReact.Callback module for now and put a deprecation warning on it. This way, at least your third-party dependencies can compile further.
  • Relax wrapJsForReason and wrapReasonForJs types so that we can use bs.abstract for interop instead of Js.t objects.
chenglou
published 0.4.0 •

Changelog

Source

0.4.0

Requires bs-platform >=3.0.0. Migration script is here.

Breaking Changes

  • Remove SilentUpdate and SilentUpdateWithSideEffects. These aren't used for a long time now.
  • didMount now returns unit, per our previous warnings in the docs. To trigger a state update, use self.send(MyAction).
  • Remove self.reduce for real; use self.send (not to be confused with reducer, which is still around).
  • Remove ReasonReact.Callback module (undocumented and unused).

Deprecations

  • ReasonReact.stringToElement, arrayToElement and nullElement are now deprecated in favor of ReasonReact.string, array and null!
  • Old subscriptions API is deprecated. Please use the new self.onUnmount.
  • willReceiveProps deprecated. We'll transition to React 16 very soon and release our binding to deriveStateFromProps.

Improvements

  • Use bool instead of Js.boolean (thanks to BuckleScript 3.0.0).
  • Fix Router incompatibility with IE11 (#201).
  • Much more streamlined internals.
  • Prepare to transition to React 16.
  • Did we mention that ReasonReact.stringToElement is now ReasonReact.string, etc.?
chenglou
published 0.3.4 •

Changelog

Source

0.3.4

This release requires bs-platform 2.2.2! If your app haven't upgraded to it, don't worry; you can still use ResonReact 0.3.2 just fine. Only two small changes.

  • Use the new bs-platform Js.Nullable.toOption. No more deprecation warnings when you use ReasonReact (main purpose of the release).
  • Add ReactDOMRe.hydrate, hydrateToElementWithId, hydrateToElementWithClassName (#184).
chenglou
published 0.3.3 •

chenglou
published 0.3.2 •

Changelog

Source

0.3.2

  • Portal support (#152)
  • Add Router.dangerouslyGetInitialUrl. Please see the corresponding docs on router.
chenglou
published 0.3.1 •

Changelog

Source

0.3.1

No breaking change. The migration script is here.

  • New subscriptions helper.
  • Router is here!
  • self.reduce is now changed into self.send, with a simpler semantic that clears up the confusion on the immediate call case. More performant and fewer allocations too! The migration script will convert most of the code over for you.

Before: onClick={self.reduce(_event => Click)} After: onClick={_event => self.send(Click)}

Before: didMount: self => {self.reduce(() => Click, ()); NoUpdate} After: didMount: self => {self.send(Click); NoUpdate}

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc