Skip to content

Commit

Permalink
merge newest master
Browse files Browse the repository at this point in the history
  • Loading branch information
rofrischmann committed Sep 25, 2018
2 parents e95e1e6 + fd1b8d8 commit 694fc34
Show file tree
Hide file tree
Showing 105 changed files with 3,453 additions and 343 deletions.
19 changes: 5 additions & 14 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
[ignore]

# Disable module with broken flow types.
.*/node_modules/babylon/*.*
.*/node_modules/config-chain/*.*
.*/node_modules/npm/*.*
.*/node_modules/npmi/*.*
.*/node_modules/react-native/*.*
.*/node_modules/fbjs/lib/partitionObjectByKey.js
.*/node_modules/conventional-changelog-core/test/fixtures/_malformation.json
.*/node_modules/polished/*.*
.*/node_modules/findup/*.*
.*/node_modules/jss/*.*
.*/lib/
.*/es/
./benchmarks/
./examples/

module.name_mapper='(react-native)' -> 'empty/object'
module.name_mapper='(preact)' -> 'empty/object'
[version]
^0.57.3
^0.81.0
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ If you're searching for older version-based release notes please check out the o

> Dates follow the `dd/mm/yy` notation.
## 25/09/18
| Package | Version | Changes |
| --- | --- | --- |
| fela-combine-arrays | 1.0.9 | [(#613)](https://github.com/rofrischmann/fela/pull/613) deprecated package |
| fela<br>fela-native<br>fela-plugin-extend<br>fela-plugin-custom-property<br>fela-plugin-simulate<br>fela-plugin-native-media-query | 6.2.2<br>5.0.25<br>6.0.10<br>7.0.4<br>6.0.6<br>6.0.12 | [(#613)](https://github.com/rofrischmann/fela/pull/613) updated [css-in-js-utils](https://github.com/rofrischmann/css-in-js-utils) to 3.0.0 to get rid of fela-combine-arrays |
| fela-dom | 8.0.2 | [(#609)](https://github.com/rofrischmann/fela/pull/609) fixed a bug where rehydration failed for iOS 12 Safari |
| jest-fela-bindings<br>jest-react-fela<br>jest-preact-fela<br>jest-inferno-fela | 1.0.0<br>1.0.0<br>1.0.0<br>1.0.0 | [(#582)](https://github.com/rofrischmann/fela/pull/582) initial release |


## 03/09/18
| Package | Version | Changes |
| --- | --- | --- |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ We'd love to help out. We also highly appreciate any feedback.
- [Bookmyshow](https://in.bookmyshow.com/events)
- [BdP LV RPS](http://www.bdp-rps.de)
- [Cloudflare](https://www.cloudflare.com)
- [Espressive](https://www.espressive.com)
- [dm-drogerie markt](https://www.dm.de/arbeiten-und-lernen/arbeiten-bei-uns/filiadata-c534052.html)
- [HelloFresh](https://www.hellofresh.de)
- [Indoqa](https://www.indoqa.com)
Expand Down
2 changes: 2 additions & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
* [6.4.7. Provider](docs/api/bindings/Provider.md)
* [6.4.8. ThemeProvider](docs/api/bindings/ThemeProvider.md)
* [6.4.9. withTheme](docs/api/bindings/withTheme.md)
* 6.5. jest + react/preact/inferno
* [6.5.1. createSnapshot](docs/api/jest-bindings/createSnapshot.md)
* [7. Migration Guide](MIGRATION.md)
* [8. Changelog](CHANGELOG.md)
* [9. FAQ](docs/FAQ.md)
Expand Down
7 changes: 6 additions & 1 deletion docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,9 @@ This includes React, Preact and Inferno.
* [`<FelaTheme theme render>`](api/bindings/FelaTheme.md)
* [`<Provider renderer>`](api/bindings/Provider.md)
* [`<ThemeProvider theme [overwrite]>`](api/bindings/ThemeProvider.md)
* [`withTheme(component)`](docs/withTheme.md)
* [`withTheme(component)`](api/bindings/withTheme.md)

---

### Jest Bindings
* [`createSnapshot(component, [theme], [renderer], [Provider], [ThemeProvider])`](api/jest-bindings/createSnapshot.md)
87 changes: 87 additions & 0 deletions docs/api/jest-bindings/createSnapshot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# createSnapshot

Renders Fela components into a string snapshot including both rendered HTML and CSS to achieve predictable component tests.

It formats and optimises the output for maximum readability.

## Arguments

| Argument | Type | Default | Description |
| --- | --- | --- | --- |
| component | [*Component*](https://facebook.github.io/react/docs/top-level-api.html#react.component) | | A valid React component that is rendered. |
| theme | *Object?* | `{}` | A theme object that is automatically used for rendering. |
| renderer | [*Renderer?*](../fela/Renderer.md) | `createRenderer()` | A Fela renderer with custom configuration |
| Provider | [*Provider?*](../bindings/Provider.md) | bindings specific Provider | A custom Provider component |
| ThemeProvider | [*ThemeProvider?*](../bindings/ThemeProvider.md) | bindings specific ThemeProvider | A custom ThemeProvider component |

## Returns
(*string*): Formatted string including CSS and HTML.

## Imports
```javascript
import { createSnapshot } from 'jest-react-fela'
import { createSnapshot } from 'jest-preact-fela'
import { createSnapshot } from 'jest-inferno-fela'
```

## Example
```javascript
describe('Rendering a Fela component', () => {
it('should render correctly', () => {
const snapshot = createSnapshot(
<FelaComponent style={{ color: 'blue', backgroundColor: 'black' }} />
)

expect(snapshot).toMatchSnapshot()
})
})
```
##### Snapshot
```
.a {
color: blue
}
.b {
background-color: black
}
<div className=a b />
```

### Using theme

```javascript
describe('Rendering a Fela component', () => {
it('should render correctly', () => {
const rule = ({ theme }) => ({
backgroundColor: theme.primary,
color: theme.secondary
})

const theme = {
primary: 'blue',
secondary: 'red'
}

const snapshot = createSnapshot(
<FelaComponent rule={rule} />,
theme
)

expect(snapshot).toMatchSnapshot()
})
})
```
##### Snapshot
```
.a {
background-color: blue
}
.b {
color: red
}
<div className=a b />
```
8 changes: 4 additions & 4 deletions examples/angular2-typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "example-angular2-typescript",
"version": "2.0.26",
"version": "2.0.27",
"description": "Fela example with Angular2 in TypeScript",
"scripts": {
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
Expand All @@ -24,12 +24,12 @@
"@angular/router-deprecated": "2.0.0-rc.2",
"@angular/upgrade": "2.0.0-rc.4",
"angular2-in-memory-web-api": "0.0.14",
"bootstrap": "^3.3.6",
"bootstrap": "^4.1.2",
"codelyzer": "0.0.25",
"concurrently": "^2.0.0",
"core-js": "^2.4.0",
"fela": "^6.2.1",
"fela-dom": "^8.0.1",
"fela": "^6.2.2",
"fela-dom": "^8.0.2",
"lite-server": "^2.2.0",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
Expand Down
6 changes: 3 additions & 3 deletions examples/angular2-typescript/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ boom@2.x.x:
dependencies:
hoek "2.x.x"

bootstrap@^3.3.6:
version "3.3.7"
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-3.3.7.tgz#5a389394549f23330875a3b150656574f8a9eb71"
bootstrap@^4.1.2:
version "4.1.3"
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.1.3.tgz#0eb371af2c8448e8c210411d0cb824a6409a12be"

boxen@^0.6.0:
version "0.6.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/angular2/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "example-angular2",
"version": "2.0.5",
"version": "2.0.6",
"license": "MIT",
"scripts": {
"start": "npm run bundle & http-server -a 0.0.0.0 -p 9000",
Expand Down
20 changes: 10 additions & 10 deletions examples/inferno/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "example-inferno",
"version": "2.0.30",
"version": "2.0.31",
"description": "Fela example with Inferno",
"scripts": {
"client": "NODE_ENV=development webpack-dev-server",
Expand All @@ -17,20 +17,20 @@
"concurrently": "^3.4.0",
"express": "^4.14.0",
"express-http-proxy": "^1.0.0",
"fela": "^6.2.1",
"fela-beautifier": "^5.0.16",
"fela-dom": "^8.0.1",
"fela": "^6.2.2",
"fela-beautifier": "^5.0.17",
"fela-dom": "^8.0.2",
"fela-perf": "^5.0.3",
"fela-plugin-embedded": "^5.2.11",
"fela-plugin-fallback-value": "^5.0.18",
"fela-plugin-embedded": "^5.2.12",
"fela-plugin-fallback-value": "^5.0.19",
"fela-plugin-logger": "^5.0.5",
"fela-plugin-lvha": "^5.0.16",
"fela-plugin-prefixer": "^5.0.19",
"fela-plugin-unit": "^5.1.0",
"fela-plugin-validator": "^5.2.3",
"fela-plugin-prefixer": "^5.0.20",
"fela-plugin-unit": "^5.1.1",
"fela-plugin-validator": "^5.2.4",
"inferno": "^4.0.0",
"inferno-create-element": "^4.0.0",
"inferno-fela": "^9.0.1",
"inferno-fela": "^9.0.2",
"inferno-server": "^4.0.0",
"webpack": "^2.6.1",
"webpack-dev-server": "^2.4.5"
Expand Down
20 changes: 10 additions & 10 deletions examples/preact/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "example-preact",
"version": "2.0.30",
"version": "2.0.31",
"description": "Fela example with Preact",
"scripts": {
"client": "NODE_ENV=development webpack-dev-server",
Expand All @@ -17,19 +17,19 @@
"concurrently": "^3.1.0",
"express": "^4.14.0",
"express-http-proxy": "^1.0.3",
"fela": "^6.2.1",
"fela-beautifier": "^5.0.16",
"fela-dom": "^8.0.1",
"fela": "^6.2.2",
"fela-beautifier": "^5.0.17",
"fela-dom": "^8.0.2",
"fela-perf": "^5.0.3",
"fela-plugin-embedded": "^5.2.11",
"fela-plugin-fallback-value": "^5.0.18",
"fela-plugin-embedded": "^5.2.12",
"fela-plugin-fallback-value": "^5.0.19",
"fela-plugin-logger": "^5.0.5",
"fela-plugin-lvha": "^5.0.16",
"fela-plugin-prefixer": "^5.0.19",
"fela-plugin-unit": "^5.1.0",
"fela-plugin-validator": "^5.2.3",
"fela-plugin-prefixer": "^5.0.20",
"fela-plugin-unit": "^5.1.1",
"fela-plugin-validator": "^5.2.4",
"preact": "^8.1.0",
"preact-fela": "^8.0.1",
"preact-fela": "^8.0.2",
"preact-render-to-string": "^3.6.0",
"webpack": "^2.6.1",
"webpack-dev-server": "^2.4.5"
Expand Down
18 changes: 9 additions & 9 deletions examples/react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"private": true,
"name": "example-react-native",
"version": "1.0.29",
"version": "1.0.30",
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"devDependencies": {
"babel-preset-react-native": "^1.0.1",
"create-react-native-app": "^0.0.6",
"fela": "^6.2.1",
"fela-dom": "^8.0.1",
"fela-native": "^5.0.24",
"fela-plugin-extend": "^6.0.9",
"fela-plugin-native-media-query": "^6.0.11",
"fela-tools": "^5.2.1",
"fela-utils": "^8.1.1",
"fela": "^6.2.2",
"fela-dom": "^8.0.2",
"fela-native": "^5.0.25",
"fela-plugin-extend": "^6.0.10",
"fela-plugin-native-media-query": "^6.0.12",
"fela-tools": "^5.2.2",
"fela-utils": "^8.1.2",
"react": "^16.0.0-alpha.6",
"react-fela": "^8.0.1",
"react-fela": "^8.0.2",
"react-native": "0.44.0"
}
}
22 changes: 11 additions & 11 deletions examples/react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "example-react",
"version": "2.0.30",
"version": "2.0.31",
"description": "Fela example with React",
"scripts": {
"client": "NODE_ENV=development webpack-dev-server",
Expand All @@ -17,21 +17,21 @@
"concurrently": "^3.4.0",
"express": "^4.14.0",
"express-http-proxy": "^1.0.3",
"fela": "^6.2.1",
"fela-beautifier": "^5.0.16",
"fela-dom": "^8.0.1",
"fela-layout-debugger": "^6.0.18",
"fela": "^6.2.2",
"fela-beautifier": "^5.0.17",
"fela-dom": "^8.0.2",
"fela-layout-debugger": "^6.0.19",
"fela-perf": "^5.0.3",
"fela-plugin-embedded": "^5.2.11",
"fela-plugin-fallback-value": "^5.0.18",
"fela-plugin-embedded": "^5.2.12",
"fela-plugin-fallback-value": "^5.0.19",
"fela-plugin-logger": "^5.0.5",
"fela-plugin-lvha": "^5.0.16",
"fela-plugin-prefixer": "^5.0.19",
"fela-plugin-unit": "^5.1.0",
"fela-plugin-validator": "^5.2.3",
"fela-plugin-prefixer": "^5.0.20",
"fela-plugin-unit": "^5.1.1",
"fela-plugin-validator": "^5.2.4",
"react": "^15.1.0",
"react-dom": "^15.1.0",
"react-fela": "^8.0.1",
"react-fela": "^8.0.2",
"webpack": "^2.6.1",
"webpack-dev-server": "^2.4.5"
},
Expand Down
6 changes: 3 additions & 3 deletions examples/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "example-typescript",
"version": "1.0.14",
"version": "1.0.15",
"description": "Fela example with React and Typescript",
"scripts": {
"start": "webpack-dev-server --open"
Expand All @@ -24,9 +24,9 @@
"dependencies": {
"@types/react": "^16.0.18",
"@types/react-dom": "^16.0.2",
"fela": "^6.2.1",
"fela": "^6.2.2",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-fela": "^8.0.1"
"react-fela": "^8.0.2"
}
}
Loading

0 comments on commit 694fc34

Please sign in to comment.