Create a Vuex Undo/Redo Plugin for Vue.js

See the original posting on DZone Python

There are many benefits to centralizing your application state in a Vuex store. One benefit is that all transaction are recorded. This allows for handy features like time-travel debugging where you can jump between previous states to isolate problems.

In this article, I’ll demonstrate how to create an undo/redo feature with Vuex, which works in a similar way to time-travel debugging. This feature could be used in a variety of scenarios from complex forms to browser-based games.

Web Dev Roundup: Don’t Over React(.js)

See the original posting on DZone Python

Welcome to this edition of the roundup! Last time, we covered Spring Boot for web developers. Today, we take a look at another framework (or, I guess, technically it’s a library) for front-end developers, React.js. Originally cooked up by the JavaScript wizards over at Facebook, React has gained a vast and growing following of developers. So, try not to over React about how awesome this article is (I already know). 

And, as a quick side note, if you’re interested in writing for DZone, but don’t have a topic in mind, come check out our Bounty Board, where you can win prizes for providing great content, and our Writer’s Zone which has plenty of prompts, tips, and tricks! 

Grails Quickcast #9: GORM Many-to-One Relationship – Replacing a Collection [Video]

See the original posting on DZone Python

GORM, a powerful Groovy-based data access toolkit for the JVM, enables to create many-to-one relationships with ease. In this Quickcast, Sergio del Amo (member of the OCI Grails team) explains how to replace a many-to-one collection efficiently by using a minimal number of queries or leveraging cascade behavior.

Grails Quickcast #9: GORM Many-to-One Relationship – Replacing a Collection from OCI on Vimeo.

What Is a Service in Angular and Why Should You Use it?

See the original posting on DZone Python

Angular Service:

Angular services are singleton objects which get instantiated only once during the lifetime of an application. They contain methods that maintain data throughout the life of an application, i.e. data does not get refreshed and is available all the time. The main objective of a service is to organize and share business logic, models, or data and functions with different components of an Angular application.

An example of when to use services would be to transfer data from one controller to another custom service.

Top 10 JavaScript Errors From 1000+ Projects (and How to Avoid Them)

See the original posting on DZone Python

To give back to our community of developers, we looked at our database of thousands of projects and found the top 10 errors in JavaScript. We’re going to show you what causes them and how to prevent them from happening. If you avoid these "gotchas," it’ll make you a better developer.

Because data is king, we collected, analyzed, and ranked the top 10 JavaScript errors. Rollbar collects all the errors for each project and summarizes how many times each one occurred. We do this by grouping errors according to their fingerprints. Basically, we group two errors if the second one is just a repeat of the first. This gives users a nice overview instead of an overwhelming big dump like you’d see in a log file.

Building a Chrome Extension Using React

See the original posting on DZone Python

Last week I finished building a chrome extension for a customer. The extension was built with React as a view engine to render a popup. So I thought to myself — wouldn’t it be nice to write about how to build your own extension with React?

In this post, I’m going to guide you through the process of building a simple Chrome extension using React. After this intro, you will have a starting point to continue and build your own extension functionality.

Script for Migrating Related Posts in WordPress

See the original posting on DZone Python

Time for a New Plugin

This blog has nearly a thousand posts, and apparently 800+ pieces of related-post data. I find these "see also" links really helpful so I didn’t want to lose them, but I’d been using an outdated related posts plugin for years (the Microkids Related Posts one) and it serves insecure scripts… just urgh. So I decided it was high time to find something else. The key requirements for me are that it’s pretty lightweight and that it does a good job of searching content when I want to relate a link to a current post (because I have enough content that it’s pretty unwieldy to find things without decent search). I went with "Related" after a whole 3 minutes of research and it seems fine. It also actually documents where it stores its data which was nice.

Migrating the Data

The previous plugin stored each related article separately in a table called wp_post_relationships whereas this new plugin has a PHP-serialized array of IDs in the wp_postmeta table so I knew I’d have to fuss around with some data formatting to get to where I needed. To achieve this I went with:

8 Essential Tips for Building a Cross-Browser Compatible Website

See the original posting on DZone Python

Once you take the time to learn a little about the history of web browsers and understand how they work, the need to build and test cross-compatible websites is clear. Between Firefox, Chrome, Safari, Opera, and Internet Explorer, you can’t assume that your web page will look good and work correctly on everyone’s machine just because it does so on yours.

However, understanding the importance of a web application that works across browsers is one thing, while developing for it is another. While it’s almost impossible to have a design look exactly the same on every browser, there are a few ways to make sure that you’re providing a consistent user experience. Luckily we have a few tips for making your website cross-compatible.

Instant Progressive Web Apps

See the original posting on DZone Python

PWAs (Progressive Web Apps) are an extremely hot topic right now. In case you haven’t been following the PWA buzz, the idea is that it’s a web app that behaves like a native app. When they are first loaded in a user’s browser, they behave like a normal responsive web app, but users can install them to their home screen just like native apps. At which point, they can behave as "offline-first" apps. Parts of this have been available for quite some time, but the concept of PWA brings a lot of little things under a single umbrella.

Deploying as a Progressive Web App

Out of the box, your app is ready to be deployed as a progressive web app (PWA). That means that users can access the app directly in their browser, but once the browser determines that the user is frequenting the app, it will "politely" prompt the user to install the app on their home screen. Once installed on the home screen, the app will behave just like a native app. It will continue to work while offline, and if the user launches the app, it will open without the browser’s navigation bar. If you were to install the native and PWA versions of your app side by side, you would be hard-pressed to find the difference – especially on newer devices.

Observables With Angular 5

See the original posting on DZone Python

We have a case where we use observables to populate the UI from the external data asynchronously. Angular uses the same thing for this task, so let’s see how we can use the observables and use them in an Angular application.

What Are Observables?

Observables are a lazy collection of multiple values, or data, over a period of time. Observables open the continuous channel of communication where multiple values are emitted over time. This allows us to determine the pattern of the data.

Server-Side Rendering With Laravel and Vue.js 2.5

See the original posting on DZone Python

Server-side rendering is a great way to increase the perception of loading speed in your full-stack app. Users get a complete page with visible content when they load your site, as opposed to an empty page that doesn’t get populated until JavaScript runs.

One of the downsides of using Laravel as a backend for Vue.js was the inability to server render your code. Was. The release of Vue.js 2.5.0 has brought server-side rendering support to non-Node.js environments including PHP, Python, Ruby, etc.

React.js for Noobs Part II: Flux

See the original posting on DZone Python

This post is a continuation of my earlier React.js for Noobs post; if you haven’t read it already, first go through it before continuing with this article. React is a library to manipulate the web page DOM, and, when building a complex web app, it is paramount to manage the state of the application as most of the time React components want to talk with each other.

If all the components start to talk with each other, the whole app will be a mess and debugging an issue will be a nightmare. Hence, Flux can be used to make our lives easier. Flux is a data unidirectional architecture pattern. It is mostly a concept, rather than an implementation. First, let’s get a good conceptual understanding of what Flux is and later on move on to an example implementation to get hands-on experience.

One Router to Rule Them All: React Router

See the original posting on DZone Python

Previously, we looked at a very basic example of how one can benefit greatly by using community projects such as Formik to avoid the tedium of certain solutions while embracing convention to create composable and scalable applications. We will be building on that foundation to explore the objectively great library that is React Router.

React Router has been at the forefront of routing in the React ecosystem for as long as I can remember. If you’re new to React, this is the way to go when you move state and start needing more options such as parameterized routing, nesting, and conditional rendering. If you have experience with React, this brings a powerful pattern to bear, in that everything is a component. It takes the composability of React and uses that to its benefit, handling any and all use-cases with relative ease.

Basic HTML for Everyone

See the original posting on DZone Python

There are so many editors and plugins available that knowing the basics of HTML is no longer required to create a site.

The problem with this is that if you don’t know a few basics, you can easily get into real trouble and have to hire a pricey developer to fix what may be a minor problem. Not only that, but creating changes to your blog such as adding a custom text widget requires a little knowledge.

Python Frameworks for Web Developers in 2018

See the original posting on DZone Python

Any techie worth his salt will agree that frameworks make their life easier by allowing for quicker customizations with less code and more focus on logic. As a web developer, you would like a framework that enables you to rapidly develop and deploy applications. When it comes to a web application, there is always more to do than just coding your application. You need to understand the server side architecture and then there will be your application running on a user’s browser which uses JavaScript. We list out five Python frameworks that you might be interested to learn as a web developer. Some of these are the full-stack frameworks, which is not only useful for Python but other languages too.

1. Django:

Django always comes first to mind when we talk about a Python framework because it makes web development ridiculously fast and scalable. The software foundation is established as a non-profit organization and has a lot of senior developers and experts to help you out in case you are stuck. They keep updating the framework to match the latest version of Python. You can get the download and documentation from their own site as open-source software. It supports many database engines and is in use by major web applications like Instagram. As a newbie, you can start with this framework as it also makes learning much easier.

1 2 3 4 5 100