Code Monkey home page Code Monkey logo

hackernews-app-powered-by-apache-weex's People

Contributors

hacke2 avatar hades-li avatar hanks10100 avatar jinjiang avatar mrraindrop avatar venkatesh3007 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

hackernews-app-powered-by-apache-weex's Issues

ReportException : ReferenceError: Vue is not defined

将示例编译出index.weex.js 放在android的 assets目录下,报:ReportException : ReferenceError: Vue is not defined。 在chrome的开发人员工具下是正常的。 工程没做任何改动。

拷贝 bundle 文件,这一步,不是简单的拷贝吧。

"copy:android": "cp dist/index.weex.js android/app/src/main/assets/index.js",

index.weex.js和index.js内容明显不同的啊。

index.js是怎么生成的呢?

用weex src --entry src/App.vue启动,[Weex Playground App]访问是空白的。

编译失败

运行npm run build报错
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.

  • configuration[0].output.path: The provided value "dist" is not an absolute path!

  • configuration[1].output.path: The provided value "dist" is not an absolute path!

weex is not defined in android app

When I run the android app, I get the below error:

E/weex: reportJSException >>>> instanceId:1, exception function:createInstance, exception:ReferenceError: weex is not defined

it's thrown because of the line const stream = weex.require('stream') in the file src/store/fetch.js

is this the current state of this app?

@Hanks10100 - Can you confirm if the screenshot below is what I should expect with the recent code?

screenshot_20161229-205555

I think you are working on the implementation of native vue-router. I would like to help you out in getting this thing done faster.

v-model双向绑定

添加input: v-model后 click事件触发的 this.count += 1 没效果

<template>
  <div class="wrapper">
      <input type="text" v-model="count" />
      <text style="color: red; margin-top: 50px;" @click="clickHandle">{{count}}</text>
  </div>
</template>
<style></style>
<script>
  export default {
    data: {
      count: 30
    },
    methods: {
      clickHandle() {
        this.count += 1;
      },
    }
  }
</script>

这是基于weex init 还是weex create的框架

为什么项目结构不同于两种框架的初始模板,官网不能提供一个详细的学习稳当么?初始化以后完全不知道怎么改造项目,怎么引入vue router等,对新人很不友好

unable to communicate between an element and it's child loaded using <embed>

Parent -

<template>
  <div>
    <text onclick="sayHello">Say Hello</text>
    <embed id="foo" src="child_url.js"></embed>
  </div>
</template>

<script>
  module.exports = {
      methods: { 
         sayHello: function () { 
            var foo = this.$vm("foo");
            foo.hello();
         }
      }
  }
</script>

child_url.js

<template>
  <div>
    <text>Child Element</text>
  </div>
</template>

<script>
    module.exports = { 
       methods: { 
          hello: function () {
             console.log("Hello!");
          }
       }
   }
</script>

crash on android 7.1.1

demo app works fine with android 6.0+, but crash on android 7.1
test devices: google pixel with android 7.1.1 and emulator with android 7.1.1
problem: android app crashes
crash log

05-30 20:41:17.127 4298-4298/com.example.weex.hackernews E/AndroidRuntime: FATAL EXCEPTION: main
                                                                           Process: com.example.weex.hackernews, PID: 4298
                                                                           java.lang.RuntimeException: Unable to instantiate application com.example.weex.hackernews.WXApplication: java.lang.ClassNotFoundException: Didn't find class "com.example.weex.hackernews.WXApplication" on path: DexPathList[[zip file "/data/app/com.example.weex.hackernews-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.weex.hackernews-1/lib/x86, /data/app/com.example.weex.hackernews-1/base.apk!/lib/x86, /system/lib, /vendor/lib]]
                                                                               at android.app.LoadedApk.makeApplication(LoadedApk.java:802)
                                                                               at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5377)
                                                                               at android.app.ActivityThread.-wrap2(ActivityThread.java)
                                                                               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
                                                                               at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                               at android.os.Looper.loop(Looper.java:154)
                                                                               at android.app.ActivityThread.main(ActivityThread.java:6119)
                                                                               at java.lang.reflect.Method.invoke(Native Method)
                                                                               at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
                                                                            Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.weex.hackernews.WXApplication" on path: DexPathList[[zip file "/data/app/com.example.weex.hackernews-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.weex.hackernews-1/lib/x86, /data/app/com.example.weex.hackernews-1/base.apk!/lib/x86, /system/lib, /vendor/lib]]
                                                                               at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                                                                               at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
                                                                               at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
                                                                               at android.app.Instrumentation.newApplication(Instrumentation.java:992)
                                                                               at android.app.LoadedApk.makeApplication(LoadedApk.java:796)
                                                                               at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5377) 
                                                                               at android.app.ActivityThread.-wrap2(ActivityThread.java) 
                                                                               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545) 
                                                                               at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                               at android.os.Looper.loop(Looper.java:154) 
                                                                               at android.app.ActivityThread.main(ActivityThread.java:6119) 
                                                                               at java.lang.reflect.Method.invoke(Native Method) 
                                                                               at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
                                                                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 

看过代码后的疑问

我研读了hackernews的代码,如果使用了vue+vuex+router的话,其实app就是个单页应用,weex instance实例只有一个,不知道我这么理解是否正确。

[Android] Weex runtime error

Hi,
I built the project using npm run build:weex && npm run copy:android, and opened the project with Android studio.
Runtime details:

Android studio 2.2.2
Android emulator Nexus_5X_API_25:5554

Got the following errors (sorry for the format - tried my best):

12-30 14:46:34.406 3580-3580/com.example.weex.hackernews E/weex: initWXBridge HackAssertionException com.taobao.weex.utils.WXHack$HackDeclaration$HackAssertionException: java.lang.ClassNotFoundException: com.taobao.weex.devtools.debug.DebugServerProxy
....at com.taobao.weex.utils.WXHack.into(WXHack.java:232)
....at com.taobao.weex.bridge.WXBridgeManager.initWXBridge(WXBridgeManager.java:365)
....at com.taobao.weex.bridge.WXBridgeManager.(WXBridgeManager.java:338)
....at com.taobao.weex.bridge.WXBridgeManager.getInstance(WXBridgeManager.java:347)
....at com.taobao.weex.WXSDKEngine.doInitInternal(WXSDKEngine.java:223)
....at com.taobao.weex.WXSDKEngine.initialize(WXSDKEngine.java:212)
....at com.example.weex.hackernews.WXApplication.onCreate(WXApplication.java:19)
....at com.android.tools.fd.runtime.BootstrapApplication.onCreate(BootstrapApplication.java:370)
....at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
....at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
....at android.app.ActivityThread.-wrap2(ActivityThread.java)
....at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
....at android.os.Handler.dispatchMessage(Handler.java:102)
....at android.os.Looper.loop(Looper.java:154)
....at android.app.ActivityThread.main(ActivityThread.java:6119)
....at java.lang.reflect.Method.invoke(Native Method)
....at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
....at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

..Caused by: java.lang.ClassNotFoundException: com.taobao.weex.devtools.debug.DebugServerProxy
....at java.lang.Class.classForName(Native Method)
....at java.lang.Class.forName(Class.java:400)
....at java.lang.Class.forName(Class.java:326)
....at com.taobao.weex.utils.WXHack.into(WXHack.java:230)
....at com.taobao.weex.bridge.WXBridgeManager.initWXBridge(WXBridgeManager.java:365) 
....at com.taobao.weex.bridge.WXBridgeManager.(WXBridgeManager.java:338) 
....at com.taobao.weex.bridge.WXBridgeManager.getInstance(WXBridgeManager.java:347) 
....at com.taobao.weex.WXSDKEngine.doInitInternal(WXSDKEngine.java:223) 
....at com.taobao.weex.WXSDKEngine.initialize(WXSDKEngine.java:212) 
....at com.example.weex.hackernews.WXApplication.onCreate(WXApplication.java:19) 
....at com.android.tools.fd.runtime.BootstrapApplication.onCreate(BootstrapApplication.java:370) 
....at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024) 
....at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403) 
....at android.app.ActivityThread.-wrap2(ActivityThread.java) 
....at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545) 
....at android.os.Handler.dispatchMessage(Handler.java:102) 
....at android.os.Looper.loop(Looper.java:154) 
....at android.app.ActivityThread.main(ActivityThread.java:6119) 
....at java.lang.reflect.Method.invoke(Native Method) 
....at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
....at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 

..Caused by: java.lang.ClassNotFoundException: Didn't find class "com.taobao.weex.devtools.debug.DebugServerProxy" on path: DexPathList[[dex file "/data/data/com.example.weex.hackernews/files/instant-run/dex/slice-support-annotations-24.1.1_5aab62e234ebbdf55225f20b51a994cada9b1f60-classes.dex", dex file "/data/data/com.example.weex.hackernews/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/com.example.weex.hackernews/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/com.example.weex.hackernews/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/com.example.weex.hackernews/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/com.example.weex.hackernews/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/com.example.weex.hackernews/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/com.example.weex.hackernews/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/com.example.weex.hackernews/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/com.example.weex.hackernews/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/com.example.weex.hackernews/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/com.example.weex.hackernews/files/instant-run/dex/slice-picasso-2.5.2_7fd10b4381d2583d30c407c74f236c5ad7d52458-classes.dex", dex file "/data/data/com.example.weex.hackernews/files/instant-run/dex/slice-internal_impl-24.1.1_f6efbad1ab482711795f9f08ce9da8aab1814f93-classes.dex", dex file "/data/data/com.example.weex.hackernews/files/instant-run/dex/slice-fastjson-1.1.46.android_7d67bd7281cd159c45a9468e523539db9ded4d42-classes.dex", dex file "/data/data/com.example.weex.hackernews/files/instant-run/dex/slice-com.android.support-support-vector-drawable-24.1.1_a224abd2f5aee3db556f2f91f6810877b0035254-classes.dex", dex file "/data/data/com.example.weex.hackernews/files/instant-run/dex/slice-com.android.support-support-v4-24.1.1_afc89397e0e7838f134e13dab9dbdafda4dfd1ca-classes.dex", dex file "/data/data/com.example.weex.hackernews/files/instant-run/dex/slice-com.android.support-recyclerview-v7-24.1.1_10baed5406a176d0f372a850e182767e4ee07b21-classes.dex", dex file "/data/data/com.example.weex.hackernews/file
12-30 14:46:34.568 3580-3773/com.example.weex.hackernews E/weex: [WXBridgeManager] invokeCallJSBatch: framework.js uninitialized.
12-30 14:46:34.569 3580-3773/com.example.weex.hackernews E/weex: [WXBridgeManager] invokeCallJSBatch: framework.js uninitialized.
12-30 14:46:34.584 3580-3773/com.example.weex.hackernews E/weex: [WXBridgeManager] invokeCallJSBatch: framework.js uninitialized.
12-30 14:46:34.588 3580-3773/com.example.weex.hackernews E/weex: [WXBridgeManager] invokeCallJSBatch: framework.js uninitialized.
12-30 14:46:34.589 3580-3773/com.example.weex.hackernews E/weex: [WXBridgeManager] invokeCallJSBatch: framework.js uninitialized.
12-30 14:46:34.590 3580-3773/com.example.weex.hackernews E/weex: [WXBridgeManager] invokeCallJSBatch: framework.js uninitialized.
12-30 14:46:34.592 3580-3773/com.example.weex.hackernews E/weex: [WXBridgeManager] invokeCallJSBatch: framework.js uninitialized.
12-30 14:46:34.605 3580-3773/com.example.weex.hackernews E/weex: [WXBridgeManager] invokeCallJSBatch: framework.js uninitialized.
12-30 14:46:34.611 3580-3773/com.example.weex.hackernews E/weex: [WXBridgeManager] invokeCallJSBatch: framework.js uninitialized.
12-30 14:46:34.611 3580-3773/com.example.weex.hackernews E/weex: [WXBridgeManager] invokeCallJSBatch: framework.js uninitialized.
12-30 14:46:34.612 3580-3773/com.example.weex.hackernews E/weex: [WXBridgeManager] invokeCallJSBatch: framework.js uninitialized.
12-30 14:46:34.840 3580-3780/com.example.weex.hackernews E/EGL_emulation: tid 3780: eglSurfaceAttrib(1174): error 0x3009 (EGL_BAD_MATCH)
12-30 14:48:48.735 3580-3780/com.example.weex.hackernews E/EGL_emulation: tid 3780: eglSurfaceAttrib(1174): error 0x3009 (EGL_BAD_MATCH)

Thanks for you work :)

HOWTO: manually add observer to data attributes that are created after the template is rendered?

Sample Code :-

<template>
  <div>
    <text class="title">Track by</text>
    <text class="subtitle" repeat="{{item in nestedList['list1']}}" track-by="key">{{$index}}-{{item.text}}</text>
    <text class="subtitle" repeat="{{item in nestedList['list2']}}" track-by="key">{{$index}}-{{item.text}}</text>
    <text class="btn" onclick="update">Update</text>
    <text class="btn" onclick="mutate">Mutate</text>

  </div>
</template>

<style>
  .title {font-size: 48px;}
  .subtitle {font-size: 36px;}
  .btn {font-size: 36px; text-align: center; color: white; background-color: gray; padding: 20px; border-radius: 5px;}
</style>

<script>
  module.exports = {
    data: function () {
      return  {
        nestedList: {},
        list: [
          {key: 1, text: 'a'},
          {key: 2, text: 'a'},
          {key: 3, text: 'b'},
          {key: 4, text: 'c'},
          {key: 5, text: 'a'}
        ],
        flag: true
      };
    },
    created: function () {
      this.nestedList["list1"] = [
        {key: 6, text: 'd1'},
        {key: 7, text: 'd2'},
        {key: 8, text: 'd3'},
        {key: 9, text: 'd4'},
      ];
      this.nestedList["list2"] = [
        {key: 9, text: 'd4'},
        {key: 10, text: 'd5'},
        {key: 11, text: 'd6'}
      ];
    },
    methods: {
      update: function (e) {
        this.nestedList["list1"] = [
          {key: 31, text: 'd31'},
          {key: 32, text: 'd32'},
          {key: 33, text: 'd33'}
        ];
        this.nestedList["list2"] = [
          {key: 34, text: 'd34'},
          {key: 35, text: 'd35'},
          {key: 36, text: 'd36'}
        ];
      }
    }
  }
</script>

update method doesn't trigger list update. I think, if I add observer to the new array objects then it will work.

cc @Jinjiang

can't run on ios

Error msg as below:
ld: warning: directory not found for option '-F/Volumes/Data/github/weex/weex-hackernews/ios/Pods/WeexSDK'
ld: library not found for -lSDWebImage
clang: error: linker command failed with exit code 1 (use -v to see invocation)

写的we文件,用weex debug 调试,在playground上扫码正常,但是在ios上异常,求教,在IOS上打包有什么注意事项吗

<list> <cell v-for="dept in depts" index="{{$index}}"> <div class="header"> <text class="header-title">{{dept.name}}</text> </div> <cell> </list>
就是上边这个动态拼接的list
详细说下
数据获取方式:created里边数据获取。在计算属性中数据清洗,返回对象列表数组depts。
在data里已经定义 detps=[]。
打包方式:开始的时候使用weebpack 的weex-loader。同样在playground可显示,ios端不行。
引用方式:传到静态服务器,https:
想了解,weex是否跟vue似的存在数据双向绑定?开始这样写也不行。

今天试了试, h5是好的,但Android上面render时报错,跑不起来怎么回事呢。高手请指教!

01-18 16:17:50.207 8393-8468/com.alibaba.weex E/jsengine: ReportException :undefined:4543: ReferenceError: weex is not defined
01-18 16:17:50.217 8393-8468/com.alibaba.weex E/jsengine: ReportException : ReferenceError: weex is not defined
at Object.defineProperty.value (eval at ((weex):4:10908), :4543:15)
at webpack_require (eval at ((weex):4:10908), :24:30)
at Object.defineProperty.value (eval at ((weex):4:10908), :4467:15)
at webpack_require (eval at ((weex):4:10908), :24:30)
at Object.eval (eval at ((weex):4:10908), :3619:17)
at webpack_require (eval at ((weex):4:10908), :24:30)
at Object.defineProperty.value (eval at ((weex):4:10908), :3537:15)
at webpack_require (eval at ((weex):4:10908), :24:30)
at Object.module.exports.comment.paddingBottom (eval at ((weex):4:10908), :3453:20)
at webpack_require (eval at ((weex):4:10908), :24:30)
01-18 16:17:50.217 8393-8468/com.alibaba.weex E/weex: reportJSException >>>> instanceId:2, exception function:createInstance, exception:ReferenceError: weex is not defined

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.