Skip to content

Commit

Permalink
Merge pull request #12 from rstacruz/fix/es5-build-rollup-config
Browse files Browse the repository at this point in the history
Deprecate es6 build, improve create-react-app compatibility; demos
  • Loading branch information
rstacruz authored Apr 21, 2019
2 parents 32c05a0 + 9208d06 commit 1b0b7e2
Show file tree
Hide file tree
Showing 18 changed files with 10,892 additions and 8,407 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
## [v0.11.0]

> Apr 22, 2019
v0.11 brings improved create-react-app support!

- Deprecate the `remount/es6` build. Just use the default `remount` build, which is now compatible with create-react-app. ([#12])
- The bundles are now made a bit slimmer. ([#12])
- Add demos in the repo, so you can try Remount in a sandbox. ([#12])

[#12]: https://github.com/rstacruz/remount/pull/12
[v0.11.0]: https://github.com/rstacruz/remount/compare/v0.10.0...v0.11.0

## [v0.10.0]

> Apr 22, 2019
v0.10 brings improved Shadow DOM support, and Rails Webpacker support!

- Add a workaround for React elements in Shadow DOM mode. ([#8], [@rybon])
- Fix compatibility with Webpacker by making the main export `.js` instead of `.mjs`. ([#11])
- Deprecate importing using `import remount from 'remount/esm'` - just use `'remount'` instead. ([#11])
Expand Down
23 changes: 23 additions & 0 deletions demos/create-react-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
3 changes: 3 additions & 0 deletions demos/create-react-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This is a small demo sandbox to try Remount.

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
29 changes: 29 additions & 0 deletions demos/create-react-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "demo",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-scripts": "2.1.8",
"remount": "*"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"resolutions": {
"remount": "file:../../"
}
}
41 changes: 41 additions & 0 deletions demos/create-react-app/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="theme-color" content="#000000" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
33 changes: 33 additions & 0 deletions demos/create-react-app/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.App {
text-align: center;
}

.App-logo {
animation: App-logo-spin infinite 20s linear;
height: 40vmin;
pointer-events: none;
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
31 changes: 31 additions & 0 deletions demos/create-react-app/src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React, { Component } from 'react'
import logo from './logo.svg'
import './App.css'

class App extends Component {
render() {
return (
<div className='App'>
<header className='App-header'>
<img src={logo} className='App-logo' alt='logo' />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<p>
<x-hello />
</p>
<a
className='App-link'
href='https://reactjs.org'
target='_blank'
rel='noopener noreferrer'
>
Learn React
</a>
</header>
</div>
)
}
}

export default App
14 changes: 14 additions & 0 deletions demos/create-react-app/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
body {
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
13 changes: 13 additions & 0 deletions demos/create-react-app/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
import App from './App'
import { define } from 'remount'

ReactDOM.render(<App />, document.getElementById('root'))

define({
'x-hello': () => {
return <div>Hello from Remount :)</div>
}
})
7 changes: 7 additions & 0 deletions demos/create-react-app/src/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1b0b7e2

Please sign in to comment.