Coder Social home page Coder Social logo

osdio / noder-react-native Goto Github PK

View Code? Open in Web Editor NEW
2.0K 2.0K 390.0 5.41 MB

The mobile app of cnodejs.org written in React Native

Home Page: https://cnodejs.org/about

Ruby 0.05% JavaScript 93.61% Objective-C 3.98% Java 1.30% Python 1.05%
cnodejs noder react react-native redux redux-application redux-thunk

noder-react-native's Introduction

Noder - A React-Native Client for cnodejs.org

A new cnodejs.org mobile & web app powered by react-native and react-web and CodeceptJS .

Install

微信浏览器中若无法打开安装链接,请复制链接到系统浏览器中打开

Develop

For local development you need to follow the below commands:

git clone https://github.com/soliury/noder-react-native.git noder
cd noder
yarn install

Click the run button in Xcode, if something went wrong, you need to rebuild all packages that be used in this project with Xcode (Just select the package and press command+B to run compile).

If you want to run it on your iPhone, please follow the Offical Doc.

If you want to run it on your Android, please run:

npm run android
npm start

If you want to run it on your Browser (localhost:3000), please run:

npm run web

e2e test

JS app code in src/write once run on Android, iOS and Web by react-native and react-web, now JS test case in e2e/ with locator ~ write once run on them too with CodeceptJS .

Web test

After install server side of test by npm run e2e-update-server-web, please run:

npm run web
npm run e2e-server-web

Then run client side of test by npm run e2e-web, thus a web page will be opened in firefox automatically and complete the test.

Android test

After install server side of test by npm install -g appium, please run:

npm run android
npm start
npm run e2e-server-native

Then run client side of test by npm run e2e-android, thus an apk will be installed to android automatically and complete the test.

If npm install -g appium is unavailable in china, ref to node_modules-appium .

Screenshots

noder

React-Native Modules In Using

This project is heavily influenced by the above modules.

ToDo List

  • Push Notification
  • Fix the below bugs
    • In ListView, sometime items on the bottom can't be refreshed
    • ListView take too much memory
    • HTML to native View render take too much memory and CPU time
  • Add Unit testing

Change log

Please read CHANGELOG

Contribute

If you find any issues, just solve it and make a PR.

This project is under the ES6 JSX.

License

MIT License

noder-react-native's People

Contributors

alsotang avatar awong1900 avatar flyskywhy avatar leftjs avatar pupboss avatar takwolf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

noder-react-native's Issues

详情与回复中的图片问题

详情中图片没有超出页面边界,但图片被缩放而且超出部分被隐藏了

回复中图片超出页面边界了

系统 安卓6.0

编译报错

clang: error: no such file or directory: 'react-native/noder-react-native/node_modules/react-native-modal/node_modules/react-native-blur/RNBlur/BlurViewManager.m'
clang: error: no input files

我看了一下 react-native-modal确实不包含react-native-blur啊

列表个数比较少的时候,会有个loading一直在闪

如题

列表项比较多的时候没有这个问题出现

测试环境,ios,dev模式

测试效果如下图

11 pic

10 pic

抓包看请求发现,进入列表有的时候会请求两次同一页的数据,如果列表过少或列表为空,就会狂刷接口,page值递增,也不能说递增,有重复请求的递增,而且有丢页的现象
-1

Redux connectComponent 提示 mapStateToProps undefined

你好,初学Redux,新建一个工程,想学习noder中 Redux的写法。

将connectComponent.js组件放置在新工程中,

Home.js 类似这样

class Home extends Component {
    constructor(props){
        super(props);
    }
   render() {
        return (
            <View></View>
        )}
}
export const LayoutComponent = Home;
export function mapStateToProps(state) {
    return state;
}

MainContainer.js 中类似这样

import HomeComponent from './Home';
import connectComponent from '../utils/connectComponent.js';
const Home = connectComponent(HomeComponent); //---->这句提示找不到mapStateToProps

class MainContainer extends Component {
  constructor(props){
    super(props);
  }

  render() {
    return (
      <Home/>
    );
  }
}

请问我哪里写错了,为何找不到mapStateToProps

android bug introduced in 0bf9e7e5616780a8f7277317fed173ec7a64113a

Hi @soliury In MainActivity.java

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
        new RCTCameraPackage(),
        new MainReactPackage(),
        new VectorIconsPackage());
        new BarcodeScanner();
    }

needs to be

   @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
        new RCTCameraPackage(),
        new MainReactPackage(),
        new VectorIconsPackage()
        new BarcodeScanner());
    }


Build failed with an exception

npm run android

* Where:
Build file '/Users/l/project/native/noder-react-native/android/app/build.gradle' line: 104

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not find property 'MYAPP_RELEASE_STORE_FILE' on SigningConfig_Decorated{name=release, storeFile=null, storePassword=null, keyAlias=null, keyPassword=null, storeType=null}.

执行 npm start 会出现错误

执行 npm start 会出现如下错误:
image

全局环境中存在 react-native-cli
image
底下的内个 react-native: 0.23.1 貌似是项目自带的react-native依赖

因为我在全局环境中运行时这样的:
image

去搜了一下发现是一个普遍的问题:
http://stackoverflow.com/questions/33908314/packager-wont-start
猜测原因是执行npm start会造成react-native路径错误
image

目前的解决方案是直接运行 react-native start 或者 直接运行 react-native run-android 可以正常启动。

image

源码组织结构?

如题,根目录下有app和src两个目录,里面的文件好像都是重复的,这两个目录有什么区别么?

RctImage模块报错

求助:在修复了modal和icons的问题之后,还出现了这个错误。
noder-react-native/node_modules/react-native/Libraries/Image/RCTDownloadTaskWrapper.m:65:49: Null passed to a callee that requires a non-null argument

如何实现异步的?

我似乎没有看到 thunk 中间件

但是 action 却貌似使用了thunk 中间件

exports.getAllTopicsFromStorage = function () {
    return dispatch=> {
        TopicService.storage.getAll()
            .then(results=> {
                dispatch({
                    type: types.GET_ALL_TOPICS_FROM_STORAGE,
                    results: results
                })
            })
            .catch(err=> {

            })
            .done()
    }
}

Upgrade for React Native 0.11.0

On the React Native Playground, we've retired versions before 0.11.0, so I had to remove this example from the front page which is not working there anymore. But, it would be great to put it back. Is there any working going on to upgrade?

Cheers!

建议

上面的tab设计成可左右滑动的
然后发帖应该是比消息更常用的功能吧 建议把发帖放在外面

ListView性能问题

这个问题一直存在,官方也没有更好地解决办法,我曾经尝试过将未显示的row设置为空View,但是效果并不算很好。目前只有从oc角度去优化或许是最终的办法。

iPhone6s plus 中横屏切换bug

在竖屏模式下启动,切换到横屏出现显示问题:
img_0079

在横屏模式下启动,切换到竖屏模式出现显示问题(看顶部tab的位置):
img_0080

问题原因应该是容器宽度没有随着切换而变更

Build Failed

克隆下来后编译失败,提示 'RCTRootView.h' file not found.

架构思考?

reducers里除了业务的还有UI的,比如user.js和userUI.js,感觉有点冗余了。
UI里的主要目的是捕获Action的状态,如果统一在Actions里提供...ing和...ed,是不是代码更清晰了?
改进后这个插件 minPendingTime.js也就不需要了。

user.avatar_url 返回值更新

这个 avatar_url 有更新,之前返回的是 /agent?url=xxxx 的地址,现在服务器准备回到国内,所以不再具备代理能力。之后这里会直接返回 url=xxxx 的真实url

async callback 问题

component 中如下调用

        actions.checkToken(result.data, ()=> {
            router.pop();
            actions.toast('登陆成功');
        });

看了action 中的实现

export const checkToken = createAction(types.CHECK_TOKEN, async(token)=> {
    const userLoginInfo = await userService.checkToken(token);
    const user = await userService
        .getUserInfo(userLoginInfo.loginname)
        .then((data)=> {
            return {
                secret: userLoginInfo,
                publicInfo: data
            };
        });
    tokenService.setToken(token);
    return user;
}, (token, resolved)=> {
    return {
        resolved: resolved,
        sync: 'user'
    }
});

然后再找

export default function asyncActionCallbackMiddleware() {
    return next => action => {
        const { meta = {}, error, payload } = action;
        const { sequence = {}, resolved, rejected } = meta;
        if (sequence.type !== 'next') return next(action);


        // do callback
        error ? (rejected && rejected(payload)) : (resolved && resolved(payload));

        next(action);
    }
}

请教下component中authToken 中的回调是在哪实现的

去掉【收藏】有关的功能

之后我们社区不打算提供的收藏功能,麻烦应用检查一下是否有接触到相关的功能,如果有的话,可以全部去掉。

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.