-
Notifications
You must be signed in to change notification settings - Fork 9
[WIP]feat:support inject context to do isomorphic #2
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| 'use strict'; | ||
|
|
||
| exports.react = { | ||
| package: 'egg-view-react', | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| 'use strict'; | ||
|
|
||
| function getFront(mainStr, searchStr) { | ||
| const foundOffset = mainStr.indexOf(searchStr); | ||
| if (foundOffset === -1) { | ||
| return null; | ||
| } | ||
| return mainStr.substring(0, foundOffset); | ||
| } | ||
|
|
||
| function getEnd(mainStr, searchStr) { | ||
| const foundOffset = mainStr.indexOf(searchStr); | ||
| if (foundOffset === -1) { | ||
| return null; | ||
| } | ||
| return mainStr.substring(foundOffset + searchStr.length, mainStr.length); | ||
| } | ||
|
|
||
| exports.insertString = function(mainStr, searchStr, insertStr) { | ||
| const front = getFront(mainStr, searchStr); | ||
| const end = getEnd(mainStr, searchStr); | ||
| if (front !== null && end !== null) { | ||
| return front + insertStr + searchStr + end; | ||
| } | ||
| return null; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,23 +3,26 @@ | |
| "version": "0.0.1", | ||
| "description": "egg view plugin for react", | ||
| "eggPlugin": { | ||
| "name": "view", | ||
| "dep": [ | ||
| "security" | ||
| "name": "react", | ||
| "dependencies": [ | ||
| "security", | ||
| "view" | ||
| ] | ||
| }, | ||
| "keywords": [ | ||
| "egg", | ||
| "eggPlugin", | ||
| "egg-plugin", | ||
| "egg-plugin-view" | ||
| "egg-plugin-view", | ||
| "react" | ||
| ], | ||
| "dependencies": { | ||
| "react": "^15.4.2", | ||
| "react-dom": "^15.4.2" | ||
| "escape-html": "^1.0.3", | ||
| "react": "^15.5.4", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. react 跟着插件走?应用是怎么用 react 的?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @popomore 正在升级插件(支持单页面同构,去掉内置 react 依赖),react 和 react-dom 不想再内置插件,大家意见?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 写个 peerdep 吧,不然前后端会有多个 react 版本
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 好 |
||
| "react-dom": "^15.5.4" | ||
| }, | ||
| "devDependencies": { | ||
| "autod": "^2.7.1", | ||
| "autod": "^2.8.0", | ||
| "babel": "^6.5.2", | ||
| "babel-core": "^6.10.0", | ||
| "babel-plugin-transform-export-extensions": "^6.8.0", | ||
|
|
@@ -30,12 +33,13 @@ | |
| "babel-preset-stage-0": "^6.5.0", | ||
| "babel-register": "^6.9.0", | ||
| "babel-runtime": "^6.6.1", | ||
| "egg": "^0.11.0", | ||
| "egg-bin": "^2.0.2", | ||
| "egg-ci": "^1.1.0", | ||
| "egg-mock": "^2.4.0", | ||
| "eslint": "^3.15.0", | ||
| "eslint-config-egg": "^3.2.0", | ||
| "egg": "^1.2.1", | ||
| "egg-bin": "^3.3.2", | ||
| "egg-ci": "^1.6.0", | ||
| "egg-mock": "^3.6.0", | ||
| "eslint": "^3.19.0", | ||
| "egg-view": "^1.0.0", | ||
| "eslint-config-egg": "^4.1.0", | ||
| "supertest": "^3.0.0", | ||
| "webstorm-disable-index": "^1.1.2" | ||
| }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| 'use strict'; | ||
|
|
||
| exports.keys = '123456'; | ||
| exports.view = { | ||
| defaultViewEngine: 'react', | ||
| mapping :{ | ||
| '.js':'react' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 不是 jsx? |
||
| }, | ||
| defaultExtension: '.js' | ||
| }; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个在 view 那边配