Re: customize request when download bundle js in weex

2017-11-30 Thread xing zhang
OK ,this subject is held temporarily,  we will try not to make developer
confused about so much render interface, Weex is still flexible and
extendable, and developers can control it.

thank you  for the discussion about it.

2017-11-30 21:42 GMT+08:00 陈泽峰 <chenzef...@ymt360.com>:

> I agree that it's a wide range of demand, and renderWithRequest is
> convenient for developers facing such case.
> But there are alternatives, and some of them may be more 'convenient'
> .Still in my practice,I preload jsbundles when my app starts, that is to
> say, download is separated from render, so I could not use it even there is
> a  renderWithRequest() method.
> What i'm saying is, specific businesses may be far different from each
> others. We could never make everyone 'convenient'.Weex is flexible and
> extendable, that is the power of weex.
>
>
> -- Original --
> From:  "xing zhang"<zhangxing610...@gmail.com>;
> Date:  Thu, Nov 30, 2017 08:39 PM
> To:  "Weex问题列表"<dev@weex.incubator.apache.org>;
>
> Subject:  Re: customize request when download bundle js in weex
>
>
> Yeah , in most case, we'll add more custom information such as cookie or
> just send post request downloading bundle js code  using renderWithRequest,
>
> certainly, this can be finished by developers own, this can be more
> convenient by providing this interface, so developers don't
>
> care about much more details about session/connection(iOS) callback ,saving
> data and so on.
>
>
>
> 2017-11-30 20:25 GMT+08:00 杨 劭君 <shaojun.y...@outlook.com>:
>
> > If I want to send post request, renderWithRequest is the best option.
> >
> > 在 2017/11/30 20:09,“misakuo”<misa...@apache.org> 写入:
> >
> > We already have the HttpAdapter abstract in native, why is not do
> > customize
> > in here?
> > In fact, the request is not always bound to the WXSDKInstance
> > 2017-11-30 19:55 GMT+08:00 杨 劭君 <shaojun.y...@outlook.com>:
> >
> > > +1, customize request header is useful
> > >
> > > 在 2017/11/30 17:19,“Adam Feng”<cxfe...@gmail.com> 写入:
> > >
> > > +1, adding custom header (such as cookie) to request is useful,
> > it
> > > should be supported both on iOS and Android.
> > >
> > > Thanks.
> > > Adam Feng
> > >
> > > On 30 Nov 2017, 5:16 PM +0800, xing zhang <
> > zhangxing610...@gmail.com>,
> > > wrote:
> > > > Hi all,
> > > >
> > > > According to my observation, you can specify a URL or js
> > content to
> > > > render a page, for URL , then WeexSDK build a request for
> > download
> > > the
> > > > resource and pour into the engine to
> > > >
> > > > render. But in most case, we need customize a request for
> > > downloading a
> > > > resource, and we can setup our request userAgent and headers,
> > our
> > > server
> > > > can receive these header to
> > > >
> > > > customize response for a request from a device.
> > > >
> > > > As for this we can expose a `renderWithRequest` interface for
> > > > WXSDKInstance, is this way convenient ?
> > > >
> > > > comments? please
> > >
> > >
> > >
> >
> >
> >
>


Re: customize request when download bundle js in weex

2017-11-30 Thread 陈泽峰
I agree that it's a wide range of demand, and renderWithRequest is convenient 
for developers facing such case.
But there are alternatives, and some of them may be more 'convenient' .Still in 
my practice,I preload jsbundles when my app starts, that is to say, download is 
separated from render, so I could not use it even there is a  
renderWithRequest() method.
What i'm saying is, specific businesses may be far different from each others. 
We could never make everyone 'convenient'.Weex is flexible and extendable, that 
is the power of weex.
 
 
-- Original --
From:  "xing zhang"<zhangxing610...@gmail.com>;
Date:  Thu, Nov 30, 2017 08:39 PM
To:  "Weex问题列表"<dev@weex.incubator.apache.org>; 

Subject:  Re: customize request when download bundle js in weex

 
Yeah , in most case, we'll add more custom information such as cookie or
just send post request downloading bundle js code  using renderWithRequest,

certainly, this can be finished by developers own, this can be more
convenient by providing this interface, so developers don't

care about much more details about session/connection(iOS) callback ,saving
data and so on.



2017-11-30 20:25 GMT+08:00 杨 劭君 <shaojun.y...@outlook.com>:

> If I want to send post request, renderWithRequest is the best option.
>
> 在 2017/11/30 20:09,“misakuo”<misa...@apache.org> 写入:
>
> We already have the HttpAdapter abstract in native, why is not do
> customize
> in here?
> In fact, the request is not always bound to the WXSDKInstance
> 2017-11-30 19:55 GMT+08:00 杨 劭君 <shaojun.y...@outlook.com>:
>
> > +1, customize request header is useful
> >
> > 在 2017/11/30 17:19,“Adam Feng”<cxfe...@gmail.com> 写入:
> >
> > +1, adding custom header (such as cookie) to request is useful,
> it
> > should be supported both on iOS and Android.
> >
> > Thanks.
> > Adam Feng
> >
> > On 30 Nov 2017, 5:16 PM +0800, xing zhang <
> zhangxing610...@gmail.com>,
> > wrote:
> > > Hi all,
> > >
> > > According to my observation, you can specify a URL or js
> content to
> > > render a page, for URL , then WeexSDK build a request for
> download
> > the
> > > resource and pour into the engine to
> > >
> > > render. But in most case, we need customize a request for
> > downloading a
> > > resource, and we can setup our request userAgent and headers,
> our
> > server
> > > can receive these header to
> > >
> > > customize response for a request from a device.
> > >
> > > As for this we can expose a `renderWithRequest` interface for
> > > WXSDKInstance, is this way convenient ?
> > >
> > > comments? please
> >
> >
> >
>
>
>

Re: customize request when download bundle js in weex

2017-11-30 Thread xing zhang
Yeah , in most case, we'll add more custom information such as cookie or
just send post request downloading bundle js code  using renderWithRequest,

certainly, this can be finished by developers own, this can be more
convenient by providing this interface, so developers don't

care about much more details about session/connection(iOS) callback ,saving
data and so on.



2017-11-30 20:25 GMT+08:00 杨 劭君 :

> If I want to send post request, renderWithRequest is the best option.
>
> 在 2017/11/30 20:09,“misakuo” 写入:
>
> We already have the HttpAdapter abstract in native, why is not do
> customize
> in here?
> In fact, the request is not always bound to the WXSDKInstance
> 2017-11-30 19:55 GMT+08:00 杨 劭君 :
>
> > +1, customize request header is useful
> >
> > 在 2017/11/30 17:19,“Adam Feng” 写入:
> >
> > +1, adding custom header (such as cookie) to request is useful,
> it
> > should be supported both on iOS and Android.
> >
> > Thanks.
> > Adam Feng
> >
> > On 30 Nov 2017, 5:16 PM +0800, xing zhang <
> zhangxing610...@gmail.com>,
> > wrote:
> > > Hi all,
> > >
> > > According to my observation, you can specify a URL or js
> content to
> > > render a page, for URL , then WeexSDK build a request for
> download
> > the
> > > resource and pour into the engine to
> > >
> > > render. But in most case, we need customize a request for
> > downloading a
> > > resource, and we can setup our request userAgent and headers,
> our
> > server
> > > can receive these header to
> > >
> > > customize response for a request from a device.
> > >
> > > As for this we can expose a `renderWithRequest` interface for
> > > WXSDKInstance, is this way convenient ?
> > >
> > > comments? please
> >
> >
> >
>
>
>


Re: customize request when download bundle js in weex

2017-11-30 Thread 杨 劭君
If I want to send post request, renderWithRequest is the best option.

在 2017/11/30 20:09,“misakuo” 写入:

We already have the HttpAdapter abstract in native, why is not do customize
in here?
In fact, the request is not always bound to the WXSDKInstance
2017-11-30 19:55 GMT+08:00 杨 劭君 :

> +1, customize request header is useful
>
> 在 2017/11/30 17:19,“Adam Feng” 写入:
>
> +1, adding custom header (such as cookie) to request is useful, it
> should be supported both on iOS and Android.
>
> Thanks.
> Adam Feng
>
> On 30 Nov 2017, 5:16 PM +0800, xing zhang ,
> wrote:
> > Hi all,
> >
> > According to my observation, you can specify a URL or js content to
> > render a page, for URL , then WeexSDK build a request for download
> the
> > resource and pour into the engine to
> >
> > render. But in most case, we need customize a request for
> downloading a
> > resource, and we can setup our request userAgent and headers, our
> server
> > can receive these header to
> >
> > customize response for a request from a device.
> >
> > As for this we can expose a `renderWithRequest` interface for
> > WXSDKInstance, is this way convenient ?
> >
> > comments? please
>
>
>




Re: customize request when download bundle js in weex

2017-11-30 Thread 陈泽峰
In my practice(android), renderByUrl() is not used. JSBundles are all 
downloaded by okhttp and weexsdk just render local templete,in this way,i can 
handle weex cache,and the request header can be customized too.
 
 
 
-- Original --
From:  "杨 劭君"<shaojun.y...@outlook.com>;
Date:  Thu, Nov 30, 2017 07:55 PM
To:  "Weex问题列表"<dev@weex.incubator.apache.org>; 

Subject:  Re: customize request when download bundle js in weex

 
+1, customize request header is useful

在 2017/11/30 17:19,“Adam Feng”<cxfe...@gmail.com> 写入:

+1, adding custom header (such as cookie) to request is useful, it should 
be supported both on iOS and Android.

Thanks.
Adam Feng

On 30 Nov 2017, 5:16 PM +0800, xing zhang <zhangxing610...@gmail.com>, 
wrote:
> Hi all,
>
> According to my observation, you can specify a URL or js content to
> render a page, for URL , then WeexSDK build a request for download the
> resource and pour into the engine to
>
> render. But in most case, we need customize a request for downloading a
> resource, and we can setup our request userAgent and headers, our server
> can receive these header to
>
> customize response for a request from a device.
>
> As for this we can expose a `renderWithRequest` interface for
> WXSDKInstance, is this way convenient ?
>
> comments? please

Re: customize request when download bundle js in weex

2017-11-30 Thread 杨 劭君
+1, customize request header is useful

在 2017/11/30 17:19,“Adam Feng” 写入:

+1, adding custom header (such as cookie) to request is useful, it should 
be supported both on iOS and Android.

Thanks.
Adam Feng

On 30 Nov 2017, 5:16 PM +0800, xing zhang , 
wrote:
> Hi all,
>
> According to my observation, you can specify a URL or js content to
> render a page, for URL , then WeexSDK build a request for download the
> resource and pour into the engine to
>
> render. But in most case, we need customize a request for downloading a
> resource, and we can setup our request userAgent and headers, our server
> can receive these header to
>
> customize response for a request from a device.
>
> As for this we can expose a `renderWithRequest` interface for
> WXSDKInstance, is this way convenient ?
>
> comments? please




Re: customize request when download bundle js in weex

2017-11-30 Thread Adam Feng
+1, adding custom header (such as cookie) to request is useful, it should be 
supported both on iOS and Android.

Thanks.
Adam Feng

On 30 Nov 2017, 5:16 PM +0800, xing zhang , wrote:
> Hi all,
>
> According to my observation, you can specify a URL or js content to
> render a page, for URL , then WeexSDK build a request for download the
> resource and pour into the engine to
>
> render. But in most case, we need customize a request for downloading a
> resource, and we can setup our request userAgent and headers, our server
> can receive these header to
>
> customize response for a request from a device.
>
> As for this we can expose a `renderWithRequest` interface for
> WXSDKInstance, is this way convenient ?
>
> comments? please


Re: customize request when download bundle js in weex

2017-11-30 Thread 方曦(千之)
Yeath,I am very agree with this case.
And in some scenarios, this feature is very much needed.

+1.

> 在 2017年11月30日,17:16,xing zhang  写道:
> 
> Hi all,
> 
> According to my observation,  you can specify a URL or js content to
> render a page, for URL , then WeexSDK build a request for download the
> resource and pour into the engine to
> 
> render. But in most case, we need customize a request for downloading a
> resource, and we can setup our request userAgent and headers, our server
> can receive these header to
> 
> customize response for a request from a device.
> 
> As for this  we can expose a `renderWithRequest` interface for
> WXSDKInstance, is this way convenient ?
> 
> comments? please



customize request when download bundle js in weex

2017-11-30 Thread xing zhang
 Hi all,

 According to my observation,  you can specify a URL or js content to
render a page, for URL , then WeexSDK build a request for download the
resource and pour into the engine to

render. But in most case, we need customize a request for downloading a
resource, and we can setup our request userAgent and headers, our server
can receive these header to

customize response for a request from a device.

As for this  we can expose a `renderWithRequest` interface for
WXSDKInstance, is this way convenient ?

comments? please