React.js gets a Fresh Update

reactJS

With Facebook’s founder testifying to the U.S. Congress, in unrelated news, the company’s React.js UI library for JavaScript recently received a new update. Version 16.3 of React provides a host of new features for developers hoping to add some efficiency to their web applications. If you are interested in downloading it, the update is available on Facebook’s own GitHub repository.

If your team isn’t using React, check out our previous articles covering it and its mobile variant, React Native. What follows is a high level overview of React version 16.3. News about the new update appeared in InfoWorld, among other sources.

A Look at the New Features of React.js 16.3

The main changes in the updated version of React involve improved management of the component lifecycle, as well as a new API to help developers better deal with context in their application. These new component lifecycles include: getDerivedStateFromProps and componentWillReceiveProps, which gives programmers a safer option than using the legacy versions. Another one, getSnapshotBeforeUpdate, safely handles the reading of properties before performing an update.

Some lifecycles are receiving an “unsafe” prefix to warn developers not to use them. Runtime safety isn’t the issue as much as the likelihood of deprecated functionality and subsequent incompatibility with future versions of React. In short, they are warning you about potential future bugs. Another reason for this is providing a “heads up” to engineers maintaining open source applications using React.

Facebook engineer, Brian Vaughan commented on what led to this new lifecycle functionality. “A few days ago, we wrote a post about upcoming changes to our legacy lifecycle methods, including gradual migration strategies. In React 16.3.0, we are adding a few new lifecycle methods to assist with that migration,” said Vaughan.

Another option involves using the new StrictMode component. This serves to identify any unsafe legacy lifecycles when running in development mode. It also warns about other side effects from using older lifecycles and React functionality. Expect additional features to be added to this component in future updates.

The New React Context API adds Efficiency

In addition to providing a boost in efficiency, React’s new Context API allows for static type checking and deep updates. Data is able to be passed through a component tree without the manual inclusion of props. The old API is expected to still work for a few more versions, so start updating your code to use to new one.

Facebook cautions about overusing the new API. “Don’t use context just to avoid passing props a few levels down. Stick to cases where the same data needs to be accessed in many components at multiple levels,” said the social network’s development team.

Other fresh features in React 16.3 include a new API for managing refs, called createrefAPI. This lets programmers access DOM nodes or React elements derived from the render process. The forwardRef API facilitates code reuse by help devs use higher-order components for this purpose.

Since React is effectively becoming a standard for UI development in web applications, we hope this look at its latest version provides some insights for you and your team. As always, thanks for reading the Betica Blog. We hope to see you again very soon!

Is FaaS – Features-as-a-Service – the Next Big Thing in Software Development?

The growing popularity of the Cloud-based service model has led to a plethora of acronyms ending in “aaS.” Platform-as-a-Service (PaaS), Software-as-a-Service (SaaS), and Database-as-a-Service (DBaaS) remain three of the most common examples of these service offerings in the tech industry. Businesses of all sizes enjoy cost savings by leveraging the Cloud in this manner.

Now software developers, trying to keep up in an increasingly rapid business world, have their own Cloud-based service acronym. Enter Features-as-a-Service (FaaS). Does FaaS give application engineers the chance to build more functional software faster and at a lower cost? Let’s take a look.

Code Reuse in a Cloud-based Wrapper

Code reuse is a traditional way for programmers to accomplish more by doing less. It’s one of the reasons libraries and APIs are so popular throughout the industry. We’ve covered this technology and API Testing extensively in the past on this very blog.

FaaS essentially just makes this process more componentized; delivering a library of functionality in a convenient Cloud-based wrapper for software engineers to use in their own applications. Instead of spending time reinventing the wheel, developers are able to focus on the unique functionality that makes their app special. Technology VP, JT Ripton commented on the FaaS trend

“Whereas on the backend developers already are using pay-as-you-go infrastructure such as Amazon Web Services for cloud computing and services such as Stripe for payment processing, FaaS takes the same approach but applies it to the front end,” said Ripton. He also notes developers struggling with implementing a public API need to consider FaaS as an option when speed is of the essence.

Scenarios where Usage of a FaaS is Smart

A variety of FaaS providers are currently supporting common functional areas within applications, potentially saving development teams both time and money. Mapbox is one such provider worthy of consideration when compared to Google’s Map API and its arcane documentation. A plug-and-play model simply works more efficiently in today’s era of Agile and DevOps.

Social interactivity is another good example. There is no need to build social functionality from scratch, when a provider like Tapglue offers their own FaaS. Their service includes functionality supporting user profiles and news feeds, as well as interactive features like sharing, commenting, and more.

Agora.io offers a FaaS that adds real time communication – voice and video – to an application. This would be a boon for a game developer working on a MMORPG or any other type of multiplayer title. Concentrate on your game’s functionality; not on getting codecs to work properly on a variety of devices.

Ripton stresses the essential difference between FaaS and other types of code reuse like an API is the front-end component. This is especially useful for teams without their own UI design talent. He feels this is a natural progression on how software gets written.

“FaaS is just the next evolution of the mashup and code reuse trend that’s been picking up steam over the past several decades. It isn’t a “revolutionary” idea, or even truly innovative. But it is perfectly in line with the way we code today — it is a new application of something we’ve seen before,” said Ripton.

Stay tuned to the Betica Blog for additional insights from an ever-changing software development world. Thanks for reading!

Monitor API Usage with Runscope

Any company involved in the development of APIs, or even those simply building web or mobile applications dependent on them, benefits from being able to analyze API performance before deployment to production. A tool combining this performance testing functionality with testing and monitoring capabilities offers a full range of features wanted by most software teams. Runscope is just this kind of application.

What follows is an overview of Runscope to help you determine whether it makes sense to add it to your organization’s API testing toolbox. It may just ensure your applications and APIs perform as expected in production.

A Closer Look at Runscope

Runscope is a relatively new product and company. Formed by two software engineers, John Sheehan and Frank Stratton, the initial version of the application became available in the first half of 2013. The primary goal of their API analysis tool involves trusting an API running on a remote server just like it was running on a developer’s local machine.

Runscope Monitoring Features and Functionality

Uptime monitoring of an API – in real-time – is a major selling-point for Runscope. The product promises the engineers responsible for tracking an application in a production environment will know if an API breaks before the client or customer. It integrates with a wide variety of popular notification and messaging apps, including Slack, PagerDuty, email, as well as offering support for webhooks.

An on-premises agent (supporting Linux, OS X, and Windows) allows for the seamless monitoring of private APIs. This is in addition to Runscope’s standard Cloud-based SaaS (located in 12 global data centers) used for public API analysis. The tool includes threshold-based notifications to lower the instance of false positives. 

Real-time performance data helps analyze an API’s response times as well as the ratio of successful calls to failures. Engineers are able to quickly detect any issues requiring closer analysis and debugging. Runscope’s data can be imported into third-party analytical tools, like Keen IO, Datadog, and New Relic Insights.

Additional API Testing Capabilities

Runscope sports other functionality aimed at the testing of APIs. You are able to verify data in the JSON and XML formats, as well as validate HTTP headers and response status codes. Advanced validations are also possible in code using JavaScript and the Chai Assertion Library.

Users are able to create dynamic test scripts for vetting API workflows, without any coding effort. Test plan creation in the Swagger format, among others, offers a more structured level of API QA. Runscope also integrates with Jenkins and other similar tools for organizations leveraging a Continuous Integration release cycle.

Interested customers can test drive Runscope on a free trial basis. Their premium service is structured across three tiers based on the number of API requests and users, with monthly prices ranging from $79 to $599; the higher two levels also include priority support and live chat. There is also a Premier level with additional custom features and extra traffic handling.

In short, Runscope’s full range of API monitoring and testing features, along with its compatibility with industry standard messaging and analytical tools, makes the tool worth checking out at any shop specializing in API development.

Stay tuned to the Betica Blog for additional dispatches and analysis from the software development and QA world. Thanks for reading, as always.