Experience Design Essentials: Animated Microinteractions In Mobile Apps

Sponsored ArticleExperience Design Essentials: Animated Microinteractions In Mobile Apps

Dariel Fitzkee, the famous magician, once said, “Magic is both in the details and in the performance.” Interaction design is just like that. Designers love to get the big picture right, but if the details aren’t handled properly, the solution will fail. The magic is all in the details. That’s why well-designed microinteractions make experiences feel crafted.

To get a better understanding of how your design benefits from microinteractions, it will help to sketch out your app ideas. Adobe introduced a new design and wireframing app called Experience Design (or Adobe XD) which lets you design wireframes and make them interactive. You can download and test Adobe XD1for free.

Further Reading on SmashingMag Link

Show System Status Link

Jakob Nielsen’s first heuristic for UI design states, “The system should always keep users informed about what is going on, through appropriate feedback in a reasonable time.” This means that the user interface should keep the user abreast of what is happening by providing feedback. The app shouldn’t keep the user guessing — it should tell the user what’s happening, and microinteractions can help you make that known via appropriate visual feedback.

Data uploading and downloading processes are great opportunities for creative animated microinteractions.

4
Data downloading animation (Image: Nick Buturishvili5)

Another well-known animation for this group is “pull down to refresh,” which initiates a process of content updates on mobile devices. A cheerful refresh animation can make users chuckle.

microtwo26
Pull down to refresh (Image: Toma Reznichenko7)

Takeaway: Animation provides real-time notification of an app’s process status, enabling the user to quickly understand what is going on.

Make Buttons And Controls Tangible Link

User interface elements such as buttons and controls should appear tangible, even though they are behind a layer of glass. Visual and motion cues can bridge this gap by acknowledging input immediately and animating in ways that look and feel like direct manipulation. UI buttons can mimic interaction with common physical objects. Simply put, you can add clarity through visual responses to the user’s input.

microtwo38
(Image: Google9)

Takeaway: Visual feedback works because it appeals to the user’s natural desire for acknowledgement. It just feels good to click through an app and always feel like you know what’s happening.

Build Meaningful Transitions Link

You can use animation to smoothly transport users between navigational contexts, to explain changes in the arrangement of elements on a screen or to reinforce an element’s hierarchy.

Icons can morph from one shape to another, serving dual functions at different times.

microtwo410
(Image: Google11)

Motion design can effectively guide the user’s attention in ways that both inform and delight. This is especially good for mobile devices and smartwatches because it’s impossible to fit a lot of information on those screens.

Apple’s iOS UI is a good example of meaningful transitions. In the example below, the user selects a folder or app and is zoomed into its detailed view (or directly to the app’s main screen).

microtwo512
(Image: Rian Van Der Merwe13)

Another good example is animation that creates visual connections between two states through color and persistent elements. This makes transitions smooth and effortless.

microtwo614
(Image: Ehsan Rahimi15)

Takeaway: Microinteractions can establish a visual connection between pages and add clarity to the UI.

Help The User Get Started Link

Microinteractions are very helpful during onboarding. Flawless UX and animations in the onboarding flow can have a tremendous impact on how first-time users engage with the app. They guide and educate users after the launch of an app by highlighting the most important features and controls.

microtwo716
Smooth onboarding (Image: Ramotion17)

Takeaway: Microinteractions reveal information and help the user to efficiently reach their goal.

Highlight Changes In The UI Link

Microinteractions can direct the user’s attention. In many cases, animation is used to attract their attention to an important detail (such as a notification). However, be sure that the animation serves a functional purpose and is appropriate to your users.

microtwo818
Notification (Image: Arjun Kani19)

Takeaway: Microinteractions can be good visual cues for the user.

Add Delightful Details Link

The most basic use of a microinteraction animation is in transitions. However, an app can truly delight users when animation is used in ways beyond the standard scope of actions. The button below seamlessly changes states and serves dual functions: to inform the user and to create a moment of wonder.

microtwo920
Social media sharing (Image: Kei Sato21)

Takeaway: Focus on user emotions, which play a huge role in UI interactions.

What To Consider When Designing Microinteractions Link

When you create a visual design containing the elements discussed above, keep a few things in mind:

  • Make microinteractions almost invisible and completely functional.

    Make sure the animations fit a functional purpose and do not feel awkward or annoying. For frequent and minor actions, the response can be modest, while for infrequent and major actions, the response should be more substantial.
  • Keep longevity in mind.

    Microinteractions must survive long-term use. What seems fun the first time might become annoying after the hundredth use.
  • Follow the KISS principle22.

    Over-designing a microinteraction can be lethal. Microinteractions shouldn’t overload the screen and cause a long process of loading. Rather, they should save time by instantly communicating valuable information.
  • Don’t start from zero.

    You will almost always know something about your target audience and their context. Use that knowledge to make your microinteractions more precise and effective.
  • Create visual harmony with the other UI elements.

    Microinteractions should match the general style of the application, supporting a harmonious perception of the product.

Conclusion Link

Microinteractions show that attention to small details can deliver big and powerful results. As Charles Eames once said, “The details are not the details. They make the design.” Every element of the design matters. Details make your app stand out from the competition because they can be either practical and forgettable or impressive, useful and unforgettable.

Always design with care, and don’t forget that a great design has to happen full-stack, from the functional parts down to the microinteractions.

This article is part of the UX design series sponsored by Adobe. The newly introduced Experience Design app23 is made for a fast and fluid UX design process, as it lets you sketch out ideas, create interactive prototypes, test and share them all in one place.

You can check out more inspiring projects created with Adobe XD on Behance24, and also visit the Adobe XD blog25 to stay updated and informed. Adobe XD is being updated with new features frequently, and since it’s in public Beta, you can download and test it for free26.

(ms, vf, il, al)

Footnotes Link

  1. 1 http://adobe.ly/2aNMUAX
  2. 2 https://www.smashingmagazine.com/2016/07/how-to-create-icons-adobe-xd/
  3. 3 https://www.smashingmagazine.com/2016/07/quick-ux-prototyping-with-adobe-xd-shortcuts-pdf-cheatsheet/#comments
  4. 4 https://www.smashingmagazine.com/wp-content/uploads/2016/07/microtwo1-large.gif
  5. 5 http://www.materialup.com/posts/download-animation
  6. 6 https://www.smashingmagazine.com/wp-content/uploads/2016/07/microtwo2-large.gif
  7. 7 https://dribbble.com/shots/2101933-GIF-for-Pull-Down-Space-Ship
  8. 8 https://www.smashingmagazine.com/wp-content/uploads/2016/07/microtwo3-large.gif
  9. 9 http://www.google.com/design/spec/animation/responsive-interaction.html#responsive-interaction-user-input
  10. 10 https://www.smashingmagazine.com/wp-content/uploads/2016/07/microtwo4-large.gif
  11. 11 https://www.google.com/design/spec/material-design/introduction.html
  12. 12 https://www.smashingmagazine.com/wp-content/uploads/2016/07/microtwo5-large.gif
  13. 13 http://www.elezea.com/2013/09/ios7-parkour/
  14. 14 https://www.smashingmagazine.com/wp-content/uploads/2016/07/microtwo6-large.gif
  15. 15 https://dribbble.com/shots/1640866-Alarm-Material-UI
  16. 16 https://www.smashingmagazine.com/wp-content/uploads/2016/07/microtwo7-large.gif
  17. 17 https://dribbble.com/shots/1849030-Onboarding-for-Muzo-App
  18. 18 https://www.smashingmagazine.com/wp-content/uploads/2016/07/microtwo8-large.gif
  19. 19 https://dribbble.com/shots/1646262-Twitter-Bell-Animated
  20. 20 https://www.smashingmagazine.com/wp-content/uploads/2016/07/microtwo9-large.gif
  21. 21 https://dribbble.com/shots/1961558-Twitter-share-button
  22. 22 https://en.wikipedia.org/wiki/KISS_principle
  23. 23 http://adobe.ly/2aNMUAX
  24. 24 http://adobe.ly/1U9LS0E
  25. 25 http://adobe.ly/1sGB17z
  26. 26 https://creative.adobe.com/products/download/experience-design

↑ Back to topTweet itShare on Facebook

Developers “Own” The Code, So Shouldn’t Designers “Own” The Experience?

Opinion ColumnDevelopers “Own” The Code, So Shouldn’t Designers “Own” The Experience?

We’ve all been there. You spent months gathering business requirements, working out complex user journeys, crafting precision interface elements and testing them on a representative sample of users, only to see a final product that bears little resemblance to the desired experience.

Maybe you should have been more forceful and insisted on an agile approach, despite your belief that the organization wasn’t ready? Perhaps you should have done a better job with your pattern portfolios, ensuring that the developers used your modular code library rather than creating five different variations of a carousel. Or, maybe you even should’ve sat next to the development team every day, making sure what you designed actually came to pass.

Instead you’re left with a jumble of UI elements, with all the subtlety stripped out. Couldn’t they see that you worked for days getting the transitions just right, only for them to drop in a default animation library? And where on earth did that extra check-out step come from. I bet marketing threw that in at the last minute. You knew integration was going to be hard and compromises would need to be made, but we’re supposed to be making the users lives easier here, not the tech team.

1
When many people are involved in a project, it is very important to make sure that they have a common understanding of the problem and its solution. (Image credit: The Next Web2)

Of course, there are loads of good reasons why the site is this way. Different teams with varying levels of skill working on different parts of the project, a bunch of last-minute changes shortening the development cycle, and a whole host of technical challenges. Still, why couldn’t the development team come and ask for your advice on their UI changes? You don’t mess with their code, so why do they have to change your designs around? Especially when the business impact could be huge! You’re only round the corner and would have been happy to help if they had just asked.

While the above story may be fictional, it’s a sentiment I hear from all corners of the design world, whether in-house or agency side. A carefully crafted experienced ruined by a heavy-handed development team.

This experience reminds me of a news story I saw on a US local news channel several years ago. A county fair was running an endurance competition where the last person remaining with their hand on a pickup truck won the prize. I often think that design is like a massive game of “touch the truck”, with the development team always walking away with the keys at the end of the contest. Like the last word in an argument, the final person to come in contact with the site holds all the power and can dictate how it works or what it looks like. Especially if they claim that the particular target experience isn’t “technically possible”, which is often shorthand for “really difficult”, “I can’t be bothered doing it that way” or “I think there’s a better way of doing it so am going to pull the dev card”.

Now I know I’m being unfairly harsh about developers here and I don’t mean to be. There are some amazingly talented technologists out there who really care about usability and want to do the best for the user. However, it often feels as though there’s an asymmetric level of respect between disciplines due to a belief that design is easy and therefore something everybody can have an opinion on, while development is hard and only for the specially initiated. So while designers are encouraged (sometimes expected) to involve everybody in the design process, they often aren’t afforded the same luxury.

To be honest, I don’t blame them. After all, I know just enough development to be dangerous, so you’d be an idiot if you wanted my opinion on database structure and code performance (other than I largely think performance is a good thing). Then again I do know enough to tell when the developers are fudging things and it’s always fun to come back to them with a working prototype of something they said was impossible or take months to implement — but I digress.

The problem is, I think a lot of developers are in the same position about design — they just don’t realize it. So when they make a change to an interface element based on something they had heard at a conference a few years back, they may be lacking important context. Maybe this was something you’ve already tested and discounted because it performed poorly. Perhaps you chose this element over another for a specific reason, like accessibility? Or perhaps the developers opinions were just wrong, based on how they experience the web as superusers rather than an average Jo.

Now let’s get something straight here. I’m not saying that developers shouldn’t show an interest in design or input into the design process. I’m a firm believer in cross-functional pairing and think that some of the best usability solutions emanate from the tech team. There are also a lot of talented people out there who span a multitude of disciplines. However, at some point the experience needs to be owned, and I don’t think it should be owned by the last person to open the HTML file and “touch the truck”.

So, if good designers respect the skill and experience great developers bring to the table, how about a little parity? If designers are happy for developers to “own the code”, why not show a similar amount of respect and let designers “own the experience”?

Communication is key, so be available.3
Everybody has an opinion. However, it’s not a good enough reason to just dive in and start making changes. Image credit: Open Source Way4

Doing this is fairly simple. If you ever find yourself in a situation where you’re not sure why something was designed in a particular way, and think it could be done better, don’t just dive in and start making changes. Similarly, if you hit a technical roadblock and think it would make your lives easier to design something a different way, go talk to your designer. They may be absolutely fine with your suggested changes, or they may want to go away and think about some other ways of solving the same problem.

After all, collaboration goes both ways. So if you don’t want designers to start “optimizing” your code on the live server, outside your version control processes, please stop doing the same to their design.

(vf, il)

Footnotes Link

  1. 1 https://www.flickr.com/photos/thenextweb/5664545340/
  2. 2 https://www.flickr.com/photos/thenextweb/5664545340/
  3. 3 https://www.flickr.com/photos/opensourceway/4371000846
  4. 4 https://www.flickr.com/photos/opensourceway/4371000846
SmashingConf New York

Hold on, Tiger! Thank you for reading the article. Did you know that we also publish printed books and run friendly conferences – crafted for pros like you? Like SmashingConf Barcelona, on October 25–26, with smart design patterns and front-end techniques.

↑ Back to topTweet itShare on Facebook

A Glimpse Into The Future With React Native For Web

A Glimpse Into The Future With React Native For Web

One of the hardest decisions to make when starting a new app is which platforms to target. A mobile app gives you more control and better performance but isn’t as universal as the web. If you’re making a mobile app, can you afford to support both iOS and Android? What about trying to build a mobile app and a responsive web app? Ultimately, the best experience for your customers is for your app to work everywhere, but the development and maintenance costs of that can be prohibitive.

We have already seen how1 React Native can help you make iOS and Android apps with a shared code base, without sacrifices in quality. But what about the web? This is exactly the problem the React Native for Web312 project is trying to solve. Instead of forcing you to maintain two separate code bases for your mobile and web apps, or making a hybrid app, with all its compromises3, React Native for Web is intended to let you write a single app that runs in a browser using standard web technologies, or on iOS and Android as a real native mobile app. While I don’t think the project is ready for production use yet, its potential success could mark a massive change in how large multi-platform applications are built. Let’s jump in!

How It Works Link

You might be thinking, “Wait! doesn’t React already work on the web?” You wouldn’t be wrong. Unfortunately, traditional React and React Native build on a different set of primitives. React uses <div>, <p> and <input>, whereas React Native uses <View>, <Text> and <TextInput>. There are good historical reasons for this, since the building blocks of a web page and of a mobile app are quite different. Nonetheless, it would be great if we could use a single set of shared components.

React Native for Web’s solution is to provide browser-compatible implementations of React Native’s components — meaning, for example, that the <View> of React Native has a DOM-based version that knows how to render to a <div>. While not every React Native component is supported, enough of them are that you could (hopefully) share the majority of your code base.

In addition to the components themselves, styles for React and React Native are written differently. With React, most people use plain CSS or a preprocessor such as Sass4. But in React Native, all styles are written in JavaScript, because there is no DOM and no selectors. With React Native for Web, styles are written just like they would be for React Native, rather than with CSS. This has the benefit of allowing you to write a single set of styles, which will work on both native mobile and the web.

We’ll take a deeper look later at how these ideas work in practice and at how much code is actually reusable. First, let’s get a sample app going.

Starting A New React Native Project Link

To get started, we will need to set up our project. At first, this will just be a regular React Native app, and then we’ll add React Native for Web. If you are following along, you’ll need to complete React Native’s “Getting Started325” guide before heading into the next section.

Once you’ve got React Native installed, you can run the following command from your terminal:

react-native init ReactNativeWeb

This will make a new React Native project named ReactNativeWeb. After it has finished installing, you can cd ReactNativeWeb, and then react-native run-ios or react-native run-android. If everything has gone correctly, you should see a friendly welcome message on your iOS or Android simulator or device.

6
React Native iOS welcome screen (View large version7)
React Native Android welcome screen8
React Native Android welcome screen (View large version9)

Notice that React Native has created two JavaScript files in our project’s directory: index.android.js and index.ios.js. You can edit any of the styles or logic in these files and see those changes update in the running app. As you can probably guess, the .android.js file is for Android, and the .ios.js file is for iOS. Fortunately, separate files are only needed when you want multiple versions of a given file per platform. Most of the time, you’ll have a single file per component.

Managing Dependencies Link

Before we can get our app running in a web browser, we’ll need to get a bit of package installation out of the way. First, run the following to install both the react-native-web package and the official React web packages.

npm i react react-dom react-native-web --save

(You might see some errors about peer dependencies from this command. You should be safe to ignore them, because they didn’t cause me any problems. If newer versions of any of these packages are out when you run the commands, though, you might need to adjust the installed versions.)

At this point, your package.json file should look something like this:

{ "name": "ReactNativeWeb", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start" }, "dependencies": { "react": "15.1.0", "react-dom": "15.1.0", "react-native": "0.28.0", "react-native-web": "0.0.25" } } 

While we have what seems to be everything required for our React Native app to run in a web browser, we must take a brief detour to consider the realities of web development. React Native’s packager compiles your ECMAScript 6 code to something that a phone’s JavaScript engine can understand, but it won’t help us in the browser. If we tried to run our app in a web browser right now, it would quickly fail due to syntax errors.

To solve this problem, we will use Babel10 and webpack11. Babel will compile our ECMAScript 6 code into browser-compatible ECMAScript 5, and webpack will bundle the compiled JavaScript, as well as just generally make development faster. (There are other options for this. If you prefer another compiler or bundler, feel free to use it instead.)

Here are the installation commands to run:

npm i webpack babel-loader babel-preset-react babel-preset-es2015 --save
npm i webpack-dev-server --save-dev

Here, babel-loader and webpack-dev-server will be used to bundle and serve our JavaScript, while babel-preset-react and babel-preset-es2015 tell Babel which plugins we need to compile our code.

Here is what your package.json file should look like now:

{ "name": "ReactNativeWeb", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start" }, "dependencies": { "babel-loader": "6.2.4", "babel-preset-es2015": "6.9.0", "babel-preset-react": "6.5.0", "react": "15.1.0", "react-dom": "15.1.0", "react-native": "0.28.0", "react-native-web": "0.0.25", "webpack": "1.13.1" }, "devDependencies": { "webpack-dev-server": "1.14.1" } } 

Configuring Link

Those are all of the packages we will need. But more setup is required before our app will work in a browser.

webpack.config.js Link

First, we’ll make a webpack config file. This file tells webpack how to build, bundle and serve our compiled code. In addition, we are going to use the alias property to automatically replace imports on react-native with react-native-web. This file should be placed in your project’s root.

const webpack = require('webpack'); module.exports = { entry: { main: './index.web.js', }, module: { loaders: [ { test: /.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015', 'react'], }, }, ], }, resolve: { alias: { 'react-native': 'react-native-web', }, }, }; 

index.html Link

Now, we need to create an HTML file for our app to run in. This will be pretty simple because it will just be a skeleton to attach our React app to.

<!DOCTYPE html> <html> <head> <title>React Native Web</title> <meta charSet="utf-8" /> <meta content="initial-scale=1,width=device-width" name="viewport" /> </head> <body> <div></div> <script type="text/javascript" src="/bundle.js"></script> </body> </html> 

index.web.js Link

Finally, we must make an index JavaScript file for the web. The contents of this file can be the same as index.ios.js or index.android.js, but with one additional line to attach to the DOM. The div with the ID react-app from our HTML file must be selected and then used in the call to AppRegister.runApplication.

import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View } from 'react-native'; class ReactNativeWeb extends Component { render() { return ( <View style={styles.container}> <Text style={styles.welcome}> Welcome to React Native! </Text> <Text style={styles.instructions}> To get started, edit index.web.js </Text> <Text style={styles.instructions}> Press Cmd+R to reload </Text> </View> ); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 5, }, }); AppRegistry.registerComponent('ReactNativeWeb', () => ReactNativeWeb); AppRegistry.runApplication('ReactNativeWeb', { rootTag: document.getElementById('react-app') }); 

Now, just run ./node_modules/.bin/webpack-dev-server --inline to start webpack, and open your browser to http://localhost:8080/12. Fingers crossed, you will see a familiar welcome message but in the browser!

React Native web welcome screen13
React Native web welcome screen (View large version14)

With all of that setup complete, we are ready to start tinkering!

Experimenting With The Code Link

Create a FriendsList.js Component Link

Let’s start by making a friends list. This will be a good simple stress test of React Native for Web, because we need to use a few different components for it: <Image>, <Text>, <View> and <ListView>.

import React, { Component } from 'react'; import { Image, ListView, StyleSheet, Text, View, } from 'react-native'; const styles = StyleSheet.create({ list: { marginTop: 20, }, friend: { flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', }, avatar: { margin: 10, width: 50, height: 50, borderRadius: 25, }, name: { fontSize: 18, color: '#000', } }); export default class FriendsList extends Component { constructor(props) { super(props); const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 }); this.state = { ds: ds.cloneWithRows(props.friends), }; } render() { return ( <ListView dataSource={this.state.ds} style={styles.list} renderRow={(friend) => <View style={styles.friend}> <Image style={styles.avatar} source={{ uri: friend.avatarUrl }} /> <Text style={styles.name}>{friend.firstName} {friend.lastName}</Text> </View> } /> ); } } 

We’ll need to edit our index files, too, so that a friends array gets passed in as a prop.

import FriendsList from './FriendsList'; import React, { Component } from 'react'; import { AppRegistry, Text, View } from 'react-native'; const friends = [ { id: 1, firstName: 'Jane', lastName: 'Miller', avatarUrl: 'https://placehold.it/100x100', }, { id: 2, firstName: 'Kate', lastName: 'Smith', avatarUrl: 'https://placehold.it/100x100', }, { id: 3, firstName: 'Kevin', lastName: 'Yang', avatarUrl: 'https://placehold.it/100x100', }, ]; class ReactNativeWeb extends Component { render() { return <FriendsList friends={friends} />; } } AppRegistry.registerComponent('ReactNativeWeb', () => ReactNativeWeb); 

Upon running it in iOS or Android, you should see something like this:

React Native iOS friends list15
React Native iOS friends list (View large version16)

Looks good so far. Let’s see the web version:

17
React Native web friends list. (View large version18)

Uh oh! Turns out there isn’t any web support yet for ListView’s DataSource, effectively making ListView completely unusable.

Friend.js Link

We can work around this lack of support for now. Let’s make a Friend component for the individual rows, but have a FriendsList component per platform. This will separate out the shared code that works everywhere but allow us to customize each platform where we need to.

import React, { Component } from 'react'; import { Image, StyleSheet, Text, View, } from 'react-native'; const styles = StyleSheet.create({ friend: { flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', }, avatar: { margin: 10, width: 50, height: 50, borderRadius: 25, }, name: { fontSize: 18, color: '#000', } }); export default class Friend extends Component { render() { return ( <View style={styles.friend}> <Image style={styles.avatar} source={{ uri: this.props.avatarUrl }} /> <Text style={styles.name}>{this.props.firstName} {this.props.lastName}</Text> </View> ); } } 

FriendsList.ios.js Link

import Friend from './Friend'; import React, { Component } from 'react'; import { Image, ListView, StyleSheet, Text, View, } from 'react-native'; const styles = StyleSheet.create({ list: { marginTop: 20, }, }); export default class FriendsList extends Component { constructor(props) { super(props); const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 }); this.state = { ds: ds.cloneWithRows(props.friends), }; } render() { return ( <ListView dataSource={this.state.ds} style={styles.list} renderRow={(friend) => <Friend key={friend.id} avatarUrl={friend.avatarUrl} firstName={friend.firstName} lastName={friend.lastName} /> } /> ); } } 

On iOS, our ListView usage code is unchanged. (I’m leaving out the Android code example here and for the rest of the article, for brevity. The Android and iOS code can be the same for the rest of the code samples.)

FriendsList.web.js Link

import Friend from './Friend'; import React, { Component } from 'react'; import { Image, Text, View, } from 'react-native'; export default class FriendsList extends Component { render() { return ( <View> {this.props.friends.map(friend => <Friend key={friend.id} avatarUrl={friend.avatarUrl} firstName={friend.firstName} lastName={friend.lastName} /> )} </View> ); } } 

Now, for the web, we use the map function to render each Friend, similar to traditional React.

React Native friends list on the web, now working19
React Native friends list on the web, now working (View large version20)

Much better. At this point, hearing that ListView requires workarounds might be enough to make you think that React Native for Web isn’t ready for production use. I am inclined to agree, particularly since lists constitute a large percentage of many applications. How much it matters will vary depending on the project, though. On the bright side, all of our other React Native code so far has been completely reusable. In any case, I am still interested in exploring it further, because there is still much potential in the ideas on display here. Let’s continue with our sample app.

Instead of hardcoding a handful of list items, we can use JSON Generator21 to create a long list for us to work with. If you haven’t used it before, JSON Generator is a great tool for creating dummy and development data. Here is the structure I have defined, which adds a few fields on top of what we already have.

[ '{{repeat(200)}}', { id: '{{guid()}}', firstName: '{{firstName()}}', lastName: '{{surname()}}', avatarUrl: 'https://placehold.it/100x100', isOnline: '{{bool()}}', company: '{{company()}}', email: '{{email()}}' } ] 

And here is a snippet of some of the generated data:

[ { "id": "c5368bbe-adfb-424f-ade3-9d783befa2b6", "firstName": "Hahn", "lastName": "Rojas", "avatarUrl": "https://placehold.it/100x100", "isOnline": true, "company": "Orbixtar", "email": "hahnrojas@orbixtar.com" }, { "id": "15ef2834-3ba5-4621-abf1-d771d39c2dd6", "firstName": "Helen", "lastName": "Stout", "avatarUrl": "https://placehold.it/100x100", "isOnline": true, "company": "Ebidco", "email": "helenstout@ebidco.com" }, { "id": "1ef05de1-fd8e-41ae-85ac-620b6d716b62", "firstName": "Floyd", "lastName": "Mcpherson", "avatarUrl": "https://placehold.it/100x100", "isOnline": false, "company": "Ecraze", "email": "floydmcpherson@ecraze.com" }, … ] 

To use it, just take your generated JSON and replace our friends array declaration from before. Of course, you can move that data into its own file if you’d like, so that your code files aren’t cluttered with data. In a real application, we would get that data from an API server.

Friend.js Link

Next, we can add these new fields to the Friend component.

… render() { return ( <View style={styles.friend}> <Image style={[styles.avatar, { borderColor: this.props.isOnline ? '#9d9' : '#d99' }]} source={{ uri: this.props.avatarUrl }} /> <View> <Text style={styles.name}>{this.props.firstName} {this.props.lastName}</Text> <Text style={styles.company}>{this.props.company}</Text> <Text style={styles.email}>{this.props.email}</Text> </View> </View> ); } … 

FriendsList.js Link

Next, add them as props in each platform’s FriendsList.

… <Friend key={friend.id} avatarUrl={friend.avatarUrl} firstName={friend.firstName} lastName={friend.lastName} isOnline={friend.isOnline} company={friend.company} email={friend.email} /> … 
React Native long friends list for iOS22
React Native’s long friends list for iOS (View large version23)
React Native long friend list web24
React Native’s long friends list for the web (View large version25)

So far so good. It is encouraging to see that the core components seem to work well.

Friend.js Link

Next, we can add an animation with a transformation to see how well those work. Let’s make it so that when you tap a row, it animates left and right before returning to its initial position. We will need to add imports for Animated and TouchableOpacity, and wire up the animation and press handler.

import { Animated, TouchableOpacity, … } from 'react-native'; … export default class Friend extends Component { constructor(props) { super(props); this.state = { translateValue: new Animated.Value(0), }; } animate() { Animated.sequence([ Animated.timing(this.state.translateValue, { toValue: 50, duration: 200, }), Animated.timing(this.state.translateValue, { toValue: -50, duration: 200, }), Animated.timing(this.state.translateValue, { toValue: 0, duration: 200, }) ]).start(); } render() { return ( <TouchableOpacity onPress={() => this.animate()} style={[styles.friend, { transform: [{ translateX: this.state.translateValue }]}]}> <Image style={[styles.avatar, { borderColor: this.props.isOnline ? '#9d9' : '#d99' }]} source={{ uri: this.props.avatarUrl }} /> <View> <Text style={styles.name}>{this.props.firstName} {this.props.lastName}</Text> <Text style={styles.company}>{this.props.company}</Text> <Text style={styles.email}>{this.props.email}</Text> </View> </TouchableOpacity> ); } } 

Looks good on mobile.

React Native iOS animation26
React Native iOS animation (View large version27)

What about the web?

28
React Native web animation (View large version29)

No luck. Our TouchableOpacity throws an error when pressed. Apparently, this will be fixed30 in the next release and is only present for our particular combination of versions. Attempting to run the animation without using TouchableOpacity causes the same error, too.

I am going to stop here, but if you want to continue on your own, here is a list of topics you could research next:

  • How well do the remaining React Native components and APIs work? We’ve seen that some definitely don’t work, but we don’t yet have a comprehensive list of support.
  • You could explore more extensive styling work, including media queries.
  • React Native for Web supports server rendering. This could be particularly cool because, if it works, it would mean that you could have a single code base driving native mobile applications and a responsive web app that is SEO-optimized.

Conclusion Link

As you can tell, React Native for Web is definitely not ready for production. There are too many unsupported components, even in our small demo app, for me to feel confident about using it in a real project. The most encouraging thing to me, though, is that the pieces that do work seem to completely work, and the parts that don’t, fail entirely. I find that much preferable to the entire thing just kind of working. At the moment, it seems like the project just needs more time to build support. If everything was only 50% functional, I would view that as a sign that the approach is fundamentally broken.

Despite the problems, I still think this is a very exciting project and worth keeping an eye on.

Resources Link

(da, ml, al)

Footnotes Link

  1. 1 https://www.smashingmagazine.com/2016/04/consider-react-native-mobile-app/
  2. 2 https://github.com/necolas/react-native-web
  3. 3 http://www.apptentive.com/blog/5-points-to-consider-before-making-a-hybrid-mobile-app/
  4. 4 http://sass-lang.com/
  5. 5 https://facebook.github.io/react-native/docs/getting-started.html
  6. 6 https://www.smashingmagazine.com/wp-content/uploads/2016/07/01-react-native-welcome-ios-opt.png
  7. 7 https://www.smashingmagazine.com/wp-content/uploads/2016/07/01-react-native-welcome-ios-opt.png
  8. 8 https://www.smashingmagazine.com/wp-content/uploads/2016/07/02-react-native-welcome-android-opt.png
  9. 9 https://www.smashingmagazine.com/wp-content/uploads/2016/07/02-react-native-welcome-android-opt.png
  10. 10 https://babeljs.io/
  11. 11 https://webpack.github.io/
  12. 12 http://localhost:8080/
  13. 13 https://www.smashingmagazine.com/wp-content/uploads/2016/07/03-react-native-welcome-web-opt.png
  14. 14 https://www.smashingmagazine.com/wp-content/uploads/2016/07/03-react-native-welcome-web-opt.png
  15. 15 https://www.smashingmagazine.com/wp-content/uploads/2016/07/04-react-native-friends-ios-opt.png
  16. 16 https://www.smashingmagazine.com/wp-content/uploads/2016/07/04-react-native-friends-ios-opt.png
  17. 17 https://www.smashingmagazine.com/wp-content/uploads/2016/07/05-react-native-friends-web-opt.png
  18. 18 https://www.smashingmagazine.com/wp-content/uploads/2016/07/05-react-native-friends-web-opt.png
  19. 19 https://www.smashingmagazine.com/wp-content/uploads/2016/07/06-react-native-friends-web-2-opt.png
  20. 20 https://www.smashingmagazine.com/wp-content/uploads/2016/07/06-react-native-friends-web-2-opt.png
  21. 21 http://www.json-generator.com/
  22. 22 https://www.smashingmagazine.com/wp-content/uploads/2016/07/07-react-native-friends-2-ios-opt.png
  23. 23 https://www.smashingmagazine.com/wp-content/uploads/2016/07/07-react-native-friends-2-ios-opt.png
  24. 24 https://www.smashingmagazine.com/wp-content/uploads/2016/07/08-react-native-friends-2-web-opt.png
  25. 25 https://www.smashingmagazine.com/wp-content/uploads/2016/07/08-react-native-friends-2-web-opt.png
  26. 26 https://www.smashingmagazine.com/wp-content/uploads/2016/07/09-react-native-ios-animation-opt.gif
  27. 27 https://www.smashingmagazine.com/wp-content/uploads/2016/07/09-react-native-ios-animation-opt.gif
  28. 28 https://www.smashingmagazine.com/wp-content/uploads/2016/07/10-react-native-web-animation-opt.png
  29. 29 https://www.smashingmagazine.com/wp-content/uploads/2016/07/10-react-native-web-animation-opt.png
  30. 30 https://github.com/necolas/react-native-web/issues/150
  31. 31 https://github.com/necolas/react-native-web
  32. 32 https://facebook.github.io/react-native/docs/getting-started.html
SmashingConf New York

Hold on, Tiger! Thank you for reading the article. Did you know that we also publish printed books and run friendly conferences – crafted for pros like you? Like SmashingConf Barcelona, on October 25–26, with smart design patterns and front-end techniques.

↑ Back to topTweet itShare on Facebook

Web Development Reading List #148: CSS Color Syntax Change, Browser News, And Hidden Expectations

Web Development Reading List #148: CSS Color Syntax Change, Browser News, And Hidden Expectations

I shut down my browser on Wednesday, accidentally having a setting switched on that clears history and all sessions. First, I was sad to have lost many tabs with articles I stored “for later”. At the same time, it felt refreshing, liberating to have a clean browser window with zero tabs open. So my new goal is to start work in the morning with a completely clean browser window at least once a week.

In other news: I spent several hours fixing broken links this week, and as a result I can’t say how happy I am that archive.is1 and archive.org2 exist to prevent content from disappearing forever. Still, some of the resources I found broken have left forever. So remind yourself about redirecting content.

News Link

  • There’s a big change coming up for how we write colors in CSS. Tab Atkins recently changed the color functions syntax3 in the CSS specification. So in future, we will write rgb(0 255 0 / 50%) instead of rgba(0, 255, 0, 50%). This might sound awkward after years of doing it differently, but the reason for it are the new color functions available in CSS Colors Level 4, including color(). You can read more about this in Tab’s blog post, but for now be assured that the old syntax is likely to be supported forever in our browsers thanks to legacy support.
  • Opera 39 and Chromium 52 hit the streets this week and with them a couple of new features4: The Fetch API now supports a custom referrer policy, Performance Observer5 is supported, just like alpha channel for RGB colors in hex notation (#ffffff50), and CSP 3’s strict-dynamic directive is now available as well.
  • The new Docker for Mac and Windows is finally production-ready6 after several months in beta. Great news for all users who eagerly awaited it but always had issues with the previous version (i.e. disk and permission management problems).
  • Big news from Mozilla this week: With Firefox 487, the multi-process engine e10s is now enabled for many users, making Firefox much more robust, faster and more reliable. Also, protection against harmful downloads has been improved8 and unsigned/unverified add-ons won’t load anymore. Web Extensions support9 including CSP enforcements for web extensions is also new, just like the about:debugging developer page. For developers, the DevTools come with an improved font inspector, calc() is now supported for line-height and can be nested, and, last but not least, support for the CSP directive upgrade-insecure-requests has been added, too.
  • Microsoft pushed Edge 14 this week10 and with it a lot of great new things11. Notably, the new version got a lot of accessibility improvements and now competes as one of the best browsers in the HTML5 Accessibility test1412. New features also include extensions and pinned tabs and performance got better to improve battery life, too. Fellow developers will be happy to hear about web notifications, the Fetch API, Beacon Interface, JavaScript’s asyncawait, and support for <time> and WOFF2.
13
The new version of Edge, Edge 14, got a lot of improvements and now scores 100% in the HTML5 Accessibility test1412.

General Link

  • Dave Rupert reflected on hidden expectations15 and why the hardest parts of the web are the ones the client doesn’t see. Accessibility, security, and performance serve very well as main examples for such hidden expectations.

Concept & Design Link

  • In our industry, it’s important to have a connected workflow between design and development16 to make sure we’re aligned and to make real collaboration possible. Subjects like “avoiding assumptions, team up with our peers or sharing knowledge” will help us work together in a better way, says Simon Colijn.

Tools & Workflows Link

  • Users don’t care what tools we use; they care when we ship something useful. A great presentation by Liz Abinante on the simplicity of tooling17 and reasonable choices18.
  • We take GitHub for granted. We pay for it and we use it as the primary end point for our git-repositories. Now Fabio Akita shares why it’s the more expensive option and how you can use the open-source alternative gitlab19 on a pre-configured VPS that is cheaper and more flexible. At least worth reading.

Security Link

  • Proofpoint published a very interesting in-depth analysis of a big malvertising network20 that they found in the wild and that hid itself from plain sight by using steganography and file whitelisting. There’s evidence that they targeted a daily traffic of 1-5 million high-quality client hits.
  • Mathy Vanhoef and Tom Van Goethem presented a new HEIST-attack on HTTPS pages to steal SSNs, email addresses, and more. You can view the slides21 (PDF) or read the write-up22 (PDF) to understand the attack and what you can do to prevent it.
  • Mike West, one of the main persons pushing security web standards at the moment, proposes to introduce an origin-wide policy manifest23 to reduce the risk that security policies aren’t applied to specific resources. The proposal suggests to use a file in the /.well-known/origin-policy/[name-goes-here] directory on the origin server, adapting an already used folder name and path.
  • The well-known security researcher Jonathan Zdziarski found an issue in Whatsapp’s iOS app that seems wide-spread in iOS apps in general: Deleted chats aren’t deleted24, which means that forensic experts could reconstruct them. Any app that uses SQLite on iOS has the same issue since deleted entries are only set “free” to be overwritten instead of actually deleted. In fact, Apple’s Messages app faces the same issues, and cloud sync makes this even worse as it spreads the deleted information to other devices. Jonathan finally shows how to implement an SQLite database in an iOS app to prevent this issue.
25
A wide-spread issue in iOS apps that use SQLite: Deleted entries aren’t deleted26 but only set free to be overwritten. (Image credit: Jonathan Zdziarski27)

Privacy Link

  • The Battery Status API in general sounds like a great addition to our web platform. Initially built by Mozilla to complete the API-set on the web, we can use it on websites to reduce the amount of interactivity and animation or serve videos in low resolutions when the battery is nearly empty, for example. Lukasz Olejnik, however, found out that this API is actually already used28 as a user tracking identifier by ad networks and others. And last but not least, it can also be used to charge more for a service when a user’s battery is low — as reportedly done by Uber29.

Web Performance Link

  • Mattias Geniar had a look at Google’s new QUIC protocol30 that uses UDP instead of TCP and manages to be more reliable and faster — an ideal candidate as a successor to the TCP protocol. While it’s still at an early stage, the IETF is considering to make it a standard, Google uses it for some of their services already, and several server and browser vendors have plans to implement it, too.
  • For very big websites, we often tend to use a CMS, as this seems to be the best option at first glance. But what about choosing a static site generator for better performance and less security risks? Stefan Baumgartner shares his experience with using static site generators at scale31 and how they even built something like a content management system around it.

JavaScript Link

CSS/Sass Link

  • For long articles, a scroll indicator can be very useful to indicate the reading progress. Most people use some sort of JavaScript code to do this (which is calculation-expensive); some people, however, find clever tricks to do it with CSS. The CSS-only scroll indicator35 by Mike Riethmuller is an awesome show-off of using gradients, viewport units and a pseudo-element.

CSS only scroll indicator36 by Mike Riethmuller (MadeByMike37) on CodePen38.

CSS-only scroll indicator by Mike Riethmuller.

Work & Life Link

Going Beyond… Link

  • Simon St. Laurent on decentralizing the web41. Some useful thoughts about our current lock-in on technology, service providers, and centralized solutions, and how we might be able to break that up again to unlock the real power of the web.
  • Katharine Viner writes about how social media swallowed the news42 and how the consequences of this go far beyond journalism. Does the truth even matter any more? An interesting essay on how well-done social marketing has an enormous influence on the decisions people make — no matter if it’s about buying a product or making a political decision.
  • Since the financial crisis, the private equity industry has become hugely influential. The New York Times curated a lovely, interactive story about how private equity plays out in your daily life43.

And with that, I’ll close for this week. If you like what I write each week, please support me with a donation44 or share this resource with other people. You can learn more about the costs of the project here45. It’s available via email, RSS and online.

— Anselm

Footnotes Link

  1. 1 https://archive.is/
  2. 2 https://archive.org/
  3. 3 http://www.xanthir.com/b4iW0
  4. 4 https://dev.opera.com/blog/opera-39/
  5. 5 https://developers.google.com/web/updates/2016/06/performance-observer
  6. 6 https://blog.docker.com/2016/07/docker-for-mac-and-windows-production-ready/
  7. 7 https://blog.mozilla.org/blog/2016/08/02/exciting-improvements-in-firefox-for-desktop-and-android/
  8. 8 https://blog.mozilla.org/security/2016/08/01/enhancing-download-protection-in-firefox/
  9. 9 https://blog.mozilla.org/addons/2016/04/29/webextensions-in-firefox-48/
  10. 10 https://developer.microsoft.com/en-us/microsoft-edge/platform/changelog/desktop/14393/?compareWith=10586
  11. 11 https://blogs.windows.com/msedgedev/2016/08/04/introducing-edgehtml-14/
  12. 12 http://www.html5accessibility.com/
  13. 13 http://www.html5accessibility.com/
  14. 14 http://www.html5accessibility.com/
  15. 15 http://daverupert.com/2016/08/hidden-expectations/
  16. 16 http://simon.fyi/articles/aligning-design-and-development
  17. 17 https://twitter.com/AndyHieb/status/761272450554269696
  18. 18 https://speakerdeck.com/feministy/in-defense-of-static-sites
  19. 19 http://www.akitaonrails.com/2016/08/03/moving-to-gitlab-yes-it-s-worth-it
  20. 20 https://www.proofpoint.com/us/threat-insight/post/massive-adgholas-malvertising-campaigns-use-steganography-and-file-whitelisting-to-hide-in-plain-sight
  21. 21 https://tom.vg/talks/BlackHatUSA2016_HEIST-presentation.pdf
  22. 22 https://tom.vg/papers/heist_blackhat2016.pdf
  23. 23 https://discourse.wicg.io/t/proposal-set-origin-wide-policies-via-a-manifest/1617/4
  24. 24 http://www.zdziarski.com/blog/?p=6143
  25. 25 http://www.zdziarski.com/blog/?p=6143
  26. 26 http://www.zdziarski.com/blog/?p=6143
  27. 27 http://www.zdziarski.com/blog/?p=6143
  28. 28 https://go.lynxbroker.de/eat_heartbeat.js
  29. 29 http://www.telegraph.co.uk/business/2016/05/22/uber-app-can-detect-when-a-users-phone-is-about-to-die/
  30. 30 https://ma.ttias.be/googles-quic-protocol-moving-web-tcp-udp/
  31. 31 https://www.smashingmagazine.com/2016/08/using-a-static-site-generator-at-scale-lessons-learned/
  32. 32 http://blog.goguardian.com/nerds/an-odyssey-to-find-a-sustainable-icon-system-with-svgs-in-react
  33. 33 https://tech.metriccollective.com/of-course-ill-let-you-execute-arbitrary-javascript-code-in-my-users-browsers-3032eca3480e
  34. 34 https://benfrain.com/understanding-native-javascript-array-methods/
  35. 35 https://codepen.io/MadeByMike/pen/ZOrEmr?editors=0100
  36. 36 ‘https://codepen.io/MadeByMike/pen/ZOrEmr/’
  37. 37 ‘http://codepen.io/MadeByMike’
  38. 38 ‘http://codepen.io’
  39. 39 https://newrepublic.com/article/135468/exhaustion-became-status-symbol
  40. 40 http://www.tombartel.de//2016/07/05/recalibrate-your-productivity-sensors/
  41. 41 https://www.oreilly.com/ideas/decentralize-now
  42. 42 https://www.theguardian.com/media/2016/jul/12/how-technology-disrupted-the-truth
  43. 43 http://www.nytimes.com/interactive/2016/08/02/business/dealbook/this-is-your-life-private-equity.html?_r=0
  44. 44 https://wdrl.info/donate
  45. 45 https://wdrl.info/costs/
SmashingConf New York

Hold on, Tiger! Thank you for reading the article. Did you know that we also publish printed books and run friendly conferences – crafted for pros like you? Like SmashingConf Barcelona, on October 25–26, with smart design patterns and front-end techniques.

↑ Back to topTweet itShare on Facebook

7 Reasons to Develop Your Next Web App with Meteor

When I first learned about the Meteor JavaScript framework, I saw someone write, “Meteor is to Node.js as Rails is to Ruby,” and I think that’s a good comparison. A few years ago, Rails was the hot new thingon the web, sprinkling some useful “magic” through the development process to make programming on the web more approachable and pleasant. Out of the countless new frameworks that have spawned as of late though, none have made me feel the way Rails did as much as Meteor — a framework that you should seriously consider using for your coming projects. Here’s a few reasons why.

1. Your applications are real-time by default.

Lately, companies like Twitter and Facebook have been moving toward a real-time web. It’s inevitable that, sooner than you probably expect, users will expect web applications to work near-instantaneously. I imagine there’s already users who wince whenever a separate page load is required for simple tasks like changing settings and logging out.

The problem is, creating real-time web applications is tricky. Or at least, it was. Meteor has real-time built into its core though. When the database is updated, the data in your templates is updated. When a user clicks a button or submits a form, the action occurs immediately. In the vast majority of cases, this doesn’t even require any extra effort. You build a web application as you normally would and, out of the box, it just happens to be real-time.

A while back, the folks at Meteor released a screencast to demonstrate these real-time features, and it’s very much worth a watch, but there’s a range of production applications that do an even better job of showing off the Meteor difference:

These are just a small sample, too.

2. You can develop with just one language.

One of the frustrating parts of being a web developer is the need to wear a variety of hats. You need to think about the front-end, the back-end, and the database, and then there’s another million details that squeeze out the last inch of your mental capacity. Meteor simplifies this process by shrinking the scope of what you need to consider, allowing you to build and manage the front-end, the back-end, and the database with nothing but JavaScript.

This, for instance, is how we create a “collection” — the equivalent of an SQL table – in Meteor:

BlogPosts = new Meteor.collection('posts');

So, we can create a collection with a familiar syntax, but also manipulate a collection with a familiar syntax. Here’s how we insert data:

BlogPosts.insert({
  title: 'Hello World',
  content: 'This is the content.',
  published: true
});

There’s another benefit to writing an entire application with one language. One line of code can run on both the client and the sever and do different things in either environment. Here’s why this matters:

When the statement to create a collection runs on the server it, predictably enough, creates a collection. But when that same statement runs on the client (which it will do by default), it creates a purely local collection within the user’s browser. The user then interfacts with the local collection directly, which is why the data on their screen can change instantaneously, while the local and server-side collections are seamlessly synced in the background.

This doesn’t require any special treatment. You write one line of code and are provided with a boat-load of functionality in addition to being able to use a familiar syntax throughout the development cycle.

3. You can save a lot of time with smart packages.

Let’s say you want to create a user accounts system within a Meteor project. How might you approach it? If your first thought was, “Well, I’d create a collection for the user’s data,” then you’re already thinking too hard.

In Meteor, this is how we create an accounts system:

meteor add accounts-password

We run this command in a terminal, and Meteor adds one of its built-in “smart packages” to the project. This particular package creates an accounts system that expects an email (or username) and password. But what if we wanted to let users sign up with their Twitter account? Then we could write:

meteor add accounts-twitter

Or, with their Google account:

meteor add accounts-google

Or, Facebook:

meteor add accounts-facebook

We could even run all of these commands so our users could choose how they want to sign up.

Meteor also provides an accounts-ui package that creates the front-end of this accounts system, and that only requires one other command:

meteor add accounts-ui

With our account system in place, we can do everything we would reasonably need to do when working on a web application, like checking if the current user is logged in via one of our templates:

{{#if currentUser}}
  <p>You're logged in.</p>
{{else}}
  <p>You're not logged in.</p>
{{/if}}

Or navigating through and manipulating the Meteor.users collection, which is the collection that Meteor creates to store the data of our users.

Smart packages are not just for accounts though. There’s a range of them already available, with more presumably on the way, and they all allow you to do something cool, including:

  • Writing your applications in CoffeeScript.
  • Automatically compiling LESS files into CSS.
  • Integrating extras like D3.js and Bootstrap.

But if smart packages don’t have what you need, then the increasingly large library of third-party packages will probably have you covered.

4. The community is extremely supportive.

Nothing attracts me more to a new framework or technology than an active and vibrant community. I figure that, if the community’s active, then:

  • There’ll be a lot of detailed documentation.
  • I’ll waste less time getting up to speed with the basics.
  • The technology won’t hit the deadpool in the near future.

Luckily, Meteor’s community is already one of its greatest assets. There’s a ton of helpful resources that have spawned from people’s love of the framework, including:

  • Crater, a Reddit-like site for keeping track of what’s happening in the world of Meteor.
  • Evented Mind, a video training site for intermediate developers wanting deeper insight into how Meteor works.
  • Kadira, a performance tracking application that is both easy to use and has a reasonable free plan for getting started.

The official YouTube channel for Meteor has a range of talks from Meteor meetups and there’s plenty of blogs to follow for tips and tutorials:

But if you’re still not satisfied with what’s available, Stephan Hochhaus maintains a huge list of Meteor resources that has a little something for everyone.

5. It’s optimized for developer happiness.

Just about every framework markets itself as a better and more enjoyable way to work. What I appreciate though is Meteor’s attention to detail in holding true to its promise of optimizing for developer happiness.

Take this code, for instance:

<head>
  <title>Your Cool Meteor App</title>
</head>
<body>
  {{> myCoolTemplate}}
</body>

<template name="myCoolTemplate">
  <p>Hello world.</p>
</template>

This is a basic interface for a Meteor application with a template included between the body tags. (For templating, Meteor uses Spacebars — a Handlebars-inspired syntax.)

But notice that:

  • We haven’t included the html tags.
  • We haven’t included any CSS files.
  • We haven’t included any JavaScript files.

…and that’s because we don’t need to do these things since Meteor takes care of them for us. Is this the most significant feature in the world? Nope. But it’s indicative of Meteor’s interest in making every developer’s life that little bit easier at every turn.

Other pleasant details include:

  • A built-in LiveReload feature so you won’t have to manually refresh your browser.
  • The freedom to structure your projects however you want. There are standards you can follow but no strict rules or conventions.
  • The sheer modularity of Meteor that allows you to mix-and-match different components in case one part of Meteor isn’t to your liking.

So while Meteor has its fair share of “magic” and conventions designed to make your life easier, you can still make choices based on your personal preferences. It’s the best of both worlds.

6. It’s friendly to beginner developers.

What surprised me about Meteor was how quickly I was able to start building things that were actually kind of cool. I’d heard people refer to the framework as “easy” but, usually, other people’s definition of that word differs from my own. In this case though, they were right:

Meteor is one of the easiest frameworks for beginners to learn.

It’s still programming, and you’ll want to be familiar with the syntax of JavaScript — variables, loops, conditionals, JSON, etc. — but you don’t need to be a JavaScript ninja to make a start. You don’t even need prior experience with making web applications (it’s a great choice for front-end developers looking to bolster their skillset). You might not grasp all of the concepts right away but that won’t stop you from enjoying the practical side of things.

As for why Meteor is such a great fit for beginning developers, it’s mostly for the same reasons that I recommend Meteor in general:

  1. You only need to know a single language.
  2. There’s a ton of community-made resources.
  3. It’s optimised for developer happiness.

So even if you stumble across a slight hump when learning Meteor, just push a little further and I think you’ll find that those humps are few and far between.

7. It’s ahead of the tech curve.

Like I said earlier, the web is becoming a real-time environment, but the shift won’t happen purely based on the actions of the big companies with the big budgets. The shift will happen as tools become available that allow small teams and individual developers to make real-time applications quickly and easily. Meteor is amongst the first wave of this tools and its “all in one” approach is surely going to make it a big player in the coming years.

The folks at Meteor have stated their long-term mission, and to put it plainly, their mission is huge:

…to build a new platform for cloud applications that will become as ubiquitous as previous platforms such as Unix, HTTP, and the relational database.

Can they pull this off? No one can say with absolute certainty, of course, but they have the funding, the community, and the ever-important balance of being great for developers and great for end-users. So at the very least, they’re on the right track (and it’s a track where I’m glad to be tagging along for the ride).

Conclusion

As of writing these words, Meteor is still young at version 0.8.2, but the releases are coming big and quick, and a range of impressive Meteor-built apps are live and being used on the web. Your particular situation will determine whether or not a particular framework is the right fit for you and your creations, but every developer owes it to themselves to at least play with Meteor for a day or two. I haven’t had this much fun with programming on the web in a long while and there’s a good chance you’ll feel the same way.

Was this helpful? – 

Meet the author
David Turnbull is the author of the Meteor Tips blog, a regular source of tips, tricks, and tutorials for the Meteor JavaScript framework. He’s currently hard at work on a screencast series for beginning developers to get started with Meteor.
 

https://www.meteor.com/install
https://docs.meteor.com

Web Development Reading List #147: Security Guidelines, Accessible UI Components, And Content-First Design

Web Development Reading List #147: Security Guidelines, Accessible UI Components, And Content-First Design

When working in a team, it’s important to stick to rules. A common challenge is to build all your projects with a similar or the same toolset and coding guidelines. Only yesterday I discussed how we could port over a project that outgrew its initial codebase over the years to a fresh, React.js-based source code.

The decision for this wasn’t easy, since we had invested quite a lot of work and money into this project already, and a move to React would require quite some time, too. But since the switch makes sense from a technical perspective and the team is already using React for three other projects, we concluded that this would be a good step to do. It will enable more developers of the team to contribute to the project, to review code and to reduce the shift of technologies in the company. Occasionally, it’s time to re-evaluate your projects and move on.

News Link

  • Bootstrap 4 Alpha 31 has been released this week. It comes with an overhauled grid, updated form controls, a system font stack, and more.
  • Microsoft announced that their JavaScript engine ChakraCore2 now supports Mac OS and Linux. This means, you can now test and run your Node.js applications not only in Google’s V8 engine. Christian Heilmann wrote up why this is an important step3.
4
Good news for Mac and Linux users: ChakraCore is finally supported5. (Image credit: Christian Heilmann6)

Concept & Design Link

Tools & Workflows Link

  • If you work on small projects, an (S)FTP-client can still be very useful. But on the other hand, it means you need to manually copy files from your git workflow to the server. To solve this issue, the indie developer Jan Östlund built GitFTP-Deploy8, a handy (S)FTP tool for a small fee that does automatic deployments based on your git workflow.
  • The privacy/tracking issue is bigger than we think. Have you ever monitored which apps connect to which service? You suddenly realize that an ad blocker/privacy add-on in your browser is only a drop in the bucket. Apps often connect to Google services, Google Analytics, sometimes to various ad networks, and very often to New Relic’s user tracking service. Fortunately, there’s a solution to nearly every problem: Add tracker hostnames to your /etc/hosts file. There’s even a public sample hosts file that you can use9 that includes most ad networks and trackers. Use it at your own risk though and be aware that some apps might not work anymore. But maybe your privacy is worth it?

Security Link

  • FallibleInc’s “A practical security guide for web developers10” tries to help developers build more secure, less vulnerable solutions. While they claim that it’s by no means a comprehensive guide, it covers stuff based on the most common issues they’ve discovered in the past.
  • We know that HTTPS is not super-secure. That’s why lately a lot of bugs were fixed in the software implementations and a lot of techniques like HSTS and HPKP were added. But sometimes all of this won’t help. Recently, an attack was discovered that can be carried out by operators11 of just about any type of network, including public Wi-Fi networks, which arguably are the places where people need HTTPS the most. There are also hints that this type of attack is already in use by at least the NSA and therefore likely by a lot of other people, too. Please never trust TLS only for your own security but use a VPN for public networks.
HTTPS protection12
Even when the Wi-Fi can’t be trusted, people rely on HTTPS to secure their connection. A fallacy, as a recently-discovered attack13 shows. (Image credit: Ars Technica14)

Privacy Link

  • I don’t want to be the scapegoat here, but Pokémon Go is very popular, and I read some interesting things about the privacy of the game. For example, not only Alphabet (aka Google) is one of the main investors, but there’s also a financial relationship between the game-maker Niantic and the CIA angel investment company In-Q-Tel15. While there’s no evidence on what this could mean for the privacy of users, it definitely means that those companies are highly interested in the data that is provided by the gamers — understandable, as it’d be very hard to get geo information and pictures of private ground in a normal way. I’ve heard that several companies such as BMW already advised their employees that it’s forbidden to play the game at their factory sites and the German army published a similar order to their soldiers. ExpressVPN also published a short summary list with nine privacy issues to consider when playing Pokémon Go16.

Web Performance Link

  • Erik Duindam writes about how a good architecture can save you a lot of money when building a product. He shares how he built a Pokémon Go app with 500k users in just five days17 and reduced the costs of it to a $100/month server infrastructure, compared to many MVP products that burn money by choosing bad technical designs.
  • Jake Archibald shares an interesting little fact about the benefits of using rel=noopener: it’s faster18.

Accessibility Link

JavaScript Link

CSS/Sass Link

Work & Life Link

Multitasking27
What happens when you give up multitasking for a week? Lydia Dishman found out28.

Going Beyond… Link

And with that, I’ll close for this week. If you like what I write each week, please support me with a donation32 or share this resource with other people. You can learn more about the costs of the project here33. It’s available via email, RSS and online.

— Anselm

Footnotes Link

  1. 1 https://blog.getbootstrap.com/2016/07/27/bootstrap-4-alpha-3/
  2. 2 https://github.com/Microsoft/ChakraCore
  3. 3 https://www.christianheilmann.com/2016/07/27/why-chakracore-matters/
  4. 4 https://github.com/Microsoft/ChakraCore
  5. 5 https://github.com/Microsoft/ChakraCore
  6. 6 https://www.christianheilmann.com/2016/07/27/why-chakracore-matters/
  7. 7 http://jgthms.com/web-design-in-4-minutes/
  8. 8 https://eastwest.se/apps/gitftpdeploy
  9. 9 http://winhelp2002.mvps.org/hosts.txt
  10. 10 https://github.com/FallibleInc/security-guide-for-developers
  11. 11 http://arstechnica.com/security/2016/07/new-attack-that-cripples-https-crypto-works-on-macs-windows-and-linux/
  12. 12 http://arstechnica.com/security/2016/07/new-attack-that-cripples-https-crypto-works-on-macs-windows-and-linux/
  13. 13 http://arstechnica.com/security/2016/07/new-attack-that-cripples-https-crypto-works-on-macs-windows-and-linux/
  14. 14 http://arstechnica.com/security/2016/07/new-attack-that-cripples-https-crypto-works-on-macs-windows-and-linux/
  15. 15 https://medium.com/friction-burns/pokémon-spy-17087ae3653d
  16. 16 https://www.expressvpn.com/blog/pokemon-go-privacy-concerns/
  17. 17 https://medium.com/unboxd/how-i-built-an-app-with-500-000-users-in-5-days-on-a-100-server-77deeb238e83#.91iwcl397
  18. 18 https://jakearchibald.com/2016/performance-benefits-of-rel-noopener/
  19. 19 https://medium.com/@addyosmani/accessible-ui-components-for-the-web-39e727101a67
  20. 20 http://accessibility.voxmedia.com/
  21. 21 http://blog.thoughtram.io/angular/2016/07/27/custom-form-controls-in-angular-2.html
  22. 22 http://krasimirtsonev.com/blog/article/react-js-in-design-patterns
  23. 23 https://css-tricks.com/full-width-containers-limited-width-parents
  24. 24 https://css-tricks.com/full-width-containers-limited-width-parents/#article-header-id-6
  25. 25 http://www.paperplanes.de/2015/9/28/always-improve-never-appreciate.html
  26. 26 https://www.fastcompany.com/3062183/your-most-productive-self/what-happened-when-i-gave-up-multitasking-for-a-week
  27. 27 https://www.fastcompany.com/3062183/your-most-productive-self/what-happened-when-i-gave-up-multitasking-for-a-week
  28. 28 https://www.fastcompany.com/3062183/your-most-productive-self/what-happened-when-i-gave-up-multitasking-for-a-week
  29. 29 http://www.flassbeck-economics.com/how-climate-change-is-rapidly-taking-the-planet-apart/
  30. 30 https://www.washingtonpost.com/news/energy-environment/wp/2016/07/19/greenland-lost-a-trillion-tons-of-ice-in-just-four-years/
  31. 31 https://eager.io/blog/the-languages-which-almost-were-css/
  32. 32 https://wdrl.info/donate
  33. 33 https://wdrl.info/costs/
SmashingConf New York

Hold on, Tiger! Thank you for reading the article. Did you know that we also publish printed books and run friendly conferences – crafted for pros like you? Like SmashingConf Barcelona, on October 25–26, with smart design patterns and front-end techniques.

↑ Back to topTweet itShare on Facebook

6 key tips to taking your business global

If your business has seen successful growth in the US, it most likely will see success in other countries as well. And, you may want to lock up those markets, before some other company does.

I recently met a startup that had successfully tripled its revenues – largely from the results of a successful international expansion effort and wanted to share those learnings with all of you.

Pick your markets

All Killer, No Filler

We’re bringing Momentum to New York: our newest event, showcasing only the best speakers and startups.

There are 195 countries in the world. How do you even know where to start?

Many US companies go after the path of least resistance: In other English speaking countries, like Canada, the United Kingdom, Australia and New Zealand, typically in that order of closest to home.

While that is certainly a good strategy, a better strategy is figuring out which countries have the highest demand for your products. For example, if you’re selling into the auto industry, perhaps big auto markets like Japan and Germany may be the best place to start.

Like anything, there will be an 80/20 logic here, where 80 percent of your international sales will come from 20 percent of your international markets. So, carefully prioritize your efforts.

Pick your structure

There are many ways to take your business global, with various levels of complexity and investment. You’re going to need to decide between opening our own office overseas, leveraging key in-country distributors or striking channel partnerships with key companies that have access to your target customers, based on your goals and budgets.

And, the solutions you use in one country, may not be the same solution you use in others, depending on the challenge in those markets. For example, in China, you’ll need a local company to partner with, to help you navigate the local market.

Where you can, setting up your own efforts, either as a startup or via an acquisition of a local player, will typically exceed the results of piggy backing on the efforts of others.

Learn the local rules

Every country has different “rules of engagement”. And, when you’re getting started, it’s often helpful to engage an international expansion consulting firm, that can help you quickly learn all the local laws, regulations, accounting rules, business taxes, government taxes, employment vs contractor rules, compensation rules, privacy rules, etc.

And, don’t underestimate the downside risks from things like bribery payments, organized crime and other corruption in various countries, which you never want to partake in, or risk going to jail.

These varying rules can make the difference in deciding whether or not those markets make sense for you.

Localize your fulfillment

Make sure you have a plan for communicating in foreign markets.

You’ll have to think through all the back office tasks for your business and how it will be different overseas.

Who will be answering the phones (in the local language and during local business hours), how will products be warehoused and shipped, how will you collect payments from customers, how will you process payroll payments, into which bank accounts, who is going to train your local customers, who is going to service local customers post sale, etc.

Often times, it’s like building a whole new fulfillment process from scratch.

Localize your marketing efforts

Every country has a unique culture of its own. And, you need to tailor your marketing creatives into the messaging that will most resonate with the local market and stand out against local competitors (who are most likely different companies than the ones you’re competing with in the US).

If you’re already successfully selling into global companies today, be sure to ask your US contacts at those companies for introductions to their counterparts in the countries you desire to enter.

Anyway, hope you found this high level introduction to the topic helpful. Global expansion is a really tricky topic to cover is a short post, given all its complexities by country, so be sure to surround yourself with expert consultants, lawyers and other global entrepreneurs that can help you here.

This post originally appeared on Red Rocket.

 

3D printers could replicate your fingerprints to help unlock phones – even after you’re dead

Fusion reports that police officers contacted Michigan State University professor Anil Jain recently to recreate a dead man’s fingers using a 3D printer, so they could unlock his phone and sift through its content for clues.

Details are scare because the investigation is still underway. But Jain said that the deceased person in question was the victim in a murder case, not the attacker. Law enforcement officials had his fingerprints on file as he was arrested in a previous incident, and handed those over to Jain for replication.

All Killer, No Filler

We’re bringing Momentum to New York: our newest event, showcasing only the best speakers and startups.

The victim’s phone hasn’t yet been unlocked – Jain has created replicas of all ten digits, but is still working to refine them so the plastic fingers coated with metallic particles can be read by a fingerprint scanner as easily as human fingers, which are more conductive.

If this method works, it’ll prove once again that fingerprints aren’t as secure as we’d like to believe when it comes to locking our digital devices.

In October 2014, a Virginia court ruled that suspects can be asked to unlock their phones using their fingerprints. In contrast, PINs are more secure because the Fifth Amendment prevents government agencies from compelling people to turn over things in their minds, like memorized passcodes.

It’s also worth keeping in mind that phones locked with a fingerprint usually require a PIN to be entered if it hasn’t been used in 48 hours, or if it’s been powered off and back on again. In both instances, fingerprints are of no help, regardless of how they’re obtained.

This case could also set a precedent for law enforcement gaining access to people’s phones more easily. If a person has been arrested and their mobile device has been confiscated, they could be asked to merely submit to a fingerprint scan that would give police everything they need to create replicas for unlocking a phone.

The extent to which fingerprints and PINs can help protect our privacy seems to be rather limited; ultimately, what we really need is transparency and oversight when it comes to how our digital data is handled by law enforcement and government agencies.

Police asked this 3D printing lab to recreate a dead man’s fingers to unlock his phoneon Fusion

Read next: 6 key tips to taking your business global

Hackers can steal your iOS and Mac passwords with a single image file

A new vulnerability discovered by a Cisco researcher could allow hackers to gain access to the internal storage and stored passwords on your iOS or Mac device – and all they’d have to do is send you a malicious image file.

Tyler Bohan of Cisco Talos found that a TIFF format file – sent via MMS, email or placed on a webpage that a victim is guided to visit – can hide malware which can run automatically, without being detected.

All Killer, No Filler

We’re bringing Momentum to New York: our newest event, showcasing only the best speakers and startups.

In addition to beaming across your authentication credentials on iOS, Mac OS X, tvOS and watchOS, the vulnerability can also allow attackers to remotely control Macs which don’t support sandboxing.

Thankfully, these issues have been patched by Apple; you’ll need to update to the latest versions of their operating systems – iOS 9.3.3, El Capitan 10.11.6, tvOS 9.2.2 and watchOS 2.2.2 – to stay safe.

If this sounds familiar, it’s because the security flaw is eerily similar to the Stagefright vulnerability discovered in Android devices last year. After it was spotted last August, a second version was uncovered in which hardware could be compromised by sending across an audio file.

Vulnerability Spotlight: Apple Remote Code Execution With Image Fileson Talos Blog

Read next: Use this map to find Pokémon in real-time before you head out to play Pokémon Go

Snowden is designing a tin foil hat for your iPhone

Not-so-fun fact: your smartphone can be tricked into transmitting signals even when it’s turned off. That means it can be used to track your location without your knowledge. And NSA whistleblower Edward Snowden is having none of it.

That’s why he’s collaborating with famed hardware hacker Andrew “Bunnie” Huang to create an iPhone 6 case that can detect whether your phone is transmitting data when it’s not supposed to. The idea is to protect journalists, rights workers and the like from being tracked by governments and to expose their agencies’ efforts to spy on such people.

All Killer, No Filler

We’re bringing Momentum to New York: our newest event, showcasing only the best speakers and startups.

The case is still just a concept at this point, but the duo have published a paper describing its design. Essentially, it will feature probe wires that access the phone’s antennae through the SIM slot to monitor them signal transmission. A display on the outside of the case, along with audible alarms, informs users of the phone’s status.

It certainly might be overkill for ordinary civilians who harbor only minor distrust in their governments, but it might be just the thing for journalists who cover sensitive issues in areas of conflict.

In their paper, Snowden and Huang cited the case of American reporter Marie Colvin of The Sunday Times, whose family claims she was tracked by the Assad regime in Syria and killed for covering stories about civilian casualties.

Countering Lawful Abuses of Digital Surveillanceon Bunnie’s Blog

Read next: Hackers can steal your iOS and Mac passwords with a single image file

10 Awesome WordPress Features That You Probably Didn’t Know Existed

WordPress comes with so many awesome features and is continuously changing. Some of these features may not get the attention they deserve and remain a little hidden. In this article, we will show you 10 awesome WordPress features that you probably didn’t know existed.

1. Show/Hide Things Using Screen Options

You may have noticed the Screen Options button on some pages of your WordPress admin area. This Screen Options button allows you to show and hide items on the WordPress admin screen you are currently viewing.

Many beginner WordPress users are unaware of this feature. It allows you to simplify your admin pages like post edit screen to meet your workflow.

2. Move, Add, or Delete Dashboard Widgets

By default, users are redirected to the dashboard page in WordPress admin area when they login. The dashboard page has several handy shortcuts pointing to different sections of your website.

These sections are divided into different boxes called dashboard widgets. You can click on the Screen Options button to show or hide these boxes. You can also drag and drop them to rearrange items on your WordPress dashboard.

3. Paste URL to Make Links in Visual Editor

WordPress 4.5 introduced inline link editing in the visual editor.

Many users didn’t realize that instead of using a popup to paste a link, they can just select a text and press CTRL+V (Command+V on mac) to paste the URL. The visual editor automatically converts it into a link.

4. Accessibility Mode for Widgets

We all like how easy it is to just drag and drop widgets into sidebars. However, for many users it is not easy to drag and drop things using a mouse or trackpad.

WordPress also comes with a hidden accessibility mode for widgets. This accessibility mode makes it easier to add widgets without draging and dropping the items.

Accessibility mode for WordPress widgets can be activated by clicking on Screen Options button on the Appearance » Widgets page.

5. Preview Themes Without Activating Them

Many users worry that changing their WordPress theme will have unwanted consequences for their website. Their concern is genuine, that’s why we prepared a checklist of things you must do before changing your WordPress theme.

One of the things you can do is to test the new theme without activating it. Simply install your new WordPress theme and then go to Appearance » Themes page.

Take the mouse to the newly installed theme’s thumbnail and then click on Live Preview button. WordPress will launch the theme customizer showing preview of your website using the new theme.

6. Edit Images in WordPress

WordPress makes it easy to add images to your posts and pages. What many beginners don’t know is that WordPress also comes with some basic image editing features.

Simply visit Media » Library page and then click on any image. From the image details popup you can click on the Edit Image button.

In the image editing mode, you can crop, rotate, and resize an image. You can also flip an image in horizontal or vertical directions. These image editing features come in handy when you need to quickly crop or resize a large image file directly from WordPress.

For more details, see our guide on how to crop, rotate, scale, and flip images in WordPress.

7. Split Single Post into Multiple Pages

Want to split a lengthy post into multiple pages? Simply add <!–nextpage–> tag in your post and WordPress will split it into two pages. Add the tag again if you want to split it into more pages.

This feature is particularly helpful if you are writing an unusually lengthy article and don’t want users to scroll to much.

See our guide on how to split WordPress posts into multiple pages for more details on post pagination.

8. Embed Links, Videos, and Multimedia

WordPress automatically embeds content from some of the most popular websites like YouTube, Twitter, Instagram, etc. All you need to do is paste a URL from one of the supported sites and WordPress will automatically embed it for you.

Since WordPress 4.4, all WordPress sites have become oEmbed service providers themselves. This means you can paste URL from another WordPress site into your post and WordPress will embed the post for you.

9. Hidden Secret Options Page in WordPress

WordPress comes with a hidden master page for all your blog options. This page is hidden because users can easily mess things up here, so we don’t want you to use it. But you should definitely check it out. You can access it by visiting this URL:

http://example.com/wp-admin/options.php

Replace example.com with your own domain name. You will see a page with a long list of options. For more details see our guide on the hidden secret options page in WordPress.

10. Markdown and Keyboard Shortcuts Help you Write Faster

Most WordPress users spend more time writing content than anything else on their site. This is is why WordPress developers are always trying to improve the writing experience in WordPress.

WordPress comes with a whole range of keyboard shortcuts that you can use to write faster. Apart from these shortcuts, you can also use Markdown like formatting shortcuts. Just enter the formatting shortcuts and WordPress will convert them into HTML.

  • Using * or will start an unordered list.
  • Using 1. or 1) will start an ordered list.
  • Using # will transform into h1. ## for h2, ### for h3 and so on.
  • Using > will transform into blockquote.

You can also disable these formatting shortcuts if you want.

We hope this article helped you discover some awesome WordPress featured that you probably didn’t know about. You may also want to see our list of 10 WordPress plugins that will quickly help you get more traffic.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.