Skip to content

Instantly share code, notes, and snippets.

View ninetails's full-sized avatar
🏳️‍⚧️
traaa

Nina Kitsu ninetails

🏳️‍⚧️
traaa
View GitHub Profile
const bypass = [
// function names to avoid logging
];
const collapsed = [
// function names to groupCollapsed
];
module.exports = function(babel) {
const { types: t } = babel;
const wrapFunctionBody = babel.template(`{
@Rich-Harris
Rich-Harris / what-is-svelte.md
Last active March 27, 2024 06:09
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

// per https://docs.npmjs.com/misc/scripts, npm exposes a bunch of variables to
// the environment prefixed with npm_config_*, npm_package_* and npm_lifecycle_*.
// Here's a list of all variables exposed in my setup.
npm_config_access=
npm_config_allow_same_version=
npm_config_also=
npm_config_always_auth=
npm_config_argv='{"remain":[],"cooked":["run","foo"],"original":["run","foo"]}'
npm_config_auth_type=legacy
PATH_TO_JAR="node_modules/superstartup-closure-compiler/build"
JAR="${PATH_TO_JAR}/compiler.jar"
ELM_JS_FILE="app/scripts/elm_components/elm.js"
TMP_FILE=".tmp/elm.js"
if [ ! -f ${JAR} ]; then
echo "google-closure-compiler JAR not found, make sure you `npm install` the `superstartup-closure-compiler` package"
else
java -jar ${JAR} --compilation_level=ADVANCED_OPTIMIZATIONS --js="${ELM_JS_FILE}" --js_output_file="${TMP_FILE}" --language_in=ECMASCRIPT5
mv ${TMP_FILE} ${ELM_JS_FILE}
@richardscarrott
richardscarrott / !react-enzyme-render-methods.md
Last active September 9, 2020 01:39
react-enzyme - `shallow` vs `mount` vs `render` lifecycle methods

An exploration of the different render methods available in react-enzyme.

@plugnburn
plugnburn / README.md
Last active June 1, 2018 21:42
XT.js - DOM construction / templating library in 18 lines of JS, 323 bytes minified

XT.js

Let's close the ultra-small library cycle with some awesome array-based templating. 323 bytes minified.

How to obtain

Just download the minified version here or include it into your code:

@mheiber
mheiber / app.js
Created January 7, 2016 02:38
Memoizing React stateless function components
import React from 'react';
import {render} from 'react-dom';
import memoize from 'memoization';
const Foo = ({number}) => {
console.log(`Rendering with number= ${number}`);
return <div>{number}</div>
};
// `memoize` caches the return value of a function.
@Couto
Couto / webpack.js
Last active November 11, 2020 17:53
Fetch polyfill with webpack
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
var folders = {
APP: path.resolve(__dirname, '../app'),
BUILD: path.resolve(__dirname, '../build'),
BOWER: path.resolve(__dirname, '../bower_components'),
NPM: path.resolve(__dirname, '../node_modules')
};
@ericelliott
ericelliott / essential-javascript-links.md
Last active April 22, 2024 10:15
Essential JavaScript Links
@staltz
staltz / introrx.md
Last active May 6, 2024 01:44
The introduction to Reactive Programming you've been missing