You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Simon MacDonald <si...@gmail.com> on 2012/07/10 22:38:25 UTC

Shim all the plugins

So in 1.9.0 with the change brought on by CordovaWebView all of the
plugins are broken. By broken, I mean they won't compile unless you go
in and change the source code. That may not sound like broken to us
but to many of our users who are not familiar with Java that means
they are very, very broken.

In this pull request:

https://github.com/macdonst/cordova-android/commit/0180342dff4ce6e8f63e3d753cb1f1588c43f9f0

I've created a shim so that Plugins that are still using the "ctx"
variable should continue to work unmodified. I've tested it and it is
working with the following plugins:

LowLatencyAudio
LocalNotificaiton
MacAddressPlugin
BarcodeScanner
ChildBrowser
TTS
VideoPlayer
IMEI
SpeechRecognizer
PhoneListener

I think that gives me a pretty good cross section, I just don't have
time to test them all.

My suggestions are:

1) we add this in for 2.0.0 so the existing plugins continue to work.
2) we put in a deprecation notice for "ctx" as it is going away soon
3) we write a detailed set of instructions on how to get your 3rd
party plugin upgraded to work in 2.0.0 without using "ctx".

Please lemme know what you think...

Simon Mac Donald
http://hi.im/simonmacdonald

Re: Shim all the plugins

Posted by Simon MacDonald <si...@gmail.com>.
Fingers crossed that this will address most of the issues. Writing a
blog post on LegacyContext now and I'll work on a Plugins upgrade
guide soon.

Simon Mac Donald
http://hi.im/simonmacdonald


On Wed, Jul 11, 2012 at 1:59 PM, Anis KADRI <an...@gmail.com> wrote:
> +1
>
> I think LegacyContext will work in most cases. Especially
> startActivityForResult and startActivity. Which most plugins use.
>
> On Tue, Jul 10, 2012 at 6:38 PM, Simon MacDonald
> <si...@gmail.com> wrote:
>> I checked the code in as CB-993: Android plugin problems upgrading to
>> 1.9.0 as that was where the problem originally was reported.
>>
>> Simon Mac Donald
>> http://hi.im/simonmacdonald
>>
>>
>> On Tue, Jul 10, 2012 at 5:55 PM, Michael Brooks
>> <mi...@michaelbrooks.ca> wrote:
>>> Nice work Simon!
>>>
>>> +1
>>>
>>> I can create the 2.00 Plugin Upgrade Guide issue for each platform.
>>>
>>> On Tue, Jul 10, 2012 at 2:25 PM, Filip Maj <fi...@adobe.com> wrote:
>>>
>>>> +1 ! File the issues!
>>>>
>>>> On 7/10/12 1:51 PM, "Joe Bowser" <bo...@gmail.com> wrote:
>>>>
>>>> >Why didn't I think of this?
>>>> >
>>>> >+1
>>>> >
>>>> >On Tue, Jul 10, 2012 at 1:38 PM, Simon MacDonald
>>>> ><si...@gmail.com> wrote:
>>>> >> So in 1.9.0 with the change brought on by CordovaWebView all of the
>>>> >> plugins are broken. By broken, I mean they won't compile unless you go
>>>> >> in and change the source code. That may not sound like broken to us
>>>> >> but to many of our users who are not familiar with Java that means
>>>> >> they are very, very broken.
>>>> >>
>>>> >> In this pull request:
>>>> >>
>>>> >>
>>>> >>
>>>> https://github.com/macdonst/cordova-android/commit/0180342dff4ce6e8f63e3d
>>>> >>753cb1f1588c43f9f0
>>>> >>
>>>> >> I've created a shim so that Plugins that are still using the "ctx"
>>>> >> variable should continue to work unmodified. I've tested it and it is
>>>> >> working with the following plugins:
>>>> >>
>>>> >> LowLatencyAudio
>>>> >> LocalNotificaiton
>>>> >> MacAddressPlugin
>>>> >> BarcodeScanner
>>>> >> ChildBrowser
>>>> >> TTS
>>>> >> VideoPlayer
>>>> >> IMEI
>>>> >> SpeechRecognizer
>>>> >> PhoneListener
>>>> >>
>>>> >> I think that gives me a pretty good cross section, I just don't have
>>>> >> time to test them all.
>>>> >>
>>>> >> My suggestions are:
>>>> >>
>>>> >> 1) we add this in for 2.0.0 so the existing plugins continue to work.
>>>> >> 2) we put in a deprecation notice for "ctx" as it is going away soon
>>>> >> 3) we write a detailed set of instructions on how to get your 3rd
>>>> >> party plugin upgraded to work in 2.0.0 without using "ctx".
>>>> >>
>>>> >> Please lemme know what you think...
>>>> >>
>>>> >> Simon Mac Donald
>>>> >> http://hi.im/simonmacdonald
>>>>
>>>>

Re: Shim all the plugins

Posted by Anis KADRI <an...@gmail.com>.
+1

I think LegacyContext will work in most cases. Especially
startActivityForResult and startActivity. Which most plugins use.

On Tue, Jul 10, 2012 at 6:38 PM, Simon MacDonald
<si...@gmail.com> wrote:
> I checked the code in as CB-993: Android plugin problems upgrading to
> 1.9.0 as that was where the problem originally was reported.
>
> Simon Mac Donald
> http://hi.im/simonmacdonald
>
>
> On Tue, Jul 10, 2012 at 5:55 PM, Michael Brooks
> <mi...@michaelbrooks.ca> wrote:
>> Nice work Simon!
>>
>> +1
>>
>> I can create the 2.00 Plugin Upgrade Guide issue for each platform.
>>
>> On Tue, Jul 10, 2012 at 2:25 PM, Filip Maj <fi...@adobe.com> wrote:
>>
>>> +1 ! File the issues!
>>>
>>> On 7/10/12 1:51 PM, "Joe Bowser" <bo...@gmail.com> wrote:
>>>
>>> >Why didn't I think of this?
>>> >
>>> >+1
>>> >
>>> >On Tue, Jul 10, 2012 at 1:38 PM, Simon MacDonald
>>> ><si...@gmail.com> wrote:
>>> >> So in 1.9.0 with the change brought on by CordovaWebView all of the
>>> >> plugins are broken. By broken, I mean they won't compile unless you go
>>> >> in and change the source code. That may not sound like broken to us
>>> >> but to many of our users who are not familiar with Java that means
>>> >> they are very, very broken.
>>> >>
>>> >> In this pull request:
>>> >>
>>> >>
>>> >>
>>> https://github.com/macdonst/cordova-android/commit/0180342dff4ce6e8f63e3d
>>> >>753cb1f1588c43f9f0
>>> >>
>>> >> I've created a shim so that Plugins that are still using the "ctx"
>>> >> variable should continue to work unmodified. I've tested it and it is
>>> >> working with the following plugins:
>>> >>
>>> >> LowLatencyAudio
>>> >> LocalNotificaiton
>>> >> MacAddressPlugin
>>> >> BarcodeScanner
>>> >> ChildBrowser
>>> >> TTS
>>> >> VideoPlayer
>>> >> IMEI
>>> >> SpeechRecognizer
>>> >> PhoneListener
>>> >>
>>> >> I think that gives me a pretty good cross section, I just don't have
>>> >> time to test them all.
>>> >>
>>> >> My suggestions are:
>>> >>
>>> >> 1) we add this in for 2.0.0 so the existing plugins continue to work.
>>> >> 2) we put in a deprecation notice for "ctx" as it is going away soon
>>> >> 3) we write a detailed set of instructions on how to get your 3rd
>>> >> party plugin upgraded to work in 2.0.0 without using "ctx".
>>> >>
>>> >> Please lemme know what you think...
>>> >>
>>> >> Simon Mac Donald
>>> >> http://hi.im/simonmacdonald
>>>
>>>

Re: Shim all the plugins

Posted by Simon MacDonald <si...@gmail.com>.
I checked the code in as CB-993: Android plugin problems upgrading to
1.9.0 as that was where the problem originally was reported.

Simon Mac Donald
http://hi.im/simonmacdonald


On Tue, Jul 10, 2012 at 5:55 PM, Michael Brooks
<mi...@michaelbrooks.ca> wrote:
> Nice work Simon!
>
> +1
>
> I can create the 2.00 Plugin Upgrade Guide issue for each platform.
>
> On Tue, Jul 10, 2012 at 2:25 PM, Filip Maj <fi...@adobe.com> wrote:
>
>> +1 ! File the issues!
>>
>> On 7/10/12 1:51 PM, "Joe Bowser" <bo...@gmail.com> wrote:
>>
>> >Why didn't I think of this?
>> >
>> >+1
>> >
>> >On Tue, Jul 10, 2012 at 1:38 PM, Simon MacDonald
>> ><si...@gmail.com> wrote:
>> >> So in 1.9.0 with the change brought on by CordovaWebView all of the
>> >> plugins are broken. By broken, I mean they won't compile unless you go
>> >> in and change the source code. That may not sound like broken to us
>> >> but to many of our users who are not familiar with Java that means
>> >> they are very, very broken.
>> >>
>> >> In this pull request:
>> >>
>> >>
>> >>
>> https://github.com/macdonst/cordova-android/commit/0180342dff4ce6e8f63e3d
>> >>753cb1f1588c43f9f0
>> >>
>> >> I've created a shim so that Plugins that are still using the "ctx"
>> >> variable should continue to work unmodified. I've tested it and it is
>> >> working with the following plugins:
>> >>
>> >> LowLatencyAudio
>> >> LocalNotificaiton
>> >> MacAddressPlugin
>> >> BarcodeScanner
>> >> ChildBrowser
>> >> TTS
>> >> VideoPlayer
>> >> IMEI
>> >> SpeechRecognizer
>> >> PhoneListener
>> >>
>> >> I think that gives me a pretty good cross section, I just don't have
>> >> time to test them all.
>> >>
>> >> My suggestions are:
>> >>
>> >> 1) we add this in for 2.0.0 so the existing plugins continue to work.
>> >> 2) we put in a deprecation notice for "ctx" as it is going away soon
>> >> 3) we write a detailed set of instructions on how to get your 3rd
>> >> party plugin upgraded to work in 2.0.0 without using "ctx".
>> >>
>> >> Please lemme know what you think...
>> >>
>> >> Simon Mac Donald
>> >> http://hi.im/simonmacdonald
>>
>>

Re: Shim all the plugins

Posted by Michael Brooks <mi...@michaelbrooks.ca>.
Nice work Simon!

+1

I can create the 2.00 Plugin Upgrade Guide issue for each platform.

On Tue, Jul 10, 2012 at 2:25 PM, Filip Maj <fi...@adobe.com> wrote:

> +1 ! File the issues!
>
> On 7/10/12 1:51 PM, "Joe Bowser" <bo...@gmail.com> wrote:
>
> >Why didn't I think of this?
> >
> >+1
> >
> >On Tue, Jul 10, 2012 at 1:38 PM, Simon MacDonald
> ><si...@gmail.com> wrote:
> >> So in 1.9.0 with the change brought on by CordovaWebView all of the
> >> plugins are broken. By broken, I mean they won't compile unless you go
> >> in and change the source code. That may not sound like broken to us
> >> but to many of our users who are not familiar with Java that means
> >> they are very, very broken.
> >>
> >> In this pull request:
> >>
> >>
> >>
> https://github.com/macdonst/cordova-android/commit/0180342dff4ce6e8f63e3d
> >>753cb1f1588c43f9f0
> >>
> >> I've created a shim so that Plugins that are still using the "ctx"
> >> variable should continue to work unmodified. I've tested it and it is
> >> working with the following plugins:
> >>
> >> LowLatencyAudio
> >> LocalNotificaiton
> >> MacAddressPlugin
> >> BarcodeScanner
> >> ChildBrowser
> >> TTS
> >> VideoPlayer
> >> IMEI
> >> SpeechRecognizer
> >> PhoneListener
> >>
> >> I think that gives me a pretty good cross section, I just don't have
> >> time to test them all.
> >>
> >> My suggestions are:
> >>
> >> 1) we add this in for 2.0.0 so the existing plugins continue to work.
> >> 2) we put in a deprecation notice for "ctx" as it is going away soon
> >> 3) we write a detailed set of instructions on how to get your 3rd
> >> party plugin upgraded to work in 2.0.0 without using "ctx".
> >>
> >> Please lemme know what you think...
> >>
> >> Simon Mac Donald
> >> http://hi.im/simonmacdonald
>
>

Re: Shim all the plugins

Posted by Filip Maj <fi...@adobe.com>.
+1 ! File the issues!

On 7/10/12 1:51 PM, "Joe Bowser" <bo...@gmail.com> wrote:

>Why didn't I think of this?
>
>+1
>
>On Tue, Jul 10, 2012 at 1:38 PM, Simon MacDonald
><si...@gmail.com> wrote:
>> So in 1.9.0 with the change brought on by CordovaWebView all of the
>> plugins are broken. By broken, I mean they won't compile unless you go
>> in and change the source code. That may not sound like broken to us
>> but to many of our users who are not familiar with Java that means
>> they are very, very broken.
>>
>> In this pull request:
>>
>> 
>>https://github.com/macdonst/cordova-android/commit/0180342dff4ce6e8f63e3d
>>753cb1f1588c43f9f0
>>
>> I've created a shim so that Plugins that are still using the "ctx"
>> variable should continue to work unmodified. I've tested it and it is
>> working with the following plugins:
>>
>> LowLatencyAudio
>> LocalNotificaiton
>> MacAddressPlugin
>> BarcodeScanner
>> ChildBrowser
>> TTS
>> VideoPlayer
>> IMEI
>> SpeechRecognizer
>> PhoneListener
>>
>> I think that gives me a pretty good cross section, I just don't have
>> time to test them all.
>>
>> My suggestions are:
>>
>> 1) we add this in for 2.0.0 so the existing plugins continue to work.
>> 2) we put in a deprecation notice for "ctx" as it is going away soon
>> 3) we write a detailed set of instructions on how to get your 3rd
>> party plugin upgraded to work in 2.0.0 without using "ctx".
>>
>> Please lemme know what you think...
>>
>> Simon Mac Donald
>> http://hi.im/simonmacdonald


Re: Shim all the plugins

Posted by Joe Bowser <bo...@gmail.com>.
Why didn't I think of this?

+1

On Tue, Jul 10, 2012 at 1:38 PM, Simon MacDonald
<si...@gmail.com> wrote:
> So in 1.9.0 with the change brought on by CordovaWebView all of the
> plugins are broken. By broken, I mean they won't compile unless you go
> in and change the source code. That may not sound like broken to us
> but to many of our users who are not familiar with Java that means
> they are very, very broken.
>
> In this pull request:
>
> https://github.com/macdonst/cordova-android/commit/0180342dff4ce6e8f63e3d753cb1f1588c43f9f0
>
> I've created a shim so that Plugins that are still using the "ctx"
> variable should continue to work unmodified. I've tested it and it is
> working with the following plugins:
>
> LowLatencyAudio
> LocalNotificaiton
> MacAddressPlugin
> BarcodeScanner
> ChildBrowser
> TTS
> VideoPlayer
> IMEI
> SpeechRecognizer
> PhoneListener
>
> I think that gives me a pretty good cross section, I just don't have
> time to test them all.
>
> My suggestions are:
>
> 1) we add this in for 2.0.0 so the existing plugins continue to work.
> 2) we put in a deprecation notice for "ctx" as it is going away soon
> 3) we write a detailed set of instructions on how to get your 3rd
> party plugin upgraded to work in 2.0.0 without using "ctx".
>
> Please lemme know what you think...
>
> Simon Mac Donald
> http://hi.im/simonmacdonald