Updating a project to the latest version of cocos2d-js

What is the procedure to update a project to use the latest version of cocos2d-js?

Refer to this upgrade guide
: http://www.cocos2d-x.org/docs/manual/framework/html5/release-notes/v3.0rc0/upgrade-guide/en

Hello, thank you for the quick response @pandamicro .

I actually meant upgrading cocos2d-js 3(beta/RC) projects to cocos2d-js 3 final.

When new releases will be made will cocos console provide a way to upgrade the projects?

There is no automatic upgrade with cocos console. But every API changes have been noted in the upgrade guide, so please use this document to manually upgrade your project.

@pandamicro, I understand that the API changes are noted. I don’t mean updating the project’s code.

The thing is when we create a project using cocos console the project is created with the currently setup version of cocos2d-x and cocos2d-js.

Then when we update the cocos2d-x version and the cocos2d-js version in our environment the project keeps using the older versions installed in the frameworks folder of the project.

Currently users have issues that have already been fixed in cocos2d-js while using cocos code IDE for example.

There should be a cocos update command to update the version of cocos2d and dependencies used by the project.
We don’t need anything fancy, but if eventually we could chose the version a project uses it would be great! i.e. cocos update cocos2d-js@3.0-RC2

Oh, I finally got what you mean, unfortunately, Cocos Console doesn’t have such functionality.

The suggested way is:

  1. Download the new version
  2. Upgrade cocos command
  3. Create a new project
  4. Replace the “src”, “res”, “index.html”, “project.json”, “main.js” etc with your old project

@pandamicro OK, I will do that.

This is quite a shortcoming in the tool. It’s a feature to consider for a next version.

We will consider that, thanks! @zhangbin What do you think ?

All modern frameworks I have used in the last 5 years have features to upgrade the framework and the dependencies used in a project (from web servers, perforce, git or other proprietary servers).

I believe that eventually creating a repo for modules and other dependencies could help cocos2d become a greater framework. In the meantime simply updating the framework from a local folder or from a git path (local or remote) would be enough

@slawo, I think it’s a good idea in mind. My understanding of your idea is :
cocos console should add a command update to upgrade the frameworks of an existed project.

In fact, I think the problem of the feature is:
The API of frameworks is always changing. So the project after upgraded can’t work in most cases.

After all, thanks for your opinion.
We will discuss the topic internal, and maybe it will be done in later version.

@zhangbin Hi, Thanks for taking the time to discuss this.

I believe that not having this feature will increase the problems with API changes.
While projects code has to be manually updated with each major version of cocos2d-js we could take the time to do the changes gradually with a cocos update command, because then updating the framework version would be simpler and faster to do.

Without an easy upgrade path, when as developers we get in a situation where we have to upgrade the framework in our projects (when we need a new feature or a bug fix in cocos2d) and the version gap is important then we end up having a lot more to change at once… and the task becomes harder.

npm manages the updates very well. But there are situations where we have to upgrade our node.js applications anyway, when a new version of a library is released and some features we need require a new major version, at some point we take the time to upgrade.

Updating regularly some projects help staying current. Other (very large projects with hosts of dependencies) need too much work to upgrade, in those cases we hardcode the version numbers of the dependencies and we can deep working with older versions on those projects.

It would be really nice to have such features in cocos2d.

At some point adding a repository of plugins/modules would be highly beneficial to the framework. node.js would never have gotten so much traction without npm, unity3d would be much less successful without the assets store, Unreal Engine 4 is starting to get nice content in its marketplace… I believe that if cocos 2d had such a feature it would grow faster, user’s content would be more easily browsable, easier to integrate in our projects and everybody would be benefit from that.

With Cocos Creator, the project automatically updates to the latest version of Cocos2d-x (JavaScript)