Skip to content

Instantly share code, notes, and snippets.

View isacjunior's full-sized avatar

Isac isacjunior

View GitHub Profile
const List = ({ items }) => {
return (
<dl>
{items.map(item => (
<Fragment key={item.id}>
<dt>{item.term}</dt>
<dd>{item.description}</dd>
</Fragment>
))}
</dl>
Bundler Time
browserify 22.98s
webpack 20.71s
parcel 9.98s
parcel - with cache 2.64s
@isacjunior
isacjunior / .babelrc
Created February 5, 2018 12:42
babel-parcel
{
"presets": ["env", "react"]
}
@isacjunior
isacjunior / parcel-index.html
Created February 5, 2018 13:02
Parcel Html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Parcel Bundler with React</title>
</head>
<body>
<div id="root"></div>
import React from 'react'
import { render } from 'react-dom'
const App = () => <h1>Parcel Bundler with React</h1>
render(
<App/>,
document.getElementById('root')
)
"scripts": {
"start": "parcel src/index.html -d dev",
"build": "parcel build src/index.html"
}
return (
<div>
<h2>List</h2>
<ul class="list">
<li>Name One</li>
<li>Name Two</li>
</ul>
</div>
)
import { h, render, Component } from "preact"
class Title extends Component {
state = {
defaultName: 'Isac'
}
render({ name }, { defaultName }) {
return <h1 class='title'>{name || defaultName}</h1>
}
{
"plugins": [
["transform-react-jsx", { "pragma":"h" }]
]
}
class PersonClass {
constructor(name) {
this.name = name
}
sayName() {
console.log(this.name)
}
}