Web front-end

What is front-end?

"In software engineering, the terms "front end" and "back end" are distinctions which refer to the separation of concerns between a presentation layer and a data access layer respectively."

History

- HTML coder

- Content manager

- Web developer

- Javascript developer

- Web engineer

2007/2008

Front-end web developer

by Nate Koechley (Yahoo)

Browsers wars

Web front-end

Knowledge areas x 9

html ,css, javascript, dom, bom, data transport, specifications, implementations, tooling

Platforms x 7

Windows, OS X, Linux, iOS, Android, Windows Mobile, TV

Browsers x 5

IE, Opera, Chrome, Firefox, Safari

Rendering x 5

Default, transcoder, webview, standalone, quirks mode

x 1575

Web front-end

All working? Congratulations! 

You resolved a lot of problems.

But...

1 miss ~ 15 problems

Web front-end

No trust

Different engines, different approach

No planing

No roadmap

No compile

Trust browsers...but see first paragraph

Normal front-end reaction after first tests

Web front-end matters in html

- Viewport

- Screen DPI

- Meta information

- Icons

- Semantics

- Accessibility 

- User input

- Open graph

- SVG/SMIL/VML

- XSLT/XML/DTD

- DHTML/DOM 0

Web front-end matters in css

- CSS Selectors

- Fonts

- Units

- Functions

- Vars

- Filters

- Grid

- Animation

- Touch events

- Render tree

- Repaint

- Processing

Web front-end matters in javascript

- ES 3/5/2015/2016

- Typescript/CoffeeScript

- Universal javascript

- Application architecture

- AMD/Commonjs

- Event loop

- Runtime (block or not)

- JIT

- Profiles

- Recalculate

- Workers

 

Web front-end API

Web front-end matters...

User experience, accessibility, testing, seo, design, usability, performance, semantics, progressive enhancement , graceful degradation, cvs, cli, ssh, package manager, security, build, livereload, pipes, data formats, fonts, graphics, gpu, open gl, sql, networks, tcp/ip, http, spdy, gzip, deflate, base64, mvp, mvc, mvvc, reactive programming, functional programming, object oriented programming, screen sizes, orientation, jit, ast, llvm, dns, workers, fps, regexp, csrf, clickjacking, bots, pc devices, android app, ios sandbox, nginx, crypto ...

compatibility and bugs

Tabs example

var tabs = $('.tab').click(function () {
  tabs.hide().filter(this.hash).show();
}).map(function () {
  return $(this.hash)[0];
});

$('.tab:first').click();

Tabs example

- All content is navigable and available without JavaScript 

- ARIA roles

- Clickable

- Anchor

- Open in new window/tab

- Right/Shift click doesn’t cause the tab to be selected

- Native browser Back/Forward button

Tabs example

/*global $*/

// a temp value to cache *what* we're about to show
var target = null;

// collect all the tabs
var tabs = $('.tab').on('click', function () {
  console.log('click')
  target = $(this.hash).removeAttr('id');
  if (location.hash === this.hash) {
    setTimeout(update);
  }
}).attr('tabindex', '0');

// get an array of the panel ids (from the anchor hash)
var targets = tabs.map(function () {
  return this.hash;
}).get();

// use those ids to get a jQuery collection of panels
var panels = $(targets.join(',')).each(function () {
  // keep a copy of what the original el.id was
  $(this).data('old-id', this.id);
});

function update() {
  console.log('update')
  if (target) {
    target.attr('id', target.data('old-id'));
    target = null;
  }
  
  var hash = window.location.hash;
  if (targets.indexOf(hash) !== -1) {
    return show(hash);
  }
  
  // NOTE: this was added after the article was written
  // to fix going "back" on the browser nav to an empty state
  if (!hash) {
    show();
  }
}

function show(id) {
  // if no value was given, let's take the first panel
  if (!id) {
    id = targets[0];
  }
  // remove the selected class from the tabs,
  // and add it back to the one the user selected
  tabs.removeClass('selected').attr('aria-selected', 'false').filter(function () {
    return (this.hash === id);
  }).addClass('selected').attr('aria-selected', 'true');

  // now hide all the panels, then filter to
  // the one we're interested in, and show it
  panels.hide().attr('aria-hidden', 'true').filter(id).show().attr('aria-hidden', 'false');
}

window.addEventListener('hashchange', update);

// initialise
if (targets.indexOf(window.location.hash) !== -1) {
  update();
} else {
  show();
}
<ul role="tablist" class="tabs">
    <li><a role="tab" aria-controls="dizzy" class="tab" href="#dizzy">Dizzy</a></li>
    <li><a role="tab" aria-controls="ninja" class="tab" href="#ninja">Ninja</a></li>
    <li><a role="tab" class="tab" aria-controls="missy" href="#missy">Missy</a></li>
  </ul>

  <div role="tabpanel" class="panel" id="dizzy">
    <img src="https://jsbin-user-assets.s3.amazonaws.com/rem/dizzy.jpg" alt="Photo of Dizzy">
    <dl>
      <dt>Name</dt>
      <dd>Dizzy</dd>
      <dt>Colour</dt>
      <dd>Tabby</dd>
      <dt>Super power</dt>
      <dd>Sleeping</dd>
    </dl>
  </div>
  <div role="tabpanel" class="panel" id="ninja">
    <img src="https://jsbin-user-assets.s3.amazonaws.com/rem/ninja.jpg" alt="Photo of Ninja">
    <dl>
      <dt>Name</dt>
      <dd>Lord Ninja of Catville</dd>
      <dt>Colour</dt>
      <dd>Black & White</dd>
      <dt>Super power</dt>
      <dd>Most pathetic meow known to catkind</dd>
    </dl>
  </div>
  <div role="tabpanel" class="panel" id="missy">
    <img src="https://jsbin-user-assets.s3.amazonaws.com/rem/missy.jpg" alt="Photo of Missy">
    <dl>
      <dt>Name</dt>
      <dd>Missy</dd>
      <dt>Colour</dt>
      <dd>Black</dd>
      <dt>Super power</dt>
      <dd>Computer hardware protection</dd>
    </dl>
  </div>

Mobile web age

Popular this year

JavaScript (ES 6 / 7) which is renamed to ES2015 and ES2016, Babel, Closure, Clojure, React, Ember, Backbone, Oboe, Angular (1 & 2), Web Workers, Service Workers, RAIL, Rails, Hot Loading, Node.js & iojs, Promises, Observables, GraphQL, CSP & Channels, core.async, immutable, HTML5, npm, build tools, brunch, gulp, grunt, npm scripts, broccoli, ember-cli, mocha, chai, karma, sinon, jQuery, vanilla.js, Mithril, virtual doms, routing, isomorphic & universal code, Express, Koa, Elm, CLJS, PureScript, TypeScript, Flow, static type checking, compilers, compile-to-js languages, browserify, rollup, commonjs, amd, umd, SystemJS, js-to-native packages, Haskell, type systems, lambda calculus, functional programming, Meteor, transpilers, variadic behavior, context vs. contextless approaches, offline first, deployment tools, docker, macros, languages extensions, sweet.js, containers, container management services, dev-ops & web-ops, WebRTC, JSCS, style guides, linting, WebGL, Unity engine, benchmark suites, online coding environments…

Popular this year

ES2015 and ES2016

- RAIL

- Web Component

- App Shell

- Web app

- Universal javascript

Links

Front-end

By Sasha Pinchuk

Front-end

  • 958