Giter Site home page Giter Site logo

dacejs / dace Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 1.0 2.56 MB

🐟 A minimalistic universal (isomorphic) react framework for building web apps.

Home Page: https://dacejs.com

License: MIT License

JavaScript 100.00%
universal isomorphic server-side-rendering code-splitting webpack react redux expressjs

dace's Introduction

Dace

🐟 A minimalistic universal (isomorphic) react framework for building web apps.

https://dacejs.com

Build Status npm version npm downloads Dependency Status

Todo

  • 升级到 babel@^7
  • 升级到 webpack@^5
  • css 按页面打包
  • without-redux 前端路由不触发getInitialState
  • 启用 webpackbar 时 eslint 和 stylelint 报错信息显示不完整
  • 资源 prefetch
  • vendor 在dace.config可配置
  • less-loader的支持
  • [*] 重新设计 paths.js defaultEnv.js dace.config.js
  • 确认 DACE_API_BASE_URL 是否可以删除

dace's People

Contributors

zhongzhi107 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tzxhy

dace's Issues

Not found `DACE_PATH_STATS_JSON` in `process.env`

Describe the bug
运行 npm run build && node dist/server.js 报错 Not found DACE_PATH_STATS_JSON in process.env

To Reproduce
Steps to reproduce the behavior:

  1. 运行 npm run build && node dist/server.js
  2. 浏览网页 http://localhost:3000
  3. 页面一直loading
  4. 控制台报错
(node:24411) UnhandledPromiseRejectionWarning: Error: Not found `DACE_PATH_STATS_JSON` in `process.env`
    at exports.default (/Users/zhi.zhong/workspace/q/h-touch-transaction/node_modules/dace/dist/runtime/utils/renderTags.js:22:11)
    at /Users/zhi.zhong/workspace/q/h-touch-transaction/dist/server.js:1:61363
    at tryCatch (/Users/zhi.zhong/workspace/q/h-touch-transaction/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/Users/zhi.zhong/workspace/q/h-touch-transaction/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.(anonymous function) [as next] (/Users/zhi.zhong/workspace/q/h-touch-transaction/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/Users/zhi.zhong/workspace/q/h-touch-transaction/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /Users/zhi.zhong/workspace/q/h-touch-transaction/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:24411) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:24411) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Expected behavior
期望网页能正常显示

Desktop (please complete the following information):

  • OS: [Mac OS]
  • Browser Version: [chrome 71.0.3578.98(正式版本) (64 位)]
  • Node: [6.6.0]
  • Webpack Version: [4.16.1]
  • Dace Version: [2.0.0-alpha.12]

Additional context
npm start 正常

配置redux之后服务无法启动


image

dace.config.js的配置

const { reduxConfig } = require('dace-plugin-redux');

module.exports = {
  modify(config, { target, dev }) {
    const appConfig = config;
    const IS_NODE = target === 'node';
    const IS_DEV = dev;

    reduxConfig.modify(appConfig, { target, dev });
    return appConfig;
  }
};

react-router单页面跳转后,再返回时能否支持状态缓存

单页面跳转时,react-router不会缓存前一页面状态,当再次返回时,前一页面永远都是重新加载,这种情况看是不是dace可以支持缓存下状态。

eg: list页用户下拉到第五页然后跳转详情,再返回时又返回了list页首屏第一页,而且还有重新请求接口的时间,感觉不是很友好

启动时报错 SyntaxError: Unterminated regular expression

Describe the bug

启动时报错:

ERROR in ./node_modules/dace-plugin-redux/dist/runtime/routes.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: Unterminated regular expression (8:15)

6 |         routes: [
   7 |           {
>  8 |         path: /,
     |                ^
   9 |         exact: true,
  10 |         component: loadable(() => import(/* webpackChunkName: "index/index" */ '/Users/zhi.zhong/workspace/github/dacejs/dace/test/workspace/src/pages/index/index'))
  11 |       },{

 @ ./node_modules/dace-plugin-redux/dist/runtime/client.js 21:14-33
 @ multi ./node_modules/dace/dist/utils/webpackHotDevClient.js ./node_modules/dace-plugin-redux/dist/runtime/client.js

To Reproduce

  1. 使用 dace-plugin-redux
  2. 使用dace 默认路由

Expected behavior
正常运行

Desktop (please complete the following information):

  • dace/1.6.0
  • npm/6.9.0
  • node/v10.4.1
  • darwin x64

DACE_PATH_AXIOS_INSTANCE 默认值错误

Describe the bug
ERROR in ./node_modules/dace-plugin-redux/dist/runtime/createStore.js
Module not found: Error: Can't resolve '/Users/zhi.zhong/workspace/github/dacejs/dace/test/workspace/src/runtime/axiosInstance.js' in '/Users/zhi.zhong/workspace/github/dacejs/dace/test/workspace/node_modules/dace-plugin-redux/dist/runtime'
@ ./node_modules/dace-plugin-redux/dist/runtime/createStore.js 41:22-67
@ ./node_modules/dace-plugin-redux/dist/runtime/client.js
@ multi ./node_modules/dace/dist/utils/webpackHotDevClient.js ./node_modules/dace-plugin-redux/dist/runtime/client.js

To Reproduce
升级到最新的 dace-plugin-redux

Expected behavior
正常启动

原因:
没有配置 DACE_PATH_AXIOS_INSTANCE

使用redux后,HRM不能自动刷新页面

console中报错:

<Provider> does not support changingstoreon the fly. It is most likely that you see this error because you updated to Redux 2.x and React Redux 2.x which no longer hot reload reducers automatically. See https://github.com/reactjs/react-redux/releases/tag/v2.0.0 for the migration instructions.

将html错误语法修正后,HMR无法自动刷新页面

升级dace-plugin-redux到3.4.2版本后,将html错误语法fix后,HMR没有触发页面刷新
而控制台输出 模块已更新了

[HMR] Updated modules: [HMR] - ./src/pages/hotellist/header/index.js [HMR] - ./src/pages/hotellist/index.jsx [HMR] - ./node_modules/dace/dist/runtime/ssrRoutes.js [HMR] - ./src/alias/ssrMiddleware.js [HMR] - ./src/routes/index.js [HMR] - ./src/alias/createServer.js [HMR] - ./src/pages/hotellist/header/style.css [HMR] Update applied.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.