resourcemanager's Issues
如果一个 subkey 不存在,报错信息中只显示了 key,没有显示 subkey,调试非常困难
原来有多个default.res.json文件,现在怎么最优过渡
主要包含了多语言导致的不同资源.
之前基本是人工维护,在新版资源管理里有更方便的手段吗?
这个项目估计又是个中间产物
各种问题,估计要挂
支持 npm 2.x
如果使用 npm 2.x 版本,执行 res
会报错 Could not found module 'fs-extra-promise'
setMaxLoadingThread和setMaxRetryTimes何时实现?
从我开始用这个模块开始,这两个方法就一直没实现,在实际开发中这两个方法还是非常有用的,能透露下这方面的开发计划吗?
RES.isGroupLoaded 与旧版本行为不一致
RES.isGroupLoaded 与旧版本行为不一致
使用 ResourceManager 发布资源遇到问题
使用 ResourceManager 发布html5资源,遇到问题如下:
1、按照publish.md文档步骤,发不完之后,config文件都被加了后缀,这个和RES.loadConfig() 不再接受参数,强制访问 resource/config.json 文件冲突
2、手动把第一步的config后缀去掉后,又遇到第二个,在default.thm.json中的skin和exmls,发布之后并不会被自动修改后缀,这就导致在加载这个主题文件时,提示里面的各种小皮肤找不到。
请问以上两个问题是否可解?或者有没有其他办法可以使用ResourceManager发布资源支持crc32
ResourceManager 和 EUI 使用纹理合并后存在冲突
这个问题可能由多方面原因导致
- 老项目如果 RES.mapConfig 的 TypeSelector 判断错误,就会导致纹理加载失败 #19
- 如果在 Egret Wing 中直接拖拽一个合图后的纹理,无法正确显示,需要把 key 中的 . 修改为 #
问题2会在未来的 Egret Wing 中进行解决,目前开发者可以手动修改项目中的 AssetAdapter ,将外部传递的 . 替换为 #
在 res build 命令执行时,进行更严格的类型检查,以尽可能确保老项目升级 res 成功
res build 执行时,检查 RES.mapConfig 中的 TypeSelector 函数的运行结果与老项目的default.res.json中的类型是否一致,如果不一致的话优先使用 default.res.json 中的类型
config.json里面组中的key必须是alias吗?
组指的groups
.
如果是,那么这里是否只能手动修改?
如果不是,那么这个key还可以是什么?
alias
本身需要填文件路径这个方式是已经固定了的吗?
使用资源名代替资源URL作为加载的 ResourceName
即旧版本中的 name 属性,在新版本中也会支持这种做法,但是无需开发者手动设置 name ,而是通过一个 RES.mapResourceName
方法自动生成
资源配置文件的自动生成
如果 mapConfig 中排除了一部分文件,而 default.res.json 中又包含这部分文件,res build 命令会报错
Processor 应该是一个 class 而不是简单的 Object
这种自定义的方法,远远不如原本的 Analyzer
原本 Analyzer 可以实现 继承后 override 特点方法,现在的 processor 只是 Res.processor.map 里的一个 Object,不能做到继承。
毕竟是 Typescript 的 项目,class 继承 这种基本的功能 还是应该实现的。
低版本 nodejs 运行 res 有可能报错
如果用户的 node 版本较低,会报以下错误
AppData\Roaming\npm\node_modules\egret-resource-manager\script\out\cli.js:3
const res = require("./");
^^^^^
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
相关链接:
使用 resourcemanager 打包 iOS / Android 原生项目启动黑屏
ResourceManager 之前并未适配 iOS / Android 的 manifest / VersionController 机制
在本次更新中,已经初步适配了这个功能,解决了此问题
在接下来的更新中,将会进一步重构,合并 manifest 文件和 config.json 文件
架构设计:资源管理的 core 模块与 shim 模块
资源管理模块包含 core (内核)和 shim (兼容层)两层结构,core模块包含以下一组 API
R.load: (url:string)=>Promise<any>
R.unload: (url:string)=>Promise<void>
在未来,开发者只需直接使用 core 内核的 API 即可,但是在短期内,考虑到 core 模块的 API 可能会出现较大幅度的变化,目前只开放 shim 模块的 API,即 RES.loadGroup
等老式 API
以下功能不属于内核:
- 资源组
- 资源别名
这些功能将被作为一个 shim 模块,用于老项目进行迁移和向下兼容
RES.getResByUrl不支持await
看了下源码,实际上RES.Resource.getResByUrl返回的已经是一个Promise对象了,为什么在RES.getResByUrl中不返回Promise对象,而是void?
并且RES.instance没有对外开放,如果想用await写法,就只能进行如下操作:
await new RES.Resource().getResByUrl(source, null, this, RES.ResourceItem.TYPE_IMAGE);
这样设计的目的是什么呢?这个新模块不就是为了ES2015而生的么?
createGroup 如果传递的是 url 而不是 alias,加载显示一个 warning
版本控制支持
允许开发者将资源按照 crc32 编码格式进行发布,以实现版本控制与热更新功能
resourcemanager升级的必要性?
比较老版的RES,新的resourcemagnager就是添加了promise语法支持,性能上并无优势?
除了通过res build 引入旧有default.res.json 的 group以外,有什么办法独立自动生成config.json里的group?只能依赖过去的系统的话,这个方案是不是太过简陋了。。
官方会完全废弃原本的RES吗?预计是什么时候?
重构资源 API ,提供 mapResourceType , mapResourceName ,mapResourceMerger 方法
RES.mapConfig(config,root,typeSelector)
的第三个参数 typeSelector
被废弃,改为使用RES.mapResourceType(typeSelector)
实现
资源的生命周期管理:加载、持有与卸载
res build 在转换 resource.json 时,没有对应删除 resource.json 中已经被删除的 group 和 alias
res build 在转换 resource.json 时,没有对应删除 resource.json 中已经被删除的 Group 和 alias
相关问题:
http://bbs.egret.com/forum.php?mod=viewthread&tid=25955
为什么 RES.getResByUrl 没有采用和 RES.getResAsync 类似的(Promise)返回方式?
为什么 getResAsync
可以用这种语法:
await getResAsync("images/logo.jpg")
而
getResByUrl
还不支持呢
添加 watch 功能
如果 loadGroup 中有一个资源不存在导致报错,就会导致后续的很多行为阻塞无法执行
这个项目现在达到release状态了吗?
resource的demo项目都跑不通
E:\workspace\html5\test\resourceTest\resourceTest>res build
C:\Users\xy\AppData\Roaming\npm\node_modules\egret-resource-manager\node_modules\vinyl-fs\node_modules\glob-stream\node_modules\glob\node_modules\inflight\inflight.js:39
RES.apply(null, args)
^
ReferenceError: RES is not defined
at C:\Users\xy\AppData\Roaming\npm\node_modules\egret-resource-manager\node_modules\vinyl-fs\node_modules\glob-stream\node_modules\glob\node_modules\inflight\inflight.js:39:11
at doNTCallback0 (node.js:419:9)
at process._tickCallback (node.js:348:13)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.