Skip to content

Instantly share code, notes, and snippets.

View calebdwilliams's full-sized avatar

Caleb Williams calebdwilliams

View GitHub Profile
@WebReflection
WebReflection / fe-vs-be.md
Last active March 27, 2021 19:51
Front End vs Back End in a nutshell.

FE vs BE

TL;DR enough of this kind of nonsense


I've been in the field for ~20 years and started as BE developer, and this is a reference for people thinking that because they are on the BE side, they're somehow entitled to:

  • earn more money
  • feel superior about FE developers
  • joke about JavaScript or minimize the FE effort in any way
@jonikorpi
jonikorpi / css.js
Last active September 4, 2021 01:38
Single-file components in React, using Constructable Stylesheets
// https://github.com/calebdwilliams/construct-style-sheets
import "construct-style-sheets-polyfill";
export default strings => {
if (document.readyState === "loading") {
window.addEventListener("DOMContentLoaded", () => adopt(strings));
} else {
adopt(strings);
}
};
@paulirish
paulirish / what-forces-layout.md
Last active May 17, 2024 18:01
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent