this guy used react to fly a drone and you won't believe what happened next...

warning

OVER-REACTING AHEAD

the one way to make things fly  with javascript

npm install rolling-spider

5 lines that will literally  make
your drone take off

var RollingSpider = require('rolling-spider');
var client = RollingSpider.createClient();
 
client.connect(function () {
  client.setup(function () {

    client.takeOff();

  }
});

I thought socket.io was over
until i saw this

socket.io makes backends
talk to browsers

and backends talk to drones

socket.on('takeoff', () => {

  drone.takeoff()
    .then(function() {
      socket.emit('didTakeoff');
    });

});

Browser: yo make this drone takeoff

SocketIO: yo drone, takeoff!

Drone: I'm hovering, notify your boss

wait until you see how React saved the day (and this talk)

The user can interact with React

React can talk to socket.io

do you see it yet?

here's how react flies a drone with 5 lines

class App extends React.Component {
  render() {
    return (
      <a href="" onClick="{this.takeoff}">
        Take off
      </a>
    );
  }

  takeoff(e) {
    e.preventDefault();
    socket.emit('takeoff');
  }
}

The flow

  1. User  asks React to fly the drone
  2. React asks Socket.IO to fly the drone
  3. Socket.IO asks the drone to fly the drone
  4. Drone flies
  5. What could possibly go wrong?

this drone just took off. 

Wait to see what happened next.

This is a real picture. My drone was actually destroyed. Thanks JavaScript!

NO drama, but lets find the drone
we need and deserve

If this doesn’t work, Cloudspace’s CTO said he’d cancel all the meetups

too soon?

this meetup's existEnce depended on this demo

MY ULTIMATE GOAL WITH THIS TECHNOLOGY
IS THAT IT GETS ACQUIRED BY AMAZON.

Because it’s written in JavaScript, it can easily connect to the cloud if you fly it high enough

i thought the meetup was over until I saw this

quick question before we close:

what did we just build?

an app that flies drones.

the tech stack is IRRELEVANT.

  • Backend could have been anything
  • Frontend could have been plain jQuery
  • Bottom line: the drone flies, that's what matters.

REACT helps and has NICE FEATURES

But it's not the thing.
your product is the thing.

focus on building the real THING.

also:  value your community

  • This app was built with open source technologies
  • Somebody took the time to make each piece work
  • Let's be grateful to those guys and give back

Lastly: give your neighbor a HIGH FIVE

thank them for making universityjs awesome!

Today is our first anniversary, and the last event as we know it.

You all deserve a round of applause. Specially you Katelyn!

Flying a drone with JavaScript

By Sergio Cruz

Flying a drone with JavaScript

In this talk I go over a little pet project I've been playing with for a while: flying parrot drones using JavaScript. More specifically I used socket.io and React along with the `rolling-spider` repo to make this all come together. If you're interested in the technology used to run this demo, here's the repo for it: https://github.com/sergiocruz/universityjs-react-drone

  • 3,610