Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Commit

Permalink
Switch from Babel to Bublé to save 300b, remove JSX entirely (potenti…
Browse files Browse the repository at this point in the history
…ally fixes #144 as noted by @piuccio).
  • Loading branch information
developit committed Aug 24, 2016
1 parent 791c055 commit 26c3283
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 20 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"no-empty": 0,
"no-console": 0,
"no-unused-vars": [0, { "varsIgnorePattern": "^h$" }],
"brace-style": [2, "stroustrup", { "allowSingleLine":true }],
"no-cond-assign": 1,
"semi": 2,
"camelcase": 0,
Expand Down
15 changes: 3 additions & 12 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path';
import fs from 'fs';
import memory from 'rollup-plugin-memory';
import babel from 'rollup-plugin-babel';
import buble from 'rollup-plugin-buble';
import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';

Expand All @@ -26,17 +26,8 @@ export default {
path: 'src/index.js',
contents: "export { default } from './index';"
}),
babel({
babelrc: false,
comments: false,
exclude: 'node_modules/**',
presets: [
['es2015', { loose:true, modules:false }],
'stage-0'
],
plugins: [
['transform-react-jsx', {pragma:'h'}]
]
buble({
objectAssign: 'extend'
}),
nodeResolve({
jsnext: true,
Expand Down
1 change: 1 addition & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
var renderToString = require('preact-render-to-string');

module.exports = {
Expand Down
7 changes: 2 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,8 @@ class ContextProvider {
}

function renderSubtreeIntoContainer(parentComponent, vnode, container, callback) {
let c = render((
<ContextProvider context={parentComponent.context}>
{vnode}
</ContextProvider>
), container);
let wrap = h(ContextProvider, { context: parentComponent.context }, vnode);
let c = render(wrap, container);
if (callback) callback(c);
return c;
}
Expand Down

0 comments on commit 26c3283

Please sign in to comment.