Our React Native GL library is in alpha – Points of interest

We're now supporting #reactnative Mapbox GL 🙌 Try out our alpha

  • Our React Native GL library is in alphaBy: Nick ItalianoWe’re officially supporting React Native Mapbox GL.
  • Our mobile team has started a rewrite of our current experimental React Native library and released an alpha 🙌Using the React Native framework, developers can build cross-platform mobile applications in half the time.
  • Our React Native library will make it as efficient as possible to access our APIs and open source libraries, so you can focus on shipping features.Reusable components are the strongest aspect of React, which is why we’ve created expressive and easy to use components for powerful features like runtime styling…
  • With this in mind, you can render a custom styled map centered on San Francisco in just 25 lines of code.First look runtime styling in React NativeRuntime styling is the first major feature with added support in this alpha release.
  • Here is a preview of a couple examples you can find in our sample application.3D buildingsMarker clusteringWhat’s nextWe plan on bringing our React Native SDK to feature parity with our Android/iOS SDKs and want to be active in the community:We have a Gitter channel where you can post any questions…

We’re officially supporting React Native Mapbox GL. Our mobile team has started a rewrite of our current experimental React Native library and released an alpha 🙌 Using the React Native framework…
Continue reading “Our React Native GL library is in alpha – Points of interest”

React + Jest + Enzyme: how to cook in 5 mins – codeburst

  • This testing tool has a lot powerful features from the box (snapshots, coverage tool, matchers and async testing) which pretty useful and necessary in medium and small projects on the start.
  • Nowadays, this could be a important point for frontend development cause project based on React has about a dozen dependencies from transpilers (if you use ES6) and Redux.JestTo install Jest and some dependencies you just need to run simple command:npm install –save-dev jest babel-jest identity-obj-proxyand add the following config in the package.jsonPackage babel-jest is optional.
  • We would use it to support ES6 in the tests.Let’s pay a little bit attention on each section:In transform you would use or your custom transform script or (as we did in this article) already implemented script for support ES6 syntax.moduleNameMapper would be useful if you use CSS Modules in your project to encapsulate your styles for each component.collectCoverageFrom and coverageReports configure our coverage settings.
  • If you will run jest –coverage you will be able to see results of this settings after runs of all tests.EnzymeJust runnpm install –save-dev enzymeand we able to implement our test with enzyme!Let’s see on the example below:I use mount method in this example just to imitate full dom rendering, but you would use render or shallow depends on your purposes.In this test we gonna use jest snapshots which i described above.
  • With this feature we would easy to find out what actually in the DOM of the component is changed and fix the problem or run jest –updateSnapshots to update snapshots as you guess.ConclusionTwo statements in command prompt, one config in package.json and… that’s all.

In this article we gonna take a look at awesome testing tool Jest and how to use it with React and Enzyme. First of all we need to figure out why we have to decide to use Jest. This testing tool has…
Continue reading “React + Jest + Enzyme: how to cook in 5 mins – codeburst”

React + Jest + Enzyme: how to cook in 5 mins – Vladislav Dekhanov – Medium

React + Jest + Enzyme: how to cook in 5 mins  #jest #javascript #react #enzyme #reactjs

  • This testing tool has a lot powerful features from the box (snapshots, coverage tool, matchers and async testing) which pretty useful and necessary in medium and small projects on the start.
  • Nowadays, this could be a important point for frontend development cause project based on React has about a dozen dependencies from transpilers (if you use ES6) and Redux.JestTo install Jest and some dependencies you just need to run simple command:npm install –save-dev jest babel-jest identity-obj-proxyand add the following config in the package.jsonPackage babel-jest is optional.
  • We would use it to support ES6 in the tests.Let’s pay a little bit attention on each section:In transform you would use or your custom transform script or (as we did in this article) already implemented script for support ES6 syntax.moduleNameMapper would be useful if you use CSS Modules in your project to encapsulate your styles for each component.collectCoverageFrom and coverageReports configure our coverage settings.
  • If you will run jest –coverage you will be able to see results of this settings after runs of all tests.EnzymeJust runnpm install –save-dev enzymeand we able to implement our test with enzyme!Let’s see on the example below:I use mount method in this example just to imitate full dom rendering, but you would use render or shallow depends on your purposes.In this test we gonna use jest snapshots which i described above.
  • With this feature we would easy to find out what actually in the DOM of the component is changed and fix the problem or run jest –updateSnapshots to update snapshots as you guess.ConclusionTwo statements in command prompt, one config in package.json and… that’s all.

In this article we gonna take a look at awesome testing tool Jest and how to use it with React and Enzyme. First of all we need to figure out why we have to decide to use Jest. This testing tool has…
Continue reading “React + Jest + Enzyme: how to cook in 5 mins – Vladislav Dekhanov – Medium”

ZEIT – Next.js 2.0

Next.js 2.0

  • When we launched Next.js, there was no way to do dynamic routing or load your custom server code.
  • This has tremendous benefits, at the tiny cost of two extra parameters in the initial `install` to set up your project:

    Our mission is to make Next.js as familiar as possible to developers on the Web Platform.

  • Each top-level component (page) in Next.js defines the entirety of the document .
  • We’ve very thankful to our community for having submitted so many examples of backends (Express, HAPI, Koa…), styling systems (cxs, glamor, styled-components…), testing systems (jest), type systems (TypeScript and Flow), data fetching (Apollo) and many others.
  • This will allow for server-rendered pages that expose different JS components according to the data they used, for example.

Next.js 2.0 comes packed with performance improvements and extensibility features
Continue reading “ZEIT – Next.js 2.0”

Journey into React Part 6: Managing state and connecting to an Api with Redux and Axios

Managing state and connecting to an API with Redux and Axios:  #ReactJS

  • We export a function that contains a switch statement and returns the state.
  • Let’s throw in a reference to the message itself inside the component so that we can see whatever message is returned to us from the server.
  • Store and State The store contains the application state, which now consists of the confirmation message.
  • The action type tells the reducers what has happened, for example UPDATE_USERNAME , and the payload would be the confirmation message.
  • Create a new file titled index.js in the actions directory and import axios (to make our HTTP requests) and the action-type we made.

This tutorial is going to focus on setting up and using Redux as well as Axios so that you can make a call to a server…
Continue reading “Journey into React Part 6: Managing state and connecting to an Api with Redux and Axios”