Skip to content

Instantly share code, notes, and snippets.

@roman01la
Last active April 26, 2020 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roman01la/b1888bedbafd328169e26c66dde5fd56 to your computer and use it in GitHub Desktop.
Save roman01la/b1888bedbafd328169e26c66dde5fd56 to your computer and use it in GitHub Desktop.

Rum 0.11.5 release notes

Happy to announce that Rum 0.11.5 has been released with quite a few bug fixes and new features.

React Hooks

For anyone excited about this, now you can use React Hooks in Rum. Hooks work only in function-based React components, but because Rum already generates those when using defc macro it was trivial to add support for them without breaking changes.

Hooks are compatible only with defc components and only without any mixins, except rum/static. This distinction exists because mixins are meant to be used in lifecycle methods of React's class-based components. You should be using either mixins or hooks in a single component, mixing those together would generate class-based components and hooks won't work.

Another important note is that Clojure's equality semantics does not apply to dependencies collection is Hooks, at least as of now. Instead React compares them by identity as usual in JavaScript. For Rum users this means that values in deps collection should be either primitive or identical? between updates of a component. Unfortunately working around this limitation might be error-prone, so I've decided to leave this improvement for future releases.

React Fragment

rum.core/fragment macro can be used to render multiple components without a wrapping element.

ClojureScript SSR API

Now when using rum/render-to-string from ClojureScript we delegate this to ReactDOMServer library, which means it's possible to SSR Rum components on Node as well.

Code-splitting, lazy loading and React Suspense

Read more on this in docs

React Context API

Legacy Context API is deprecated now and will be removed in future versions of Rum and React. See readme for usage example of the new API.

React refs

String refs are deprecated now. Use function or rum/create-ref from now on, see readme for usage examples.

JS components adapter API

Added an API to adapt JS React components for usage in Rum components and a hook for fallback rendering on JVM, which can be used to delegate work to GraalJS or simply render a placeholder markup. See this section in docs.

Rum components and DCE

Merged a PR that makes it possible for Google Closure Compiler to remove unused Rum components when compiling with advanced optimizations.

Component names in React DevTools

From now on we use fully qualified names in components names, so you'll be seeing something like this in React DevTools app.core/button instead of button.

String escaping in JVM SSR

Fixed a couple of issues with string escaping in HTML attributes when rendering on JVM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment