This document provides an overview of using Vagrant to automate the setup of a development environment. It describes how Vagrant can be used to create and configure a virtual machine (VM) that contains all the necessary tools and files for a project, allowing new team members to get set up and running quickly by running a single script. The document outlines the steps to install Vagrant and VirtualBox, add a Ubuntu box, initialize a Vagrantfile, provision the VM with common tools like Apache and PHP, and set up a sample Drupal project.
This document summarizes techniques for optimizing WordPress development. It discusses using integrated development environments (IDEs) for code completion and debugging. It also covers the WordPress Codex as the primary resource for documentation and coding standards. Additional topics include using WPShell for testing, caching pages with plugins like Batcache, and debugging with functions like var_dump(), error_log(), and XDebug. The goal is to help WordPress developers work more efficiently through best practices for tools, documentation, coding standards, and debugging.
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...Acquia
We’ve heard that developing with Drupal 8 is fast by default, but does that extend to your development process? There are new tools in Drupal 8 that can accelerate your day-to-day work, and will help you master rapid development in Drupal 8.
Join Myplanet’s Erin Marchak as she does a live walk through of building a site install with Composer, developing a module with Drupal Console, and ingesting external content with Services, all within 1 hour. In this demonstration of Drupal 8’s improved developer experience, topics covered will include
Dependency management using Composer
Content ingestion using Guzzle PHP
Code scaffolding using Drupal Console
Configuration management using Drupal Console
Drupal 8’s Services and Dependency Injection
Godefroid Chapelle Ajax With Plone 3 Kss Development PatternsVincenzo Barone
This document discusses Kinetic Style Sheets (KSS), an Ajax framework that uses kinetic stylesheets for event binding and DOM manipulation on the client-side while keeping business logic on the server-side. It outlines the goals of ensuring accessibility and using minimal JavaScript. It describes the design of using kinetic stylesheets, a generic client-side engine for handling events and HTML snippets, and a simple server-side API. It also covers development and testing patterns for KSS.
The document provides instructions for setting up a basic business process management system (BPMS) using Ruby on Rails and open source components. It describes registering various participants like XForms, SPS, and WNS to handle tasks in a sample EO-1 satellite tasking workflow. It also explains how to execute the workflow by launching it from a Rails controller and view, and includes code snippets for setting up the workflow engine and defining participants.
Hitchhiker's guide to the front end development정윤 김
2016년 11월 5일 있었던 GDG DevFest 2016 Seoul 행사에서 진행된 `Boot Camp: 초보 개발자를 위한 웹 프론트엔드 개발 101` 워크숍의 front-end development 트렌드 및 프로세스 슬라이드입니다.
- 행사 URL: https://festi.kr/festi/gdg-korea-2016-devfest-seoul/program/92/
80% of the time it takes for a web page to load is on the client side.
Using all the tips in this presentation should cut 25% to 50% off the load time of optimized page requests.
Drupal (6 or 7) can be used to, fairly easily, implement a whole bunch of these “front-end performance” upgrades, and knock a ton of errors off of the Yahoo! and Google speed-checker tools validation checklists.Get firebug first.
Vagrant allows users to define and configure lightweight virtual development environments. It uses VirtualBox to run virtual machines from a Vagrantfile configuration. The document discusses how Vagrant abstracts hardware, allows multiple operating systems to run concurrently on virtual hardware, and is limited by physical resources. It also outlines how in 3 lines users can download a base box, initialize a new Vagrant project, and boot the virtual machine. Key benefits of Vagrant include quick setup for new team members, ability to version control server configurations, and easy switching between projects.
The document discusses various techniques for improving front-end website performance, including reducing the number of HTTP requests, using content delivery networks and caching, gzip compression, optimizing CSS and JavaScript loading, image optimization, and lazy loading of content not visible initially. Specific techniques mentioned include combining files, setting long cache expiration headers, minifying files, parallelizing downloads, and deferring non-critical JavaScript initialization. The goal is to render an initial version as fast as possible through optimizations that reduce page load time.
This document provides an overview of embedded GlassFish, including its history and key features. Embedded GlassFish allows running a GlassFish application server within a JVM without requiring a full GlassFish installation. It provides benefits like very fast startup times, running web applications like regular Java applications, and using GlassFish for testing without a separate domain. Examples are provided demonstrating how to embed GlassFish using the API and via command line. The schedule outlines upcoming support for Java standards and references provide links to related projects.
Vagrant is a well-known tool for creating development environments in a simple and consistent way. Since we adopted in our organization we experienced several benefits: lower project setup times, better shared knowledge among team members, less wtf moments ;-)
In this session I'd like to share our experience, including but not limited to:
- advanced vagrantfile configuration
- vm configuration tips for dev environment: performance, debug, tuning
- our wtf moments
- puphet/phansilbe: hot or not?
- tips for sharing a box
Webpack is a module bundler that bundles JavaScript files for use in a browser. It supports CommonJS and ES6 module syntax and bundles all dependencies. Webpack can bundle JavaScript files as well as other asset types like CSS, images, and fonts. It uses loaders to preprocess files and plugins to tap into the build pipeline. Webpack can be configured using a webpack.config.js file to specify options like entry points, output, loaders, plugins and optimization settings.
Adam Culp will talk about using Vagrant to create and manage virtualized development environments, making it easier to mirror production servers. Then will cover using Puppet for more advanced provisioning, making the addition of multiple development environments and servers easier and faster.
If you’re developing and are not sure what these technologies are, this talk is for you. As a developer it’s increasingly important to ensure our development, testing, staging, and production environments are as closely matched to each other as possible, alleviating the “can’t reproduce it on my machine” excuses. Whether you use 2, 3, or 4 of these environments is of less importance if they are all built on the same “stack” of applications.
Rock-solid Magento Development and Deployment WorkflowsAOE
This document discusses continuous integration and delivery best practices for a Magento project. It covers topics like version control, code reviews, static analysis, testing at different stages (unit, integration, acceptance), and continuous deployment to staging and production. The goal is to establish a robust pipeline to ensure code quality and prevent defects from making it to production.
This document provides tips for optimizing front-end performance. It discusses optimizing assets like images, CSS, and JavaScript to reduce file sizes and load times. Specific techniques include image sprites, CSS combining, lazy loading images, and minimizing DOM access. It also covers optimizing the rendering process by prioritizing visible content, avoiding layout thrashing, and deferring non-critical scripts. The document emphasizes the importance of front-end performance and provides references for further reading on the topic.
Slides for my tutorial from Velocity 2014 on some of the more advanced features in WebPagetest.
Video is available on Youtube:
Part 1: http://youtu.be/6UeRMMI_IzI
Part 2: http://youtu.be/euVYHee1f1M
Node JS Express : Steps to Create Restful Web AppEdureka!
Node.js uses JavaScript - a language known to millions of developers worldwide - thus giving it a much lower learning curve even for complete beginners. Using Node.js you can build simple Command Line programs or complex enterprise level web applications with equal ease. Node.js is an event-driven, server-side, asynchronous development platform with lightning speed execution. It is open source and cross-platform, running on OS X, Linux and Windows. It also has an open source community that produces amazing modules available for use in your project for additional functionalities. Node.js helps you to code the most complex functionalities in just a few lines of code. The topics covered in the presentation are :
1. Understanding NodeJS Express
2. Creating Restful Web App
3. What is NPM
4.Templates in Express
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With ContainersHanoi MagentoMeetup
This document discusses the challenges of Magento development including knowledge transfer between developers, lack of parallelization, difficult operations, and scaling issues. It then introduces Docker as a solution, allowing developers to define infrastructure components as immutable units, leverage standard Docker images, and automate environment setup. Docker Compose is used to define multi-container orchestration. This enables parallelization of development, easier operations like deployment and patching, and improved scaling through horizontal expansion and easier project copying. The document provides an example project structure combining Magento code and Dockerized infrastructure components.
It's no denying that rich Javascript applications (sometimes called One Page Applications) are a big thing, but what if you want to leverage Drupal on the backend, or have an existing site? Tools like Angular.JS and EmberJS are great when you have an API, but Drupal 7 doesn't really have an API layer. I'll explore the parts of a one page application and how to integrate it into either an existing or a new Drupal site, and the pitfalls that one must watch out for.
In this talk, Carlos de la Guardia shows how a Pyramid application can be deployed using a front end web server, like Apache or Nginx. He also covers how to automate deployment using buildout and a PyPI clone, and post-deployment creation of a variety of maintenance scripts and cron jobs that perform application specific tasks through Pyramid.
A link to audio of the presentation is here: http://2011ploneconference.sched.org/event/29a2f357905e4ab0fe3048c53bc1c94c
Webpack is a module bundler that builds dependency graphs from entry points and combines modules into bundles. It allows developers to use a multi-file approach during development but bundle assets into fewer files for production. Loaders are used to bundle different file types like CSS. Plugins further customize the bundling process. Code splitting bundles common modules separately for better caching. Extracting CSS removes CSS invalidation on HTML changes. Tree shaking removes unused code automatically in production builds.
1. The document discusses integrating Webpack into a Django project to bundle static files.
2. It provides an example Django application and shows how to set up basic Webpack configuration to bundle Vue.js and other static files.
3. Additional Webpack features like hot reloading and code splitting are demonstrated to improve the development and production workflows.
Webpack is a module bundler that builds out a dependency graph from entry points to bundle assets. It understands JavaScript and JSON files by default but uses loaders to process other file types. Plugins provide additional functionality beyond loading and bundling like generating HTML files and service workers. Workbox plugins help precache assets and implement caching strategies in service workers to improve performance. Webpack supports different modes for development and production builds and includes optimizations like scope hoisting to improve bundle performance.
Improving build solutions dependency management with webpackNodeXperts
Webpack is a build tool that bundles assets including JavaScript, images, fonts and CSS into packages called bundles that can be consumed in the browser. It analyzes dependencies between files and packages them accordingly. The webpack configuration file specifies the entry point, output, loaders and plugins. Loaders transform files and plugins add functionality to bundles. Webpack differs from other build tools like Grunt and Gulp in that it generates dependency graphs to bundle assets optimally rather than just running predefined tasks.
This document provides a summary of essential information for using Nuxt.js, including how to start a new project, the folder structure, page components, layouts, error pages, aliases, Vuex store configuration, deployment methods, and the nuxt.config.js file. It also recommends additional Vue learning resources on VueMastery.com.
2017 - budapest.mobile meetup @ Budapest
I have been an android developer for 5 years now. Beginning of this year I stepped out from my comfort-zone, and tried out React-Native.
After releasing 4 different kind of RN projects, I would like to share my experience and give you some tips so you won't feel like you are fighting for your life when using RN on Android or ios. So what is my "survival kit" contains? A lot of info on project structure and setup, libraries, tools for debugging, best-practices, fastlane, push notifications and much more.
This document discusses React workflows, including:
- The benefits of using Create React App to get started quickly without configuring Webpack or Babel.
- Why you may want to configure your own build rather than using Create React App, including having more control over customizations and updates.
- An overview of Webpack and using it to bundle assets, optimize builds, and add dependencies like Babel, Sass, and plugins for code splitting and asset optimization.
- Other topics covered include React styling options, testing advantages, folder structures, and additional tools that could be included like Flux architecture and Storybook.
It is a build tool that puts all of your assets, including Javascript, images, fonts,
CSS, in a dependency graph.
It lets us use require() in our source code to point to local files, like images.
We can decide how they’re processed in our final javascript bundle, like
replacing the path with a URL.
Modern Web Application Development Workflow - EclipseCon Europe 2014Stéphane Bégaudeau
The document discusses modern web application development workflows. It begins by looking at past workflows that lacked structure and organization. It then introduces Node.js as a JavaScript runtime and describes how JavaScript tools like Yeoman, Bower, Grunt and Gulp help provide structure, manage dependencies, automate tasks and enforce best practices. The document provides an overview of how these tools work and how they can be used to improve development workflows.
This document provides an overview of tools and techniques for Magento 2 development. It discusses Composer, Magento CLI, N98 Magerun, PHPStorm, module creators, debug tools, Xdebug, and logging methods. It also covers setting up development environments with LAMP/LEMP stacks, using Node.js and Grunt for frontend work, and debugging with KnockoutJS and ChromePHP. Contact information is provided at the end for additional support.
Zero Downtime Deployment with Ansible - learn how to provision Linux servers with a web-proxy, a database and automate zero downtime deployment of a Java application to a load balanced environment.
These are the slides from a tutorial held at the Velocity Conference in Barcelona November 19th, 2014.
Git repo: https://github.com/steinim/zero-downtime-ansible
Jumpstart your education on learning Chef InSpec to turn your DevOps into DevSecOps, by automating your integration testing and compliance/security scanning.
Modern Web Application Development Workflow - EclipseCon France 2014Stéphane Bégaudeau
People often consider that creating a web application is done by creating a bunch of HTML, Javascript and CSS files in a text editor, putting them in a folder and uploading them on the web.
Well, things have changed and in this presentation, you will see how the workflow used to deliver web applications has evolved over the past few years and where the Eclipse Foundation's tools stand in this new world!
In this talk, we will start by having a look at all the new development tools that have appeared with the arrival of Node.js and how they are used by the web development community.
With tools like Bower used to manage the dependencies of a project, Grunt and Gulp used for the continuous integration and Yeoman used to kickstart web applications, web developers have dramatically increased their productivity.
After that, we will see what tools like the Eclipse IDE and Orion can offer to web developers in order to build and maintain their applications and finally how they could be improved to provide the features needed by web developers.
This document provides instructions for installing ReactJS in a Windows environment. It discusses installing NodeJS, then using NPM to install React and related packages like Webpack and Babel. The steps include creating project folders, running NPM init, installing React and React DOM with NPM, installing Webpack and related tools, installing Babel and related plugins, creating configuration files, setting up loaders and the dev server, updating index.html, and adding App.js and main.js files. The process is completed by starting the dev server with npm start and building the bundle with npm run build.
React is a library for building composable user interfaces. It encourages the creation of reusable UI components, which present data that changes over time. Lots of people use React as the V in MVC. React abstracts away the DOM from you, offering a simpler programming model and better performance.
My talk from DevOpsCon Berlin 2016.
Ansible is a radically simple and lightweight provisioning framework which makes your servers and applications easier to provision and deploy. By orchestrating your application deployments you gain benefits such as documentation as code, testability, continuous integration, version control, refactoring, automation and autonomy of your deployment routines, server and application configuration. Ansible uses a language that approaches plain English, uses SSH and has no agents to install on remote systems. It is the simplest way to automate and orchestrate application deployment, configuration management and continuous delivery.
In this tutorial you will be given an introduction to Ansible and learn how to provision Linux servers with a web-proxy, a database and some other packages. Furthermore we will automate zero downtime deployment of a Java application to a load balanced environment.
The document provides an introduction to ReactJS, including:
- ReactJS is a JavaScript library developed by Facebook for building user interfaces.
- It uses virtual DOM for rendering UI components efficiently. Only updated components are re-rendered.
- Components are the basic building blocks of React apps. They accept input and return React elements to describe what should appear on the screen.
- The main steps to set up a React app are installing React and ReactDOM libraries, adding JSX syntax, and rendering components onto the DOM using ReactDOM.render().
Room with a Vue - Introduction to Vue.jsZachary Klein
The document provides an introduction to Vue.js, a progressive framework for building user interfaces. It discusses Vue's core concepts like the Vue instance, templates, components, and the ecosystem of libraries that support Vue like Vuex for state management and Vue Router for routing. The document compares Vue to Angular and React, noting Vue aims for a balance between rich features and clean code. It promotes Vue as a good option for both beginners and experienced developers looking for a new view on single-page apps.
With these slides you will learn how to build your first functional component and how to get started with React using Webpack and Babel. We will also discover the JSX syntax and by the end of the the slides you will be able to render your first site using React components.
Vue.js is an open-source progressive framework for building user interfaces that focuses on the view layer. It has a virtual DOM and reactive components. Its core is small and works well with companion libraries. Single file components allow importing of templates, logic, and styles. Popular companion libraries include Vuex for state management and Vue Router for routing. The Vue CLI makes it easy to scaffold Vue projects with features like routing, lazy loading, and preloading for improved performance.
Similar to Creating a full stack web app with python, npm, webpack and react (20)
Overview of ERP - Mechlin Technologies.pptxMitchell Marsh
This PowerPoint presentation provides a comprehensive overview of Enterprise Resource Planning (ERP) systems. It covers the fundamental concepts, benefits, and key functionalities of ERP software, illustrating how it integrates various business processes into a unified system. From finance and HR to supply chain and customer relationship management, ERP facilitates efficient data management and decision-making across organizations. Whether you're new to ERP or looking to deepen your understanding, this presentation offers valuable insights into leveraging ERP for business success.
Efficient hot work permit software for safe, streamlined work permit management and compliance. Enhance safety today. Contact us on +353 214536034.
https://sheqnetwork.com/work-permit/
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...Hironori Washizaki
Hironori Washizaki, "Charting a Course for Equity: Strategies for Overcoming Challenges and Promoting Inclusion in the Metaverse", IEEE COMPSAC 2024 D&I Panel, 2024.
Software development... for all? (keynote at ICSOFT'2024)miso_uam
Our world runs on software. It governs all major aspects of our life. It is an enabler for research and innovation, and is critical for business competitivity. Traditional software engineering techniques have achieved high effectiveness, but still may fall short on delivering software at the accelerated pace and with the increasing quality that future scenarios will require.
To attack this issue, some software paradigms raise the automation of software development via higher levels of abstraction through domain-specific languages (e.g., in model-driven engineering) and empowering non-professional developers with the possibility to build their own software (e.g., in low-code development approaches). In a software-demanding world, this is an attractive possibility, and perhaps -- paraphrasing Andy Warhol -- "in the future, everyone will be a developer for 15 minutes". However, to make this possible, methods are required to tweak languages to their context of use (crucial given the diversity of backgrounds and purposes), and the assistance to developers throughout the development process (especially critical for non-professionals).
In this keynote talk at ICSOFT'2024 I presented enabling techniques for this vision, supporting the creation of families of domain-specific languages, their adaptation to the usage context; and the augmentation of low-code environments with assistants and recommender systems to guide developers (professional or not) in the development process.
A captivating AI chatbot PowerPoint presentation is made with a striking backdrop in order to attract a wider audience. Select this template featuring several AI chatbot visuals to boost audience engagement and spontaneity. With the aid of this multi-colored template, you may make a compelling presentation and get extra bonuses. To easily elucidate your ideas, choose a typeface with vibrant colors. You can include your data regarding utilizing the chatbot methodology to the remaining half of the template.
React Native vs Flutter - SSTech SystemSSTech System
Your project needs and long-term objectives will ultimately choose which of React Native and Flutter to use. For applications using JavaScript and current web technologies in particular, React Native is a mature and trustworthy choice. For projects that value performance and customizability across many platforms, Flutter, on the other hand, provides outstanding performance and a unified UI development experience.
React and Next.js are complementary tools in web development. React, a JavaScript library, specializes in building user interfaces with its component-based architecture and efficient state management. Next.js extends React by providing server-side rendering, routing, and other utilities, making it ideal for building SEO-friendly, high-performance web applications.
Cultural Shifts: Embracing DevOps for Organizational TransformationMindfire Solution
Mindfire Solutions specializes in DevOps services, facilitating digital transformation through streamlined software development and operational efficiency. Their expertise enhances collaboration, accelerates delivery cycles, and ensures scalability using cloud-native technologies. Mindfire Solutions empowers businesses to innovate rapidly and maintain competitive advantage in dynamic market landscapes.
Responsibilities of Fleet Managers and How TrackoBit Can Assist.pdfTrackobit
What do fleet managers do? What are their duties, responsibilities, and challenges? And what makes a fleet manager effective and successful? This blog answers all these questions.
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdfonemonitarsoftware
WhatsApp Tracker Software is an effective tool for remotely tracking the target’s WhatsApp activities. It allows users to monitor their loved one’s online behavior to ensure appropriate interactions for responsive device use.
Download this PPTX file and share this information to others.
Are you wondering how to migrate to the Cloud? At the ITB session, we addressed the challenge of managing multiple ColdFusion licenses and AWS EC2 instances. Discover how you can consolidate with just one EC2 instance capable of running over 50 apps using CommandBox ColdFusion. This solution supports both ColdFusion flavors and includes cb-websites, a GoLang binary for managing CommandBox websites.
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Creating a full stack web app with python, npm, webpack and react
1. CREATING A FULL STACK WEB APP WITH
PYTHON, NPM, WEBPACK AND REACT
by Angela Branaes
6. THE STRUCTURE OF A WEB APP
➤ Separated into front and back end.
➤ Multiple technologies.
➤ Front end is:
➤ Look and feel.
➤ User interaction.
➤ Back end is:
➤ Long running operations.
➤ Data, and data processing.
➤ Application logic.
7. INITIAL PROJECT SETUP
➤ Create the following directory structure
.
├── README.md
└── fullstack_template/
├── server/
└── static/
├── css/
├── dist/
├── images/
└── js/
$ cd fullstack_template/static
8. WE’RE GOING TO NEED A JAVASCRIPT PACKAGE MANAGER
➤ Using a package manager makes it painless to:
➤ Keep your project dependencies up to date.
➤ Fetch and install new packages.
➤ Similar to brew, pip, pacman etc.
10. NPM = NODE PACKAGE MANAGER
➤ Automatically included with Node.js
➤ Easy to use
➤ well documented
➤ nearly 500 000 packages available
➤ Initialise NPM:
$ npm init
➤ This creates a file called package.json
12. THE PURPOSE OF PACKAGE.JSON
1. Keeps track of dependencies and versions.
2. Informs other developers about your project.
3. Makes installing, running and updating a project automatic and reproducible
13. THIS IS MY PACKAGE.JSON
{
"name": "FullStackTemplate",
"version": "1.0.0",
"description": "Fullstack Template",
"main": "index.jsx",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
},
"keywords": [
"python",
"react",
"npm",
"webpack"
],
"author": "Angela Branaes",
"license": "MIT",
"devDependencies": {
"webpack": "^3.0.0"
}
}
14. WHY WE NEED A MODULE BUNDLER
➤ Minimises the number of <script> tags in your HTML
➤ This means faster loading, and less hassle.
➤ Don’t need to worry about bundle import ordering!
➤ Don’t have to use globals or namespacing.
➤ Lazy module loading.
➤ We will be using Webpack.
16. WEBPACK
➤ Only understands JavaScript.
➤ Everything else needs a loader or plugin.
➤ Everything is a module.
➤ You can require() JavaScript, React, CSS or images.
➤ Creates a dependency tree of all your required modules, and packages those into
bundles.
➤ Easy to get started with, if you only need JavaScript.
➤ Minor learning curve for css/less and image loading.
➤ Lets you split your bundles and load them asynchronously and lazily.
➤ Integrates seamlessly with npm.
19. SINGLE VS MULTI PAGE APPLICATIONS
➤ I mostly use Webpack for single page applications.
➤ You can also use webpack for multi page applications:
entry: {
“indexPage”: __dirname + “js/index.jsx”,
“aboutPage”: __dirname + “js/about.jsx”
},
output: {
path: __dirname + “/dist”,
filename: “[name].js” //e.g. aboutPage.js
}
22. CREATE INDEX.HTML
➤ A really simple index.html is all you need.
➤ The index.html just loads your JavaScript bundle
<body>
<div id="content" />
<script src="dist/bundle.js" type=“text/javascript”>
</script>
</body>
➤ All the layout and behaviour live in the JS/React files!
24. BUILDING YOUR APPLICATION
➤ Create run commands to simplify building your code.
➤ Run commands are just aliases.
➤ Example from my package.json:
“scripts": {
"watch": "webpack --progress -d --config webpack.config.js —watch"
}
➤ Makes the dev process more fluid.
➤ I always add the following:
➤ build
➤ dev-build
➤ watch
25. START THE WATCH COMMAND
➤ Any changes get built automatically
$ npm run watch
➤ Open index.html….
28. THE BENEFITS OF USING REACT
➤ Easy to build UIs composed of small, distinct components.
➤ Encourages design of reusable UI components.
➤ Easier to understand what’s going on when markup lives with the code (JSX).
➤ Automatic re-rendering of components on change.
➤ Easy to maintain.
33. WHAT IS JSX?
➤ Syntax extension to JavaScript.
➤ Optimised on compilation, so faster than JavaScript.
➤ Statically typed and mostly type-safe. JavaScript is not.
➤ Lets you write HTML tags in your JavaScript functions:
<Hello name=“Rimini” />
instead of
React.createElement(Hello, {name: “Rimini}, null)
➤ Recognises upper-case element-types as written in React. E.g. <Hello />
➤ How do we make our browser understand JSX?
40. PYTHON
➤ Go to the server folder
➤ Ensure you’re in a Python virtualenv
$ mkvirtualenv fullstack
➤ Install Flask
(fullstack)$ pip install flask
➤ Create a file called server.py in the server folder
44. REQUEST INFO FROM THE SERVER
var $ = require(‘jquery');
getPythonHello() {
$.get(window.location.href + 'hello', (data) => {
console.log(data);
this.personaliseGreeting(data);
});
}
45. MAKE PYTHON DO SOMETHING MORE INTERESTING
➤ We call get_hello() whenever we hit the /hello endpoint
def get_hello():
greeting_list = ['Ciao', 'Hei', 'Salut', 'Hola', 'Hallo', 'Hej']
return random.choice(greeting_list)
46. SAY HI TO SOMEONE SPECIAL
➤ There should be a class for that!
➤ Change the App.jsx render method to the following:
render () {
return (
<PageHeader>
<div className='header-contents'>
<Hello name='Rimini' />
</div>
</PageHeader>
);
)
48. CREATE THE HELLO CLASS
export default class Hello extends React.Component {
constructor(props) {
super(props);
// greeting is now “Hello Rimini”
this.state = {greeting: 'Hello ' + this.props.name};
// This binding is necessary to make `this`
// work in the button callback
this.getPythonHello = this.getPythonHello.bind(this);
}
}
49. ➤ Add this function to the Hello class:
➤ This will re-render the greeting on our website to a new one when called.
personaliseGreeting(greeting) {
this.setState({greeting: greeting + ' ' + this.props.name + '!'});
}
53. CREATE A NICE LAYOUT WITH CSS
➤ Webpack ONLY understands JavaScript.
➤ Install the following loaders and plugins:
➤ style-loader
➤ css-loader
➤ extract-text-webpack-plugin
➤ Add a plugin to the webpack config:
plugins: [
new ExtractTextPlugin('styles.css'),
]
55. ➤ Add fullstack.css to the css folder
➤ Add a few css rules for our header
➤ require fullstack.css in App.jsx:
require(‘../css/fullstack.css');
➤ Add the bundled css to the index.html:
<link rel="stylesheet" href="dist/styles.css">
58. ADD A NICE BACKGROUND IMAGE
1. Add the file-loader loader
2. Add an image to your images/ folder
3. Set the image to be your header background in the fullstack.css file
background-image: url(‘../images/header.jpg’);
4. NOTE: you have to load the image in your React app for it to show up!
59. IN APP.JSX
import HeaderBackgroundImage from ‘../images/header.jpg’;
➤ Add this fn to your class:
addHeaderImg() {
let headerBg = new Image();
headerBg.src = HeaderBackgroundImage;
}
➤ And this to your render():
{this.addHeaderImg()}
64. THANK YOU! ANY QUESTIONS?
@angineering
@angineering - The code is on GitHub:
https://github.com/angineering/FullStackTemplate
@angineering - This talk is also a blogpost