amd

Is there a way to have RequireJS modules depend on code loaded with <script>?

荒凉一梦 提交于 2019-11-29 16:22:56
I am in a project where we are in the process of developing a widget system. I will try not to go into too much detail about this, but in this system widgets must be able to specify its dependencies. We have accomplished this by allowing widgets to specify its 3rd party dependencies using RequireJS. Widgets are used in in-house developed apps. These apps do not use RequireJS for their own dependencies, they merely include RequireJS for the sake of the widgets. Now, let's say that I have a widget that wants to use the library X. X is a library that specifies an AMD dependency on jQuery (the AMD

When designing a JS library should I make it RequireJS/AMD compatible or not?

天涯浪子 提交于 2019-11-29 13:13:27
问题 If I'm making a JavaScript library for general use, how should I handle RequireJS support? As far as I can tell, making your code compliant with RequireJS more or less makes it impossible to use without RequireJS. So why would I do that? How do people without Require use this code? Is there a way to support both without forking / branching? Should I provide the shim code? Do I understand this correctly? 回答1: If you're only dealing with browser (not node.js), it's only a handful of lines to

How do I document AMD + Backbone project with JSDoc3

痴心易碎 提交于 2019-11-29 10:27:30
I have a Backbone boilerplate based project, that I want to document with recent jdoc-toolkit Though I can't get it to generate anything but empty _global class Code sample: /** * This is a root model for DLClass * @module models/DLClass */ define([ 'underscore', 'backbone' ], /** @lends DLClass */ function (_, Backbone) { /** * This is a root model for DLClass * @class DLClass * @constructor * @return Session Object */ var DLModel = Backbone.Model.extend({ /** @lends DLClass.prototype */ /** * Generic tap event * @param touchEvent */ onTap: function (touchEvent) { }, Try adding the @namespace

tressfx hair

一笑奈何 提交于 2019-11-29 09:49:11
自古以来,人类头发的实时精确渲染都是游戏里最为复杂、最具挑战性的项目——成千上万、各自独立的微小细丝都是半透明的,都有复杂的阴影,还需要抗锯齿,而且为了配合人物动作,这些计算都需要每秒钟进行几十次,这对GPU来说是无比巨大的压力。 GPU厂商也在为实现更真实的头发效果而不懈地努力着,AMD的最新成果就是“TressFX Hair”,并且通过与Crystal Dynamics工作室的紧密合作,2013年新版《 古墓丽影 》第一个引入了这种技术,就看 劳拉 的了。 AMD TressFx Hair技术宣传广告 TressFX Hair使用了 DirectCompute 编程语言,结合AMD GCN架构(Radeon HD 7000系列)的强大 并行计算 能力,可以理解成将头发渲染的工作部分转到了后期处理中。AMD还利用了此前的顺序无关透明(OIT)技术,使用“Per-pixel Linked List”(每像素链接清单/PPLL)数据结构来管理渲染的复杂性和显存使用。 TressFX Hair就这样构建了一套实时物理模拟系统,将每一根头发作为几十条链接中的一环,让重力、风雨、头部运动等因素以更真实的方式描绘头发。还有碰撞检测机制,确保发丝不会彼此穿越,或者跑到头皮、衣服、身体等其它实体表面之下。 此外,头发在受到外力影响而发生变化之后,会逐渐回到最初状态。 来源: https:/

Does AMD's OpenCL offer something similar to CUDA's GPUDirect?

 ̄綄美尐妖づ 提交于 2019-11-29 08:17:31
问题 NVIDIA offers GPUDirect to reduce memory transfer overheads. I'm wondering if there is a similar concept for AMD/ATI? Specifically: 1) Do AMD GPUs avoid the second memory transfer when interfacing with network cards, as described here. In case the graphic is lost at some point, here is a description of the impact of GPUDirect on getting data from a GPU on one machine to be transferred across a network interface: With GPUDirect, GPU memory goes to Host memory then straight to the network

State of Jasmine Unit Test support of Resharper 2017: Debug mode and AMD modules supported?

一笑奈何 提交于 2019-11-29 07:26:54
I currently use Chutzpah to run and debug Jasmine Unit tests that include AMD/require.js modules. I would like switch to the test runner of Resharper 2017. However, Resharper does not seem to fully support Jasmine Unit Tests? A. Example jasmine test: /// <reference path="../../bower_components/requirejs/require.js" /> /// <reference path="../../bower_components/jasmine-core/lib/jasmine-core/jasmine.js" /> describe('dummy example test', function() { it("should return bar", function () { expect(true).toEqual(true); }); }); The Test can be run with Resharper but the Debugging option is disabled:

Import TypeScript module using only ambient definition for use in amd

六月ゝ 毕业季﹏ 提交于 2019-11-29 02:26:28
问题 I have a module that depends on Backbone . I have a backbone.d.ts definition but TypeScript doesn't seem to want to compile my module unless my import Backbone = module("backbone") actually points to a valid backbone module as opposed to a definition file. I am using AMD loaded modules and have a requirejs shim defined for backbone. Is there a workaround besides creating a phoney backbone.ts module definition? Update: A side effect of the solution is that code such as this no longer works

How do AMD loaders work under the hood?

孤人 提交于 2019-11-28 23:30:49
So I've been using require.js for while now, but I realized that I actually don't know how it works under the hood. It says that it's an AMD loader. I do understand that CommonJS is synchronous, which means that it blocks execution of other codes while it's being loaded. On the other hand, AMD is asynchronous. This is where I get confused. When I define a module, it has to load a,b,c in order to execute the callback. How does asynchronous work here? Isn't it synchronous when it has to load those three dependencies first? Does it mean that AMD loads a,b,c asynchronously then checks to see if

How much speed is gained with RequireJS/AMD in JS? [closed]

假如想象 提交于 2019-11-28 16:31:44
问题 How much faster is requireJS actually, on a large website? Has anyone done any tests on the speed of large websites that use asynchronous loading vs not? For instance, using Backbone with a lot of views (> 100), is it better to simply have a views object that gets loaded with all the views at once and is then always available, or should they all be loaded asynchronously as needed? Also, are there any differences for these considerations for mobile vs desktop? I've heard that you want to limit