How to use TypeScript with Node

  • For example:

    //Typescript
    class Test {
    //field
    name:string;
    //constructor
    constructor(name:string) {
    this.name = name
    }
    //function
    display_name():void {
    console.log(“name is : “+this.name)
    }
    }
    //javascript
    var Test = (function () {
    //constructor
    function Test(name) {
    this.name = name;
    }
    //function
    Test.prototype.display_name = function () {
    console.log(“name is : ” + this.name);
    };
    return Test;
    }());

    In the snippet above, notice that it is easier to read the TypeScript version of the code than the JavaScript Version.

  • Getting Started
    To install TypeScript globally so you can call it when needed, run:
    npm install -g typescript

    For verification of the installed TypeScript, use the tsc –v command:
    tsc –v
    //Version 2.1.6

    Next, install gulp for the build process.

  • To do that, we run:
    npm install gulp gulp-typescript typescript –save

    Doing just this setup done might be enough, but you would have to go back to the terminal to run the tsc command every time a change occurs.

  • Now, put the following contents into the gulpfile.js:
    const gulp = require(‘gulp’);
    const ts = require(‘gulp-typescript’);

    // pull in the project Typescript config
    const tsProject = //task to be run when the watcher detects changes
    gulp.task(‘scripts’, () = {
    const tsResult = tsProject.src()
    .

  • const server = http.createServer(App);
    server.listen(port);
    server.on(‘listening’, onListening);

    //function to note that Express is listening
    function onListening(): void {
    console.log(`Listening on port `+port);
    }

    This has imported the HTTP module from node.

Learn how you can create an app with TypeScript and Node.js, using Gulp to automate the building process and Nodemon to restart the server.
Continue reading “How to use TypeScript with Node”

We had a great time speaking with @naoufal about #ReactNative on the latest episode #JavaScript

  • In this episode, we’re joined by Naoufal Kadhom, a Software Engineer from Netflix who’s also just released a payment library for React Native.
  • In the episode, we’ll be discussing React Native and what it’s like to leverage it for Android and iOS applications.

In this episode, we’re joined by Naoufal Kadhom, a Software Engineer from Netflix who’s also just released a payment library for React Native. In the episode, we’ll be discussing React Native and what it’s like to leverage it for Android and iOS applications.
Continue reading “We had a great time speaking with @naoufal about #ReactNative on the latest episode #JavaScript”

Galaxy Client Planning · Issue #4424 · galaxyproject/galaxy · GitHub

  • Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
  • Already on GitHub?
  • Sign in to your account

galaxy – Data intensive science for everyone.
Continue reading “Galaxy Client Planning · Issue #4424 · galaxyproject/galaxy · GitHub”

Getting Started with Expo React Native and Styled Components using a Netflix Clone example

  • For me it opens it up in Sublime Text Editor, but since I prefer to use WebStorm, I just manually find where the project was created and open the project using WebStorm.Your initial project structure should look something like this:Lets create the basic outline of this project, I like to structure my project by putting everything in a ‘src’ folder and then splitting it up from there.Create a ‘src’ folder and create a ‘components’ directory with a ‘common’, ‘navigation’, and ‘screens’ subdirectories.
  • I also use this file to store any other common styling attributes such as font sizes, and padding/margin lengths.You will also need to grab some images and put them in your /assets directory or you can use the ones that I picked out in here: grab the Netflix logo icon and put it under assets/icons directory: project directory structure should look something like this:I like to make my imports look clean, so I would recommend that you install the babel plugin `babel-plugin-module-alias`.
  • babelrc file, (located in your root project directory) you will need to add the module-resolver field and since we’re having all our files in the /src directory, you need to set the root to src .
  • babelrc file should look like this:Now lets install react-navigation and styled-components by going into the terminal and navigating to the root project directory, and type in `npm install react-navigation — save“npm install Constants and Dummy DataIn our constants/styles.
  • js like so:In your we can now use our HomeScreen and ShowDetailsScreen in the StackNavigator config, like so:Now lets go back to our App.js file, and create a DrawerNavigator with the HomeStackNavigator as it’s initial route in the drawerRouterConfigNow hopefully if everything works, you should be able to load up the iOS simulator and you should see something like this:All the code is has been a really great tool to bootstrap my react native projects and I highly recommend it to anyone that wants to quickly get started with React Native.

In your /src/components/navigation/home-stack-navigator.js , we can now use our HomeScreen and ShowDetailsScreen in the StackNavigator config, like so: Now lets go back to our App.js file, and create…
Continue reading “Getting Started with Expo React Native and Styled Components using a Netflix Clone example”

Note App Deployed — What have I learned ? – Comfort Ajala – Medium

my first react/js template app has been deployed! 
#reactjs #coding #Webdesign #webdev

  • Screenshot of the application: can be found under noteapp.ajalacomfort.comFew weeks ago, I embarked on a project based learning journey to improve my practical knowledge in web development.
  • So I began building a CRUD application with user authentication and authorization.
  • Thus basically a full-stack application on JS.Today I am proud to say the app is deployed on Heroku with the database hosted on mLab.
  • Yes the app is a very simple CRUD app, but it taught me a lot more than the 300 pages books I have read on JS.I have been drawn to project based learning as a result of this project and in this post I would like to list what I have learned as well as, what I plan to do next in my journey.You can find the application under: I have learnedJs Templating — EJSReact.js + ReduxToken based route Authentication and AuthorizationServer Rendering React ComponentsReusing componentsCSS TransitionsNode App DeploymentNoSQL — MongoDBAPI developmentThese are the main points I have understood via this project and I am proud of myself.I plan on creating a progressive web or/and a cross platform version via react-native after correcting a number of flaws in the app functionality and style.
  • Now I know my weaknesses, I will focus on those cracks in my upcoming projects.I am just excited to have an app deployed online for prospective employers to use as a meter instead of mere claims of my abilities in web dev.YT Channel: Ajala ComfortSee ya soon!

Few weeks ago, I embarked on a project based learning journey to improve my practical knowledge in web development. So I began building a CRUD application with user authentication and authorization…
Continue reading “Note App Deployed — What have I learned ? – Comfort Ajala – Medium”

Announcing “Advanced React.js Online” – componentDidBlog

  • I can barely believe it, but over the last 27 months, Michael Jackson and I have taught React.js to over 3,500 developers at 91 workshops in eight different countries (Oh, and one prison cell in the UK, but I digress…)In that time we’ve learned a lot about React as library authors, product developers, and teachers.We’re the authors of React Router.
  • That kind of usage has exposed us to the needs of all sorts of applications, pushing us to find simpler ways to be composable as library authors.Meeting 3,500 people (and more at the meet ups we regularly attend in our travels) has put a lot of code in front of us, and even more conversations about code.
  • It’s been fun learning the unique needs of all these people and figuring out ways to make their code better as product developers.Teaching React to thousands has helped us identify parts that some folks initially struggle with.
  • This helps us refine our material one workshop at a time, making us much better teachers.We’re happy to announce that we’re bringing all of that experience to you in our very first online course: Advanced React.js.
  • We’ve taken the most popular parts of our workshops and put them into the course.

Ninety-one. I can barely believe it, but over the last 27 months, Michael Jackson and I have taught React.js to over 3,500 developers at 91 workshops in eight different countries (Oh, and one prison…
Continue reading “Announcing “Advanced React.js Online” – componentDidBlog”

React Progressive Web Apps — Part 1 – Gethyl George Kurian – Medium

  • How to create your first PWA app and/or convert your existing app into PWA.In this example I created new React app with PWA in mind, but the idea should be quite similar if you have to convert your existing app into PWA.You need to understand the lifecycle of a SW, which are listed below, and you can read more about it in this link.Register the Service Worker(SW)If a browser supports SW, then the service worker will be registered.
  • Here is the code snippet from index.htmlRegister SW if browser supportsIf the above registration step was successful, then the SW file will be downloaded.
  • This would be ideal place to clean up the cache to remove any cache item which is no longer required maybe.Apart from the above lifecycle of SW, if you noticed in the earlier section, I mentioned to also go through the Fetch API.
  • Well that is because SW can intercept the fetch event, and this will help if you want to cache something from the network.Updating Cache / Making network calls — Fetch eventSW listens to fetch event, and in our example since we handle only the basic case of caching only the static files, you can see below, when there is a fetch event within the SW’s scope (Refer the registration step to see the scope),it is intercepted, and we checked if request has a response already in the cache, then we return the response from cache.
  • Adding your app to the Home Screen.Perfect!Step 1 above showed you the importance of SW and how it helps to make your app to be offline first.Step 2, tells you how you can run it from your virtual device.And now let us make it feel a bit more like an app, but letting you add this to your homepage, so that you can launch it anytime later without the need to remember the url or bookmark it.This is where you need to under about web manifest json file, which was one of the topic I mentioned would be good to know.

Progressive Web Apps(PWA) are gaining a lot of popularity these day, and with one of the updates this year (2017), the Create React App creates your project by default as PWA. If you haven’t heard of…
Continue reading “React Progressive Web Apps — Part 1 – Gethyl George Kurian – Medium”