Skip to content

Instantly share code, notes, and snippets.

View mereskin-zz's full-sized avatar

Andrey Mereskin mereskin-zz

  • Versal
  • San Francisco, CA
View GitHub Profile
@mereskin-zz
mereskin-zz / requirejs question.md
Created April 19, 2013 02:14
requirejs optimize node app

Given Node.js app with a CJS requires.

app.js

// Depends on underscore
var _ = require('underscore');
var mult = require('./mult');

var app = {
 x: 1,
@mereskin-zz
mereskin-zz / react-component.md
Last active August 29, 2015 13:57
React in web components

Using react in components

Using react in components is actually quite straightforward. Be aware, that there is no easy way to insert a tag with a hyphen in JSX. So your react component should not contain any custom-elements inside.

my-component.html

<script src="./bower_components/versal/runtime.js"></script>
<script src="./bower_components/react/react.js"></script>
<script src="./dist/my-component.js"></script>