pixielabs/cavy – An integration test framework for #reactjs native

  • Cavy is a cross-platform integration test framework for React Native, by Pixie Labs.
  • Cavy (ab)uses React generating functions to give you the ability to refer to, and simulate actions upon, deeply nested components within your application.
  • This function should be used if your testable component does not respond to either or , for example:

    Cavy is a comparable tool to Appium.

  • The key difference is that Appium uses native hooks to access components (accessibility IDs), wheras Cavy uses React Native refs.
  • Jest is a useful tool for unit testing individual React Native components, whereas Cavy is an integration testing tool allowing you to run end-to-end user interface tests.

cavy – An integration test framework for React Native.
Continue reading “pixielabs/cavy – An integration test framework for #reactjs native”

Reactjs vs Vuejs – What to Choose? #Vuejs #Reactjs #js

Reactjs vs Vuejs - What to Choose?
#Vuejs #Reactjs #js

  • Pros and cons of vue js
    Vue.js – is a JavaScript-framework that uses the MVVM pattern for creating user interfaces based on data models through reactive binding data.
  • A developer might not know how to use it but he should have heard about Vue js, because the framework became popular in past few years the number of use the words “Vue js” and “Vue.js” in Google trend in 2016 was more than in four times higher comparing to 2015.
  • Advantages of vue js:

    Having borrowed from older frameworks, such as Angular and React only the best, Vue.js stands the perfect balance between readability, maintainability of code and the pleasure of it, this code, writing.

  • From React Vue.js took a component approach, props, one-way data flow for the component hierarchy, performance, the ability to render on the backend and understanding the importance of proper state management.
  • This makes it easy to add the Vue library to the project, like jQuery.All this is possible in the React library, but generally the code written on React relies more on JSX and on the features of ES.

Both React.js and Vue.js have benefits and disadvantages, that may confuse a potential client at first. We’re going to make their comparison in this article.

Continue reading “Reactjs vs Vuejs – What to Choose?
#Vuejs #Reactjs #js”

Recreating the Chrome Console in React – LogRocket

  • Since a session could potentially have thousands of logs, we knew that we’d need to build a virtual list where DOM nodes are unmounted when they leave the viewport.User-interactive JSON treeExpanding objects in the Chrome ConsoleLike the Chrome javascript console, users should be able to expand objects that were logged.
  • Simply knowing the length of the list and having a rowRenderer function that can render a given row is all it needs!Our ImplementationI’m not going to describe every detail of our console implementation since much of it is a standard application of react-virtualized, but there are a few bits where we diverged that are interesting.Row HeightsAs I described earlier, react-virtualized takes a prop rowHeight which is a function that returns the height of a row at a given index.In this screenshot of the LogRocket log viewer, notice that there are 2 states for each row: default, and expanded.
  • However, when a row is expanded, its height varies as the user expands different subtrees of the object.We needed a way to write a rowHeight function that handles dynamic height rows- something like this:In order to implement getExpandedRowHeight in the above psuedo-code, there were two potential options.Guarantee deterministic height of an expanded objectTo achieve this, we would have needed to design the object tree view component from the ground up to make its height a pure function of the subtrees that are expanded.
  • Also, making this guarantee would make it difficult to iterate on the look and feel of the log viewer since changes to things like margins and padding would need to be adjusted for.Use react-measureInstead, we opted to use a library called react-measure which provides a helpful abstraction for writing components that are aware of their own height.react-measure wraps a given component and takes a prop, onResize which is a function that is called whenever the component’s size changes.In our case, whenever the size of a given row changes, we dispatch a Redux action which stores the height of that row in Redux.
  • Then in our rowHeight function, we simply get the height of the row from Redux, and react-virtualized can render it properly.There is a small performance penalty to this approach, since react-measure uses the DOM resize-observer API which isn’t implemented natively in all browsers, but in practice this is fairly minimal.Apollo ClientTo handle data fetching, we use apollo-client which is a GraphQL client that works nicely in React apps.

One of the core features of LogRocket is the replay of console and Redux logs in production web apps. To do this, you add the LogRocket SDK to your app which sends logs to LogRocket. Then, when…
Continue reading “Recreating the Chrome Console in React – LogRocket”

#ReactJS vs #VueJS – What to Choose? #javascript

#ReactJS vs #VueJS - What to Choose?  #javascript

  • Pros and cons of vue js
    Vue.js – is a JavaScript-framework that uses the MVVM pattern for creating user interfaces based on data models through reactive binding data.
  • A developer might not know how to use it but he should have heard about Vue js, because the framework became popular in past few years the number of use the words “Vue js” and “Vue.js” in Google trend in 2016 was more than in four times higher comparing to 2015.
  • Advantages of vue js:

    Having borrowed from older frameworks, such as Angular and React only the best, Vue.js stands the perfect balance between readability, maintainability of code and the pleasure of it, this code, writing.

  • From React Vue.js took a component approach, props, one-way data flow for the component hierarchy, performance, the ability to render on the backend and understanding the importance of proper state management.
  • This makes it easy to add the Vue library to the project, like jQuery.All this is possible in the React library, but generally the code written on React relies more on JSX and on the features of ES.

Both React.js and Vue.js have benefits and disadvantages, that may confuse a potential client at first. We’re going to make their comparison in this article.

Continue reading “#ReactJS vs #VueJS – What to Choose? #javascript”

#Reactjs renderer with X11 as a target

  • React custom rendering where side effects are communication with X11 server.
  • The goal is to create a simple library where you would apply your React or React Native like experience to build small GUI programs to run in X Window environment (usually linux desktop, but I personally more often code under osx + XQuattz)

    This library is mostly written in javascript all way down, no special bridging code in different language required.

  • For communication with X server node-x11 library is used, which is pure JS implementation of X11 protocol (think of it as xlib rewritten in javascript/node.
  • js)

    Currently only component is available, in the future we’ll add windowless controls support, simple controls library and yoga-layout powered layout management

react-x11 – React renderer with X11 as a target
Continue reading “#Reactjs renderer with X11 as a target”

A tiny Fiber renderer- Dustan Kasten, React London 2017

Check out @iamdustan presenting

  • React is really two separate pieces: core and renderers.
  • ReactDOM, ReactNative, ReactVR are but a few renderers in existence.
  • With the Fiber reconciler rewrite comes an official renderer API.
  • Dustan will look at a number of renderers that already exist and implement a React renderer of his own!

React is capable of rendering to more environments than the browser. React is really two separate pieces: core and renderers. ReactDOM, ReactNative, ReactVR …
Continue reading “A tiny Fiber renderer- Dustan Kasten, React London 2017”

React v15.5.0

What do you think about React v15.5.0?



#ReactJS #React15 #JavaScript #Developer #WebDev

  • In 15.5, instead of accessing from the main object, install the package and import them from there:

    The codemod for this change performs this conversion automatically.

  • You may also consider using Flow to statically type check your JavaScript code, including React components.
  • Later, classes were added to the language as part of ES2015, so we added the ability to create React components using JavaScript classes.
  • Along with functional components, JavaScript classes are now the preferred way to create components in React.
  • The codemod for this change attempts to convert a component to a JavaScript class, with a fallback to if necessary.

It’s been exactly one year since the last breaking change to React. Our next major release, React 16, will include some exciting improvements, including a complete rewrite of React’s internals. We take stability seriously, and are committed to bringing those improvements to all of our users with minimal effort.
Continue reading “React v15.5.0”