Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emotion Native #759

Merged
merged 37 commits into from
Jul 28, 2018
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6b9f575
Init commit
nitin42 Jul 9, 2018
91380c2
add emotion-native
nitin42 Jul 9, 2018
38d3012
remove unused imports
nitin42 Jul 9, 2018
db3d964
added basic types
nitin42 Jul 9, 2018
d545607
fix flow types
nitin42 Jul 9, 2018
6ec1ff3
add jsdom env when testing
nitin42 Jul 9, 2018
94b0c28
fixed import statement
nitin42 Jul 13, 2018
25d75bc
fixed import statement and updated package.json
nitin42 Jul 13, 2018
ae75fe3
added test for Emotion native css/css({})
nitin42 Jul 13, 2018
b80e73f
added new keywords
nitin42 Jul 13, 2018
fc1beb9
added documentation for @emotion/native
nitin42 Jul 13, 2018
ddb2dd2
added docs for @emotion/primitives-core
nitin42 Jul 13, 2018
ee2181c
fixed docs and flow types
nitin42 Jul 14, 2018
f839c70
fixed conflicts
nitin42 Jul 14, 2018
95c28d3
fixed conflicts
nitin42 Jul 14, 2018
47f5035
fixed conflicts
nitin42 Jul 15, 2018
fdc1876
update @emotion/primitives version
nitin42 Jul 15, 2018
abca5e7
Update package.json
emmatown Jul 15, 2018
c656626
Update package.json
emmatown Jul 15, 2018
b967b7d
Change package.json formatting
emmatown Jul 15, 2018
2cf1a06
Most things are fixed
emmatown Jul 15, 2018
1073a66
Update snapshots
emmatown Jul 15, 2018
341e192
added example for react-360
nitin42 Jul 15, 2018
f427e40
fixed flow types
nitin42 Jul 16, 2018
f8483e2
update react-native version
nitin42 Jul 16, 2018
fdaf228
added default value for options
nitin42 Jul 16, 2018
00881d1
update function signature in primitives
nitin42 Jul 16, 2018
df1d259
Update README.md
tkh44 Jul 16, 2018
be12b5c
add react to peerDependencies
nitin42 Jul 18, 2018
6a1b33b
Refactor: default export in native
nitin42 Jul 18, 2018
32b27c1
fix wording in docs
nitin42 Jul 18, 2018
f87c05d
Merge branch 'master' into emotion-native
emmatown Jul 21, 2018
975bc68
Fix snapshots
emmatown Jul 23, 2018
4f3f998
Merge remote-tracking branch 'upstream/master' into emotion-native
emmatown Jul 23, 2018
4e8ca76
Merge branch 'master' into emotion-native
emmatown Jul 27, 2018
8c6694e
Loosen peerDep on react-native
emmatown Jul 28, 2018
84c1bb9
Merge branch 'master' into emotion-native
emmatown Jul 28, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ module.exports = {
coveragePathIgnorePatterns: [
'/node_modules/',
'<rootDir>/packages/babel-plugin-emotion/test/util.js'
]
],
preset: 'react-native'
}
311 changes: 144 additions & 167 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,169 +1,146 @@
{
"private": true,
"version": "7.0.13",
"scripts": {
"build:watch": "node scripts/build/watch",
"build": "node scripts/build",
Copy link
Member

@emmatown emmatown Jul 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be able to revert these formatting changes in the package.jsons?

"test:size": "npm-run-all build size",
"test:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --watch",
"test": "npm-run-all -p lint:check coverage test:size test:typescript flow && npm run test:prod",
"test:typescript": "lerna run test:typescript --parallel",
"coverage": "jest --coverage --no-cache --ci --runInBand",
"test:prod": "npm run build && jest -c jest.dist.js --no-cache --ci --runInBand",
"lint:check": "eslint .",
"test:watch": "jest --watch --no-cache",
"size": "bundlesize",
"release": "npm run build && lerna publish",
"lint": "eslint . --fix",
"benchmark": "lerna exec --scope benchmarks npm run benchmark",
"start:site": "lerna exec --scope emotion-site npm run start:site",
"build:site": "lerna exec --scope emotion-site npm run build:site",
"bootstrap": "lerna bootstrap",
"flow": "flow check"
},
"resolutions": {
"**/react": "^16.3.2",
"**/react-dom": "^16.3.2",
"**/browserslist": "^3.2.8"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.51",
"@babel/plugin-external-helpers": "7.0.0-beta.51",
"@babel/preset-env": "7.0.0-beta.51",
"@babel/preset-flow": "7.0.0-beta.51",
"@babel/preset-react": "7.0.0-beta.51",
"@babel/preset-stage-0": "7.0.0-beta.51",
"babel-check-duplicated-nodes": "^1.0.0",
"babel-cli": "^6.24.1",
"babel-core": "^6.24.1",
"babel-eslint": "^8.2.3",
"babel-flow-types": "^1.2.3",
"babel-jest": "^23.2.0",
"babel-plugin-closure-elimination": "^1.3.0",
"babel-plugin-codegen": "^1.2.0",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-macros": "^2.0.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.5.1",
"babel-preset-flow": "^6.23.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"bundlesize": "^0.13.2",
"codecov": "^2.3.1",
"css": "^2.2.1",
"cssjanus": "^1.2.0",
"enzyme": "^3.1.1",
"enzyme-adapter-react-16": "^1.0.4",
"enzyme-to-json": "^3.2.1",
"eslint": "^4.5.0",
"eslint-config-prettier": "^2.3.0",
"eslint-config-react": "^1.1.7",
"eslint-config-standard": "^10.2.1",
"eslint-config-standard-react": "^5.0.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.1.1",
"eslint-plugin-prettier": "^2.2.0",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-react": "^7.3.0",
"eslint-plugin-standard": "^3.0.1",
"flow-bin": "^0.73.0",
"gatsby-react-router-scroll": "^1.0.7",
"get-lerna-packages": "^0.1.0",
"hoist-non-react-statics": "^2.3.1",
"jest": "^23.2.0",
"jest-in-case": "^1.0.2",
"jest-serializer-html": "^4.0.1",
"jest-watch-typeahead": "^0.1.0",
"jsdom": "^11.3.0",
"lerna": "^2.2.0",
"lerna-alias": "^3.0.1",
"module-alias": "^2.0.1",
"npm-run-all": "^4.0.2",
"polished": "^1.2.1",
"prettier": "1.10.2",
"raf": "^3.4.0",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-router-dom": "^4.2.2",
"react-test-renderer": "^16.3.2"
},
"author": "Kye Hohenberger",
"homepage": "https://github.com/tkh44/emotion#readme",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/tkh44/emotion.git"
},
"directories": {
"test": "tests"
},
"keywords": [
"styles",
"emotion",
"react",
"css",
"css-in-js"
],
"eslintConfig": {
"extends": [
"standard",
"standard-react",
"prettier",
"prettier/react"
],
"plugins": [
"prettier"
],
"parser": "babel-eslint",
"rules": {
"prettier/prettier": "error",
"react/prop-types": 0,
"react/no-unused-prop-types": 0,
"standard/computed-property-even-spacing": 0,
"no-template-curly-in-string": 0,
"camelcase": 0,
"import/no-duplicates": 0
},
"env": {
"browser": true
},
"overrides": [
{
"files": [
"*.test.js",
"**/__tests__/*"
],
"env": {
"jest": true
}
},
{
"files": [
"**/packages/*/src/*",
"**/packages/*/src/**/*"
],
"rules": {
"import/no-commonjs": 2
}
}
]
},
"workspaces": [
"packages/*",
"site",
"scripts/*"
],
"bugs": {
"url": "https://github.com/tkh44/emotion/issues"
},
"bundlesize": [
{
"path": "./packages/emotion/dist/emotion.umd.min.js",
"threshold": "7 Kb"
},
{
"path": "./packages/react-emotion/dist/emotion.umd.min.js",
"threshold": "9.7 Kb"
}
]
"private": true,
"version": "7.0.13",
"scripts": {
"build:watch": "node scripts/build/watch",
"build": "node scripts/build",
"test:size": "npm-run-all build size",
"test:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --watch",
"test": "npm-run-all -p lint:check coverage test:size test:typescript flow && npm run test:prod",
"test:typescript": "lerna run test:typescript --parallel --env=jsdom",
"coverage": "jest --coverage --no-cache --ci --runInBand",
"test:prod": "npm run build && jest -c jest.dist.js --no-cache --ci --runInBand --env=jsdom",
"lint:check": "eslint .",
"test:watch": "jest --watch --no-cache --env=jsdom",
"size": "bundlesize",
"release": "npm run build && lerna publish",
"lint": "eslint . --fix",
"benchmark": "lerna exec --scope benchmarks npm run benchmark",
"start:site": "lerna exec --scope emotion-site npm run start:site",
"build:site": "lerna exec --scope emotion-site npm run build:site",
"bootstrap": "lerna bootstrap",
"flow": "flow check"
},
"resolutions": {
"**/react": "^16.3.2",
"**/react-dom": "^16.3.2",
"**/browserslist": "^3.2.8"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.51",
"@babel/plugin-external-helpers": "7.0.0-beta.51",
"@babel/preset-env": "7.0.0-beta.51",
"@babel/preset-flow": "7.0.0-beta.51",
"@babel/preset-react": "7.0.0-beta.51",
"@babel/preset-stage-0": "7.0.0-beta.51",
"babel-check-duplicated-nodes": "^1.0.0",
"babel-cli": "^6.24.1",
"babel-core": "^6.24.1",
"babel-eslint": "^8.2.3",
"babel-flow-types": "^1.2.3",
"babel-jest": "^23.2.0",
"babel-plugin-closure-elimination": "^1.3.0",
"babel-plugin-codegen": "^1.2.0",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-macros": "^2.0.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.5.1",
"babel-preset-flow": "^6.23.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"bundlesize": "^0.13.2",
"codecov": "^2.3.1",
"css": "^2.2.1",
"cssjanus": "^1.2.0",
"enzyme": "^3.1.1",
"enzyme-adapter-react-16": "^1.0.4",
"enzyme-to-json": "^3.2.1",
"eslint": "^4.5.0",
"eslint-config-prettier": "^2.3.0",
"eslint-config-react": "^1.1.7",
"eslint-config-standard": "^10.2.1",
"eslint-config-standard-react": "^5.0.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.1.1",
"eslint-plugin-prettier": "^2.2.0",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-react": "^7.3.0",
"eslint-plugin-standard": "^3.0.1",
"flow-bin": "^0.73.0",
"gatsby-react-router-scroll": "^1.0.7",
"get-lerna-packages": "^0.1.0",
"hoist-non-react-statics": "^2.3.1",
"jest": "^23.2.0",
"jest-in-case": "^1.0.2",
"jest-serializer-html": "^4.0.1",
"jest-watch-typeahead": "^0.1.0",
"jsdom": "^11.3.0",
"lerna": "^2.2.0",
"lerna-alias": "^3.0.1",
"module-alias": "^2.0.1",
"npm-run-all": "^4.0.2",
"polished": "^1.2.1",
"prettier": "1.10.2",
"raf": "^3.4.0",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-router-dom": "^4.2.2",
"react-test-renderer": "^16.3.2"
},
"author": "Kye Hohenberger",
"homepage": "https://github.com/tkh44/emotion#readme",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/tkh44/emotion.git"
},
"directories": {
"test": "tests"
},
"keywords": ["styles", "emotion", "react", "css", "css-in-js"],
"eslintConfig": {
"extends": ["standard", "standard-react", "prettier", "prettier/react"],
"plugins": ["prettier"],
"parser": "babel-eslint",
"rules": {
"prettier/prettier": "error",
"react/prop-types": 0,
"react/no-unused-prop-types": 0,
"standard/computed-property-even-spacing": 0,
"no-template-curly-in-string": 0,
"camelcase": 0,
"import/no-duplicates": 0
},
"env": {
"browser": true
},
"overrides": [
{
"files": ["*.test.js", "**/__tests__/*"],
"env": {
"jest": true
}
},
{
"files": ["**/packages/*/src/*", "**/packages/*/src/**/*"],
"rules": {
"import/no-commonjs": 2
}
}
]
},
"workspaces": ["packages/*", "site", "scripts/*"],
"bugs": {
"url": "https://github.com/tkh44/emotion/issues"
},
"bundlesize": [
{
"path": "./packages/emotion/dist/emotion.umd.min.js",
"threshold": "7 Kb"
},
{
"path": "./packages/react-emotion/dist/emotion.umd.min.js",
"threshold": "9.7 Kb"
}
]
}
74 changes: 74 additions & 0 deletions packages/native/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# @emotion/native

> Style and render React Native components using emotion

## Install

```
npm install @emotion/native
```

or if you use yarn

```
yarn add @emotion/native
```

This package also depends on `react`, `react-native` and `prop-types` so make sure you've them installed.

## Example

```js
import React from 'react'
import { AppRegistry } from 'react-native';
import styled, { css } from '@emotion/native'

const Container = styled.View`
display: flex;
justify-content: center;
align-items: center;
margin: 50px;
`

const Description = styled.Text({
color: 'hotpink'
})

const Image = styled.Image`
padding: 40px;
`

const emotionLogo =
'https://cdn.rawgit.com/emotion-js/emotion/master/emotion.png'

class App extends React.Component {
render() {
return (
<Container
style={css`
border-radius: 10px;
`}
>
<Description style={{ fontSize: 45, fontWeight: 'bold' }}>
Emotion Primitives
</Description>
<Image
source={{
uri: emotionLogo,
height: 150,
width: 150
}}
/>
</Container>
)
}
}

AppRegistry.registerComponent('ExampleApp', () => App);
```

The API surface remains same for `@emotion/native` which means you can use all the API methods similar to `emotion`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading this is confusing, the same as what? emotion? or @emotion/primitives? and you can't use everything that emotion has, e.g. keyframes and injectGlobal

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! I missed those parts of emotion API. I'll fix it.


## Theming

Use `emotion-theming` for theming support.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An example maybe?

Copy link
Contributor Author

@nitin42 nitin42 Jul 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm... That'd be great! I'll add it

Loading