Part 1 was about general principles and some strong stances. We covered:
- How being dependent marks a level of immaturity, that excessive usage of dependencies points to a lack of involvement in giving back to the packages you depend on;
- How the whole ecosystem is fueled by speed, ambition and attention, and that you choose not to play the game everyone plays;
- How immodesty was about being pompous, convoluted, inconsiderate and disproportionate, and how modest about being truthful, small, considerate and proportional.
- That you are more than just a developer, and that taking part in asking business questions can bring prosperity while keeping ambitions modest;
- How React, although popular, might not be a wise choice as the default front-end approach;
- That to build something, you’ll need other abilities, like how to build an audience, how to sell, how to lead others, how be patient and how to stick around for the long haul for the benefits of good timing.
In Part 2, we’ll look at concrete, technical ways to go forward. We’ll also look at situations that you might be in, with some ways out.
First, some definitions:
- MPA - by contrast, a Multi-Page Application is built to have each view served separately by the server. Some packages like Turbolinks (or its general technique called pjax) can be used to give the illusion of a snappy SPA-like experience, but at its core, the views are rendered on the server for each URL.
- event handlers - the browser allows the dispatching of custom events which can be caught by event handlers, executing some code on reception. This is used to catch clicks on a button or a link, changes to input fields, to do something in response to any type of other user interaction, and as we’ll see, to alert other components on the same page of changes.
- DOM - The Document Object Model is the browser’s internal representation of the elements rendered on the page: its HTML hierarchy, each element’s attributes and properties, the relationship between elements (parent, child) and so on. Making changes to the DOM means making changes to the elements on a page and its properties. Typically small DOM changes include changing an element’s class to change how it’s presented, changing a value of an input field or changing the text in one element. Larger changes include changing whole page sections, lists or a series of its sub-items.
- state - an underlying representation of the data that is used to make changes to the view. In the case of a view-model, the state is the data that, if changed, automatically produces changes in the view. Otherwise, in the case of server-generated views, the state would be directly defined in the properties of elements (e.g. the value of an input, or the
data-*attributes of an element), read in-place following a user interaction.
- dependency - an external package defined in a