You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Kevin Hawkins <kh...@salesforce.com> on 2012/10/31 01:34:26 UTC

iOS: Why does the cordova.js filename change?

Hi all,

Apologies if/that I've missed this discussion previously.  I'm not clear on why the cordova.js file name changes in the iOS repo, particularly given the fact that great lengths seem to have been taken everywhere to be agnostic about what the originating name is, opting to dynamically update the destination name in build scripts, template generation, etc.?

Changing the originating file name with each new iteration/revision of Cordova makes it hard to follow its history on GitHub (though it's easy enough locally with git log and --follow), and just generally seems unnecessary.

Thanks,
Kevin


Re: iOS: Why does the cordova.js filename change?

Posted by Kevin Hawkins <ke...@gmail.com>.
+1 to one copy.  And preferably, one name (e.g. cordova.ios.js or similar)
for the originating file.  As mentioned, the various deployment scripts
(e.g. Makefile) recreate the destination file name anyway, based on the
contents of the VERSION file.  And that to me seems like a pretty good
model to follow.

I generally agree with Shaz: cordova.js is pretty tightly coupled with
CordovaLib updates/versioning, so it probably makes sense to be a resource
somewhere in that path.

My $0.02,
Kevin


On Fri, Nov 2, 2012 at 2:49 PM, Andrew Grieve <ag...@chromium.org> wrote:

> It actually does bother me a little bit too, to have the file name have a
> version in it when we're developing.
>
> I don't really care where we put the file so long as there is only one copy
> of it and not multiple.
>
>
> On Wed, Oct 31, 2012 at 4:22 PM, Shazron <sh...@gmail.com> wrote:
>
> > On iOS, the cordova.js used to (inertia really because of the legacy
> > location) be in the CordovaLib folder, and also the template. Since it
> > was redundant, we only put it in the default template in
> > bin/templates/project now.
> >
> > Even this is not ideal with respect to people upgrading and using it
> > as an embedded WebView -- to grab the new .js they have to create a
> > new project (or spelunk into the bin/templates folder). Ideally it
> > should be put back also into CordovaLib because the .js is tightly
> > coupled to a specific CordovaLib library and version, and for easy
> > discovery. Don't know what the ideal situation can be here.
> >
> > On Tue, Oct 30, 2012 at 5:34 PM, Kevin Hawkins <kh...@salesforce.com>
> > wrote:
> > > Hi all,
> > >
> > > Apologies if/that I've missed this discussion previously.  I'm not
> clear
> > on why the cordova.js file name changes in the iOS repo, particularly
> given
> > the fact that great lengths seem to have been taken everywhere to be
> > agnostic about what the originating name is, opting to dynamically update
> > the destination name in build scripts, template generation, etc.?
> > >
> > > Changing the originating file name with each new iteration/revision of
> > Cordova makes it hard to follow its history on GitHub (though it's easy
> > enough locally with git log and --follow), and just generally seems
> > unnecessary.
> > >
> > > Thanks,
> > > Kevin
> > >
> >
>

Re: iOS: Why does the cordova.js filename change?

Posted by Andrew Grieve <ag...@chromium.org>.
Created bug: https://issues.apache.org/jira/browse/CB-1822


On Mon, Nov 5, 2012 at 3:03 PM, Shazron <sh...@gmail.com> wrote:

> > I'm thinking we only update:
>
> >  >   CordovaLib/cordova.ios.js with the latest from cordova-js
> > >
> > > I think we could do this without the explicit step.
> >
> >
> Ok.
>
>
> > > Then for a release, run a script/Makefile target to update:
> > > 1. CordovaLibAppTests/www/cordova.ios.js
> > >
> > For this, we can add a copy step to the build phases to copy the file in
> > from CordovaLib on each build
> >
> >
> Not feeling too hot for this, we used to have build phases in the project
> file. Caused some problems with upgrades and stuff, and was too "hidden"
> for people to know what is going on. But this was for a regular project not
> CordovaLibAppTests, so I guess its okay for this case.
>
>
> > > 2. bin/templates/project/www with the versioned .js
> > >
> > For this, we can have the create script just grab the .js file from
> > CordovaLib instead of from the templates directory.
>
>
> That can work.
>

Re: iOS: Why does the cordova.js filename change?

Posted by Shazron <sh...@gmail.com>.
> I'm thinking we only update:

>  >   CordovaLib/cordova.ios.js with the latest from cordova-js
> >
> > I think we could do this without the explicit step.
>
>
Ok.


> > Then for a release, run a script/Makefile target to update:
> > 1. CordovaLibAppTests/www/cordova.ios.js
> >
> For this, we can add a copy step to the build phases to copy the file in
> from CordovaLib on each build
>
>
Not feeling too hot for this, we used to have build phases in the project
file. Caused some problems with upgrades and stuff, and was too "hidden"
for people to know what is going on. But this was for a regular project not
CordovaLibAppTests, so I guess its okay for this case.


> > 2. bin/templates/project/www with the versioned .js
> >
> For this, we can have the create script just grab the .js file from
> CordovaLib instead of from the templates directory.


That can work.

Re: iOS: Why does the cordova.js filename change?

Posted by Andrew Grieve <ag...@chromium.org>.
On Fri, Nov 2, 2012 at 6:20 PM, Shazron <sh...@gmail.com> wrote:

> Ok I found out its actually in two locations, it's in the
> CordovaLibAppTests/www folder as well as the bin/template.
>
> Yeah having one location would be best -- we did have it not having the
> version before though, with copying/updates based on the Makefile.
>
> I'm thinking we only update:
>   CordovaLib/cordova.ios.js with the latest from cordova-js
>
> I think we could do this without the explicit step.


> Then for a release, run a script/Makefile target to update:
> 1. CordovaLibAppTests/www/cordova.ios.js
>
For this, we can add a copy step to the build phases to copy the file in
from CordovaLib on each build


> 2. bin/templates/project/www with the versioned .js
>
For this, we can have the create script just grab the .js file from
CordovaLib instead of from the templates directory.



>
> On Fri, Nov 2, 2012 at 2:49 PM, Andrew Grieve <ag...@chromium.org>
> wrote:
>
> > It actually does bother me a little bit too, to have the file name have a
> > version in it when we're developing.
> >
> > I don't really care where we put the file so long as there is only one
> copy
> > of it and not multiple.
> >
> >
> > On Wed, Oct 31, 2012 at 4:22 PM, Shazron <sh...@gmail.com> wrote:
> >
> > > On iOS, the cordova.js used to (inertia really because of the legacy
> > > location) be in the CordovaLib folder, and also the template. Since it
> > > was redundant, we only put it in the default template in
> > > bin/templates/project now.
> > >
> > > Even this is not ideal with respect to people upgrading and using it
> > > as an embedded WebView -- to grab the new .js they have to create a
> > > new project (or spelunk into the bin/templates folder). Ideally it
> > > should be put back also into CordovaLib because the .js is tightly
> > > coupled to a specific CordovaLib library and version, and for easy
> > > discovery. Don't know what the ideal situation can be here.
> > >
> > > On Tue, Oct 30, 2012 at 5:34 PM, Kevin Hawkins <
> khawkins@salesforce.com>
> > > wrote:
> > > > Hi all,
> > > >
> > > > Apologies if/that I've missed this discussion previously.  I'm not
> > clear
> > > on why the cordova.js file name changes in the iOS repo, particularly
> > given
> > > the fact that great lengths seem to have been taken everywhere to be
> > > agnostic about what the originating name is, opting to dynamically
> update
> > > the destination name in build scripts, template generation, etc.?
> > > >
> > > > Changing the originating file name with each new iteration/revision
> of
> > > Cordova makes it hard to follow its history on GitHub (though it's easy
> > > enough locally with git log and --follow), and just generally seems
> > > unnecessary.
> > > >
> > > > Thanks,
> > > > Kevin
> > > >
> > >
> >
>

Re: iOS: Why does the cordova.js filename change?

Posted by Shazron <sh...@gmail.com>.
Ok I found out its actually in two locations, it's in the
CordovaLibAppTests/www folder as well as the bin/template.

Yeah having one location would be best -- we did have it not having the
version before though, with copying/updates based on the Makefile.

I'm thinking we only update:
  CordovaLib/cordova.ios.js with the latest from cordova-js

Then for a release, run a script/Makefile target to update:
1. CordovaLibAppTests/www/cordova.ios.js
2. bin/templates/project/www with the versioned .js


On Fri, Nov 2, 2012 at 2:49 PM, Andrew Grieve <ag...@chromium.org> wrote:

> It actually does bother me a little bit too, to have the file name have a
> version in it when we're developing.
>
> I don't really care where we put the file so long as there is only one copy
> of it and not multiple.
>
>
> On Wed, Oct 31, 2012 at 4:22 PM, Shazron <sh...@gmail.com> wrote:
>
> > On iOS, the cordova.js used to (inertia really because of the legacy
> > location) be in the CordovaLib folder, and also the template. Since it
> > was redundant, we only put it in the default template in
> > bin/templates/project now.
> >
> > Even this is not ideal with respect to people upgrading and using it
> > as an embedded WebView -- to grab the new .js they have to create a
> > new project (or spelunk into the bin/templates folder). Ideally it
> > should be put back also into CordovaLib because the .js is tightly
> > coupled to a specific CordovaLib library and version, and for easy
> > discovery. Don't know what the ideal situation can be here.
> >
> > On Tue, Oct 30, 2012 at 5:34 PM, Kevin Hawkins <kh...@salesforce.com>
> > wrote:
> > > Hi all,
> > >
> > > Apologies if/that I've missed this discussion previously.  I'm not
> clear
> > on why the cordova.js file name changes in the iOS repo, particularly
> given
> > the fact that great lengths seem to have been taken everywhere to be
> > agnostic about what the originating name is, opting to dynamically update
> > the destination name in build scripts, template generation, etc.?
> > >
> > > Changing the originating file name with each new iteration/revision of
> > Cordova makes it hard to follow its history on GitHub (though it's easy
> > enough locally with git log and --follow), and just generally seems
> > unnecessary.
> > >
> > > Thanks,
> > > Kevin
> > >
> >
>

Re: iOS: Why does the cordova.js filename change?

Posted by Andrew Grieve <ag...@chromium.org>.
It actually does bother me a little bit too, to have the file name have a
version in it when we're developing.

I don't really care where we put the file so long as there is only one copy
of it and not multiple.


On Wed, Oct 31, 2012 at 4:22 PM, Shazron <sh...@gmail.com> wrote:

> On iOS, the cordova.js used to (inertia really because of the legacy
> location) be in the CordovaLib folder, and also the template. Since it
> was redundant, we only put it in the default template in
> bin/templates/project now.
>
> Even this is not ideal with respect to people upgrading and using it
> as an embedded WebView -- to grab the new .js they have to create a
> new project (or spelunk into the bin/templates folder). Ideally it
> should be put back also into CordovaLib because the .js is tightly
> coupled to a specific CordovaLib library and version, and for easy
> discovery. Don't know what the ideal situation can be here.
>
> On Tue, Oct 30, 2012 at 5:34 PM, Kevin Hawkins <kh...@salesforce.com>
> wrote:
> > Hi all,
> >
> > Apologies if/that I've missed this discussion previously.  I'm not clear
> on why the cordova.js file name changes in the iOS repo, particularly given
> the fact that great lengths seem to have been taken everywhere to be
> agnostic about what the originating name is, opting to dynamically update
> the destination name in build scripts, template generation, etc.?
> >
> > Changing the originating file name with each new iteration/revision of
> Cordova makes it hard to follow its history on GitHub (though it's easy
> enough locally with git log and --follow), and just generally seems
> unnecessary.
> >
> > Thanks,
> > Kevin
> >
>

Re: iOS: Why does the cordova.js filename change?

Posted by Shazron <sh...@gmail.com>.
On iOS, the cordova.js used to (inertia really because of the legacy
location) be in the CordovaLib folder, and also the template. Since it
was redundant, we only put it in the default template in
bin/templates/project now.

Even this is not ideal with respect to people upgrading and using it
as an embedded WebView -- to grab the new .js they have to create a
new project (or spelunk into the bin/templates folder). Ideally it
should be put back also into CordovaLib because the .js is tightly
coupled to a specific CordovaLib library and version, and for easy
discovery. Don't know what the ideal situation can be here.

On Tue, Oct 30, 2012 at 5:34 PM, Kevin Hawkins <kh...@salesforce.com> wrote:
> Hi all,
>
> Apologies if/that I've missed this discussion previously.  I'm not clear on why the cordova.js file name changes in the iOS repo, particularly given the fact that great lengths seem to have been taken everywhere to be agnostic about what the originating name is, opting to dynamically update the destination name in build scripts, template generation, etc.?
>
> Changing the originating file name with each new iteration/revision of Cordova makes it hard to follow its history on GitHub (though it's easy enough locally with git log and --follow), and just generally seems unnecessary.
>
> Thanks,
> Kevin
>