Skip to content

Commit

Permalink
Merge branch 'master' into feat/rax-server-renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjun1011 committed Mar 27, 2019
2 parents a80153e + f306402 commit 6b72dde
Show file tree
Hide file tree
Showing 112 changed files with 1,308 additions and 3,149 deletions.
329 changes: 166 additions & 163 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,204 +1,207 @@
/* eslint quotes: off */

module.exports = {
"root": true,
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true,
"es6": true,
"jest": true,
"commonjs": true
'root': true,
'parser': 'babel-eslint',
'env': {
'browser': true,
'node': true,
'es6': true,
'jest': true,
'commonjs': true
},
"plugins": [
"react",
"import"
'plugins': [
'react',
'import'
],
"settings": {
"react": {
"pragma": "createElement", // Pragma to use, default to "React"
'settings': {
'react': {
'pragma': 'createElement', // Pragma to use, default to "React"
}
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 6,
"ecmaFeatures": {
"jsx": true,
"generators": true,
"experimentalObjectRestSpread": true
'parserOptions': {
'sourceType': 'module',
'ecmaVersion': 6,
'ecmaFeatures': {
'jsx': true,
'generators': true,
'experimentalObjectRestSpread': true
}
},
"globals": {
"__weex_data__": true,
"__weex_options__": true,
"__weex_downgrade__": true,
"__weex_define__": true,
"__weex_require__": true,
"WXEnvironment": true,
"webkitRequestAnimationFrame": true,
"webkitCancelAnimationFrame": true,
"jasmine": true
'globals': {
'App': true,
'Page': true,
'getApp': true,
'Component': true,
'my': true,
'__weex_data__': true,
'__weex_options__': true,
'__weex_downgrade__': true,
'__weex_define__': true,
'__weex_require__': true,
'WXEnvironment': true,
'webkitRequestAnimationFrame': true,
'webkitCancelAnimationFrame': true,
'jasmine': true
},
"rules": {
"max-len": "off",
'rules': {
'max-len': 'off',
// ES6
"prefer-const": "off",
"no-const-assign": "error",
"no-class-assign": "error",
"no-dupe-class-members": "error",
"rest-spread-spacing": "error",
"no-duplicate-imports": "error",
"no-useless-rename": "error",
"arrow-spacing": "error",
"no-useless-computed-key": "error",
"template-curly-spacing": "error",
"generator-star-spacing": ["error", {"before": false, "after": true}],
"yield-star-spacing": ["error", {"before": false, "after": true}],
"strict": ["off", "global"],
"global-strict": ["off", "always"],
"no-extra-strict": "off",
"no-shadow": "off",
"no-unused-vars": ["off", {
"vars": "local",
"args": "after-used",
"varsIgnorePattern": "createElement"
'prefer-const': 'off',
'no-const-assign': 'error',
'no-class-assign': 'error',
'no-dupe-class-members': 'error',
'rest-spread-spacing': 'error',
'no-duplicate-imports': 'error',
'no-useless-rename': 'error',
'arrow-spacing': 'error',
'no-useless-computed-key': 'error',
'template-curly-spacing': 'error',
'generator-star-spacing': ['error', {'before': false, 'after': true}],
'yield-star-spacing': ['error', {'before': false, 'after': true}],
'strict': ['off', 'global'],
'global-strict': ['off', 'always'],
'no-extra-strict': 'off',
'no-shadow': 'off',
'no-unused-vars': ['off', {
'vars': 'local',
'args': 'after-used',
'varsIgnorePattern': 'createElement'
}],
"no-undef": "error",
"no-unused-expressions": "off",
"no-use-before-define": "off",
"yoda": "off",
"eqeqeq": "off",
"no-new": "off",
"consistent-return": "off",
"dot-notation": ["error", {
"allowKeywords": true
'no-undef': 'error',
'no-unused-expressions': 'off',
'no-use-before-define': 'off',
'yoda': 'off',
'eqeqeq': 'off',
'no-new': 'off',
'consistent-return': 'off',
'dot-notation': ['error', {
'allowKeywords': true
}],
"no-extend-native": "error",
"no-native-reassign": "error",
"no-return-assign": "off",
"no-constant-condition": ["error", {
"checkLoops": false
'no-extend-native': 'error',
'no-native-reassign': 'error',
'no-return-assign': 'off',
'no-constant-condition': ['error', {
'checkLoops': false
}],
"no-caller": "error",
"no-loop-func": "off",
'no-caller': 'error',
'no-loop-func': 'off',

// Node.js
"no-console": "off",
"no-catch-shadow": "error",
"no-new-require": "off",
"no-mixed-requires": ["off", false],
"no-path-concat": "off",
"handle-callback-err": "off",
'no-console': 'off',
'no-catch-shadow': 'error',
'no-new-require': 'off',
'no-mixed-requires': ['off', false],
'no-path-concat': 'off',
'handle-callback-err': 'off',

"no-empty": "off",
"indent": ["error", 2, {
"SwitchCase": 1
'no-empty': 'off',
'indent': ['error', 2, {
'SwitchCase': 1
}],
"camelcase": ["off", {
"properties": "always"
'camelcase': ['off', {
'properties': 'always'
}],
"quotes": ["error", "single", "avoid-escape"],
"brace-style": ["error", "1tbs", {
"allowSingleLine": false
'quotes': ['error', 'single', 'avoid-escape'],
'brace-style': ['error', '1tbs', {
'allowSingleLine': false
}],
"comma-spacing": ["error", {
"before": false,
"after": true
'comma-spacing': ['error', {
'before': false,
'after': true
}],
"comma-style": ["error", "last"],
"eol-last": "off",
"func-names": "off",
"new-cap": ["error", {
"newIsCap": true
'comma-style': ['error', 'last'],
'eol-last': 'off',
'func-names': 'off',
'new-cap': ['error', {
'capIsNewExceptions': ['App', 'Page', 'Component']
}],
"key-spacing": ["error", {
"beforeColon": false,
"afterColon": true
'key-spacing': ['error', {
'beforeColon': false,
'afterColon': true
}],
"no-mixed-spaces-and-tabs": "error",
"no-multi-spaces": "error",
"no-multiple-empty-lines": "error",
"no-new-object": "error",
"no-spaced-func": "error",
"no-tabs": "error",
"no-trailing-spaces": "error",
"no-extra-parens": ["error", "all", { ignoreJSX: "all" }],
"padded-blocks": ["error", "never"],
"semi": "error",
"semi-spacing": "error",
"keyword-spacing": "error",
"space-before-blocks": "error",
"space-before-function-paren": ["error", "never"],
"space-infix-ops": "error",
"spaced-comment": ["error", "always", {
"line": {
"markers": ["/"],
"exceptions": ["-", "+"]
'no-mixed-spaces-and-tabs': 'error',
'no-multi-spaces': 'error',
'no-multiple-empty-lines': 'error',
'no-new-object': 'error',
'no-spaced-func': 'error',
'no-tabs': 'error',
'no-trailing-spaces': 'error',
'no-extra-parens': ['error', 'all', { ignoreJSX: 'all' }],
'padded-blocks': ['error', 'never'],
'semi': 'error',
'semi-spacing': 'error',
'keyword-spacing': 'error',
'space-before-blocks': 'error',
'space-before-function-paren': ['error', 'never'],
'space-infix-ops': 'error',
'spaced-comment': ['error', 'always', {
'line': {
'markers': ['/'],
'exceptions': ['-', '+']
},
"block": {
"markers": ["!"],
"exceptions": ["*"],
"balanced": true
'block': {
'markers': ['!'],
'exceptions': ['*'],
'balanced': true
}
}],

/**
* Import
*/
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"import/no-extraneous-dependencies": [
"error",
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'import/no-extraneous-dependencies': [
'error',
{
"peerDependencies": true,
"devDependencies": [
"**/scripts/*.js",
"**/__tests__/*.js",
"**/__tests__/**/*.js",
'peerDependencies': true,
'devDependencies': [
'**/scripts/*.js',
'**/__tests__/*.js',
'**/__tests__/**/*.js',
'**/*.config.js',
"**/config/*.js",
"**/*.conf.js",
"**/tests/*.test.js"
'**/config/*.js',
'**/*.conf.js',
'**/tests/*.test.js'
]
}
],

/**
* React & JSX
*/
"jsx-quotes": ["error", "prefer-double"],
"react/display-name": "off",
"react/jsx-boolean-value": ["off", "always"],
"react/jsx-no-bind": ["error", {
"allowArrowFunctions": true
'jsx-quotes': ['error', 'prefer-double'],
'react/display-name': 'off',
'react/jsx-boolean-value': ['off', 'always'],
'react/jsx-no-bind': ['error', {
'allowArrowFunctions': true
}],
"react/prefer-es6-class": "error",
"react/jsx-curly-spacing": "error",
"react/jsx-indent-props": ["error", 2], // 2 spaces indentation
"react/jsx-no-duplicate-props": "error",
"react/jsx-no-undef": "error",
"react/jsx-tag-spacing": "error",
"react/jsx-no-comment-textnodes": "error",
"react/jsx-equals-spacing": "error",
"react/jsx-handler-names": "off",
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/no-is-mounted": "error",
"react/no-children-prop": "error",
"react/no-did-mount-set-state": "error",
"react/no-did-update-set-state": "error",
"react/no-unknown-property": "off",
"react/style-prop-object": "error",
"react/react-in-jsx-scope": "error",
"react/self-closing-comp": "error",
"react/sort-comp": ["off", {
"order": [
"lifecycle",
"/^on.+$/",
"/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/",
"everything-else",
"/^render.+$/",
"render"
'react/prefer-es6-class': 'error',
'react/jsx-curly-spacing': 'error',
'react/jsx-indent-props': ['error', 2], // 2 spaces indentation
'react/jsx-no-duplicate-props': 'error',
'react/jsx-no-undef': 'error',
'react/jsx-tag-spacing': 'error',
'react/jsx-no-comment-textnodes': 'error',
'react/jsx-equals-spacing': 'error',
'react/jsx-handler-names': 'off',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/no-is-mounted': 'error',
'react/no-children-prop': 'error',
'react/no-did-mount-set-state': 'error',
'react/no-did-update-set-state': 'error',
'react/no-unknown-property': 'off',
'react/style-prop-object': 'error',
'react/react-in-jsx-scope': 'error',
'react/self-closing-comp': 'error',
'react/sort-comp': ['off', {
'order': [
'lifecycle',
'/^on.+$/',
'/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/',
'everything-else',
'/^render.+$/',
'render'
]
}]
}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ $ npm run start

## Guides

### Server-side render and hydration
### Server-side rendering and hydration

Use `renderToString()` to generate HTML on the server and send the markup down on the initial request for faster page loads and to allow search engines to crawl your pages for SEO purposes.

Expand Down Expand Up @@ -362,7 +362,7 @@ Add an alias for `react` and `react-dom` in webpack config that makes React-base
// ...
resolve: {
alias: {
'react': 'rax',
'react': 'rax/lib/compat',
'react-dom': 'rax-dom'
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/driver-spec.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Driver Spec `1.0`

Driver is the key concept that make the application cross-container running.
Rax have been implemented [browser driver](../../packages/driver-browser/src/index.js), [server driver](../../packages/driver-server/src/index.js) and [weex driver](../../packages/driver-weex/src/index.js).
Rax have been implemented [dom driver](../../packages/driver-dom/src/index.js), [server driver](../../packages/driver-server/src/index.js) and [weex driver](../../packages/driver-weex/src/index.js).
If want Rax works on other container, only need implement the driver specification.
The driver should implement follow method:

Expand Down
Loading

0 comments on commit 6b72dde

Please sign in to comment.