I made a little styling lib called glam
(some features are in development)
let's start off with the simplest use case. we'll make an 'index.html' page,
and assume we've setup our js bundler to output bundle.js
I made a little styling lib called glam
(some features are in development)
let's start off with the simplest use case. we'll make an 'index.html' page,
and assume we've setup our js bundler to output bundle.js
Trying to attempt a similar pattern in Web Components that was done here in React. Props to James Kyle for the original idea :)
import { Component, h } from 'skatejs'; | |
class Deferred extends Component { | |
renderCallback () { | |
return <span>Yay! Loaded!!!</span>; | |
} | |
} | |
customElements.define('x-deferred', Deferred); |
/** @jsx h */ | |
// You only need custom elements for this!!! | |
import 'skatejs-web-components/src/native-shim'; | |
import { Component, define, h, prop } from 'skatejs'; | |
import ShadowNode, { scopeCss, scopeTree } from './shadow-node'; | |
// Converts real DOM nodes into Incremental DOM nodes. | |
// | |
// This is orthogonal to this gist, but makes it so we can distribute real |
import hify from './create-element'; | |
import React from 'react'; | |
import { render } from 'react-dom'; | |
const h = hify(React.createElement.bind(React)); | |
class Test extends HTMLElement { | |
static observedAttributes = ['attr'] | |
attributeChangedCallback (name, oldValue, newValue) { | |
this.innerHTML = `Hello, ${this.getAttribute('attr')}!`; |
<!doctype html> | |
<html> | |
<title>Flatten.js, General SVG Flattener</title> | |
<head> | |
<script> | |
/* | |
Random path and shape generator, flattener test base: http://jsfiddle.net/xqq5w/embedded/result/ | |
Basic usage example: http://jsfiddle.net/Nv78L/3/embedded/result/ |
Follow-up to Top-level await is a footgun – maybe read that first
Here are some things I believe to be true:
require(...)
or await import(...)
).await
is such a construct.This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:
(async main(){...}())
as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problemsI'll leave the rest of this document unedited, for archaeological
We dropped Lerna from our monorepo architecture in PouchDB 6.0.0. I got a question about this from @reconbot, so I thought I'd explain our reasoning.
First off, I don't want this post to be read as "Lerna sucks, don't use Lerna." We started out using Lerna, but eventually outgrew it because we wrote our own custom thing. Lerna is still a great idea if you're getting started with monorepos (monorepi?).
Backstory: