Feed back about "jsb" namespace

Hi, all

I want to have your feed backs about our new namespace jsb

If you have been tracking our recent release, you will find that jsb only APIs have been moved to a new namespace called : jsb. You can see it also in 3.0 RC0 change log : http://www.cocos2d-x.org/docs/manual/framework/html5/release-notes/v3.0rc0/changelog/en

API affected is mainly:

cc.fileUtils -> jsb.fileUtils
cc.AssetsManager -> jsb.AssetsManager
cc.Reflection -> jsb.Reflection

The original idea of this is to warn user the usage of those APIs, as they are not available in web engine, we suggest user to detect cc.sys.isNative before using them.
But users have reported to us that they think it’s too complicated to have too much namespaces, and it’s hard to remember.

We are thinking it through again, so we want your voice and decide how Cocos2d-JS involve with all the community. Please note your choice in your response:

  1. Keep cc namespace for those JSB only APIs, and make it clear in the document
  2. Use jsb namespace to help avoiding any mistaken usage

We appreciate all kind of feed backs, comments and critics, thank you all !

I don’t like jsb namespace, especially for AssetsManager. Have a look at js-tests/ExtenstionTest/AssetsManagerTest.js.

new jsb.AssetsManager(...)
new cc.EventListenerAssetsManager(...)
cc.EventAssetsManager.ERROR_NO_LOCAL_MANIFEST

I think this is very strange and complicate.

If we need to use jsb for AssetsManager, we need to change also
cc.EventListenerAssetsManager -> jsb.EventListenerAssetsManager
cc.EventAssetsManager -> jsb.EventAssetsManager

The code fragment you posted is indeed very strange

i like jsb namespace ,

now I met the jsb namespace i will add isNative or os.ANDROID like that

cross-platform code this is

I think it’s cleaner to leave JSB-only features grouped in their own namespace too.