MobX (with Decorators) in create-react-app

MobX (with Decorators) in create-react-app  #MobX #ReactJS

  • If you are using create-react-app as your application boilerplate, you most likely run into the questions of how to setup MobX and how to use decorators in create-react-app.
  • After scaffolding your application with create-react-app on the command line, you can install mobx and mobx-react: – – Whereas the former is used as your state management solution, the latter is used to connect the state layer to your React view layer.
  • The current situation is that the maintainers of create-react-app are holding decorators back until Babel supports them in a stable stage: – – But what if you want to use decorators for your create-react-app + MobX application right now?
  • Fortunately there exists one sample project that already demonstrates how to use MobX with decorators in a Next.js application.
  • After showing all these different alternatives, using MobX with or without decorators in a plain React, a create-react-app or Next.js application, you have no excuse anymnore to give MobX as alternative to Redux a shot.

Everything to know about using MobX with and without decorators in a create-react-app with React. MobX doesn’t need necessarily decorators. But you can activate them by ejecting your application …
Continue reading “MobX (with Decorators) in create-react-app”

Game Development with React and PHP: How Compatible Are They? — SitePoint

  • pre: – use Aerys\Router; – use App\Action\HomeAction; – – return (Router $router) = { – $router-route( – “GET”, “/”, new HomeAction – ); – }; – – And, from routes/api.
  • pre: – use Aerys\Router; – use (Router $router) = { – $router-route( – “GET”, “/api”, new HomeAction – ); – }; – – Though simple routes, these helped me to test the code in config.pre.
  • From App\Action; – – use Aerys\Request; – use Aerys\Response; – – class HomeAction – { – public function __invoke(Request $request, – Response $response) – { – $response-end(“hello world”); – } – } – – One final touch was to add shortcut scripts, to launch dev and prod versions of the…
  • From composer.json: – “scripts”: { – “dev”: “vendor/bin/aerys -d -c loader.php”, – “prod”: “vendor/bin/aerys -c loader.php” – }, – “config”: { – “process-timeout”: 0 – }, – – With all of this done, I could spin up a new server, and visit http://127.0.0.1:8080 just by typing: – composer dev -…
  • js”); – – $response-end(” – div class=’app’/div – script src='{$path}’/script – “); – } – – I realized I could keep creating functions that returned promises, and use them in this way to keep my code asynchronous.

Chris bootstraps a basic Stardew-Valley-like game in this game development with PHP post, using an async server, preprocessors, and ReactJS!
Continue reading “Game Development with React and PHP: How Compatible Are They? — SitePoint”

5 Best JavaScript Frameworks in 2017

  • In the meanwhile, JavaScript web frameworks can become a silver bullet for quick web app development.
  • Angular.js is often referred to as an MVW (Model-View-Whatever) framework and among the top benefits, for startups and mid-sized companies, people name: quick code production, easy testing of any app part and two-way data binding (changes in the backend are immediately reflected on the UI).
  • As for now, it is reasonably called the most used JS framework for SPAs (Single-Page Applications) development and it boasts the largest community of developers.
  • Back in 2015 Ember was called the best javascript framework for web application, leaving behind React and AngularJS.
  • When it comes to quick web development or prototyping, JavaScript frameworks are among the most favorable and 2017 won’t become an exception.

JavaScript popularity continues its rising. In 2016 we’ve witnessed such great changes, as AngularJS entire upgrade and introduction of Angular 2, ultimate dominating of jQuery that is applied on 96.5% of all JS sites, evolution of ECMAScript, two updates of Node.js in April and October accordingly, React finest hours, and even more.  What to expect from 2017?
Continue reading “5 Best JavaScript Frameworks in 2017”

Game Development with React and PHP: How Compatible Are They? — SitePoint

  • pre: – use Aerys\Router; – use App\Action\HomeAction; – – return (Router $router) = { – $router-route( – “GET”, “/”, new HomeAction – ); – }; – – And, from routes/api.
  • pre: – use Aerys\Router; – use (Router $router) = { – $router-route( – “GET”, “/api”, new HomeAction – ); – }; – – Though simple routes, these helped me to test the code in config.pre.
  • From App\Action; – – use Aerys\Request; – use Aerys\Response; – – class HomeAction – { – public function __invoke(Request $request, – Response $response) – { – $response-end(“hello world”); – } – } – – One final touch was to add shortcut scripts, to launch dev and prod versions of the…
  • From composer.json: – “scripts”: { – “dev”: “vendor/bin/aerys -d -c loader.php”, – “prod”: “vendor/bin/aerys -c loader.php” – }, – “config”: { – “process-timeout”: 0 – }, – – With all of this done, I could spin up a new server, and visit http://127.0.0.1:8080 just by typing: – composer dev -…
  • js”); – – $response-end(” – div class=’app’/div – script src='{$path}’/script – “); – } – – I realized I could keep creating functions that returned promises, and use them in this way to keep my code asynchronous.

Chris bootstraps a basic Stardew-Valley-like game in this game development with PHP post, using an async server, preprocessors, and ReactJS!
Continue reading “Game Development with React and PHP: How Compatible Are They? — SitePoint”

Now that it’s okay to use @reactjs again, I can say: I’ve been working on this @WordPress + React thing for awhile

  • Postlight’s Headless WordPress + React Starter Kit is an automated toolset that will spin up two things: – – The following setup will get WordPress running locally on your machine, along with the WordPress plugins you’ll need to create and serve custom data via the WP REST API.
  • To install and start WordPress, run the following command: – – When that completes successfully, the WordPress REST API will be available at http://localhost:8080.
  • To import data and media from a live WordPress install locally, use Migrate DB Pro.
  • At this point you can start setting up custom fields, and if necessary, creating custom REST API endpoints in the Postlight Headless WordPress Starter theme.
  • Once you have Docker installed on your computer, you can run the container locally using this command:

headless-wp-starter – 🔪 WordPress + React: a starter kit
Continue reading “Now that it’s okay to use @reactjs again, I can say: I’ve been working on this @WordPress + React thing for awhile”

Game Development with React and PHP: How Compatible Are They? — SitePoint

  • pre:
    use Aerys\Router;
    use App\Action\HomeAction;

    return (Router $router) = {
    $router-route(
    “GET”, “/”, new HomeAction
    );
    };

    And, from routes/api.

  • pre:
    use Aerys\Router;
    use (Router $router) = {
    $router-route(
    “GET”, “/api”, new HomeAction
    );
    };

    Though simple routes, these helped me to test the code in config.pre.

  • From App\Action;

    use Aerys\Request;
    use Aerys\Response;

    class HomeAction
    {
    public function __invoke(Request $request,
    Response $response)
    {
    $response-end(“hello world”);
    }
    }

    One final touch was to add shortcut scripts, to launch dev and prod versions of the Aerys server.

  • From composer.json:
    “scripts”: {
    “dev”: “vendor/bin/aerys -d -c loader.php”,
    “prod”: “vendor/bin/aerys -c loader.php”
    },
    “config”: {
    “process-timeout”: 0
    },

    With all of this done, I could spin up a new server, and visit http://127.0.0.1:8080 just by typing:
    composer dev

    Setting Up the Front End
    “Ok, now that I’ve got the PHP side of things relatively stable; how am I going to build the ReactJS files?

  • js”);

    $response-end(”
    div class=’app’/div
    script src='{$path}’/script
    “);
    }

    I realized I could keep creating functions that returned promises, and use them in this way to keep my code asynchronous.

Chris bootstraps a basic Stardew-Valley-like game in this game development with PHP post, using an async server, preprocessors, and ReactJS!
Continue reading “Game Development with React and PHP: How Compatible Are They? — SitePoint”

5 Projects to Help You Learn React

  • Variations of this UI can be found all over the web – Twitter, Facebook, Pinterest, Airbnb, Redfin, and so on – and it serves as a solid building block for the sort of app where you want to display an image + some data.
  • It’s also good practice for breaking down a UI into React components.
  • You might notice that the “days” look a lot like social cards…

    For added practice, here are a few ways you could expand on the app:

    You can see how this app starts off simple, but can be expanded at will to increase the challenge and the learning.

  • Hacker Hunt is an aggregator of Hacker News stories with categories, but more importantly, it’s a good app to build for React practice.
  • This app will give you some practice with lists of components that are a little more complicated than todos.

Here are 5 projects that’ll be fun to build, and do not involve any todo lists.
Continue reading “5 Projects to Help You Learn React”