amd

Howto bootstrap Backbone app with yeoman having require.js enabled

与世无争的帅哥 提交于 2019-12-08 17:40:02
问题 I'm playing with yeoman for a time now. I wonder how I accomplish bootstrapping a Backbone application and having require.js enabled at the same time. yeoman init provides me with a setup where I can work with modules in AMD style. yeoman init backbone:all provides me with a Backbone scaffold but I had to "include" all my models, collection etc. manually in index.html. Is there a way to have both? Regards Felix 回答1: There's already an open issue for this. Add your thoughts there :) 回答2: We

Import dependencies in ember-cli (e.g., import math.js)

非 Y 不嫁゛ 提交于 2019-12-08 15:47:05
问题 I am puzzled about importing dependencies in ember-cli, especially about the standard AMD case, as mentioned in the official Ember Cli document. The document doesn't provide much of examples, and seems to me it assumes the readers have good knowledge about AMD, which is not the case for me. My immediate use case is import math.js. Unfortunately, the official document of math.js doesn't provide example about importing with Ember Cli. Then, I found this post with relatively clearer examples, in

RequireJS how specify shim dependency from jam file package section

我是研究僧i 提交于 2019-12-08 13:26:42
问题 I'm working in a project with backbone-boilerplate which uses RequireJS to load modules and JamJS to manage them. My require config.js file is as follows: require.config({ deps: ["../vendor/jam/require.config", "main"], paths: { "backbone.localStorage": "../vendor/backbone.localStorage-1.0/backbone.localStorage" }, shim: { "backbone.localStorage": { deps: ['backbone'] } } }); As you can see the RequireJS load config from jam config file jam/require.config.js which specifies backbone, jquery

Lazy-load MonacoEditor

风流意气都作罢 提交于 2019-12-08 08:10:18
问题 I have the following code to load MonacoEditor in index.html of my AngularJS website: <link rel="stylesheet" data-name="vs/editor/editor.main" href="/monaco-editor/min/vs/editor/editor.main.css" /> <script src="/monaco-editor/min/vs/loader.js"></script> <script src="/monaco-editor/min/vs/editor/editor.main.nls.js"></script> <script src="/monaco-editor/min/vs/editor/editor.main.js"></script> <script> require.config({ paths: { 'vs': '/monaco-editor/min/vs' }}) console.log(monaco) </script>

How to load bluebird (pulled from NPM) into a Dojo project as an AMD module?

老子叫甜甜 提交于 2019-12-08 06:49:42
问题 I am working on a Dojo project which uses a number of NPM packages, one of them being bluebird as I need to use Promise in IE. I am looking for the best practice/recommended way to load NPM packages into my project. The following code is an example illustrating my question: require([ 'dojo/dom', 'dojo/request', 'dojo/domReady!' ], function(dom, request) { var message = dom.byId('greeting'); message.innerHTML = "Getting started"; var p1 = new Promise(function(resolve, reject) { setTimeout

what (amd) script loader to use for mobile site

六眼飞鱼酱① 提交于 2019-12-08 03:45:34
问题 I'm starting work on a new version of a mobile site. I am looking into using an amd script loader and have pretty much narrowed it down to require and lsjs. I know there are many pro's and con's to both, but I am trying to figure all of those out for the mobile version of my site. Does anyone have experience with this lib's at the mobile level? Just trying to get a discussion going here of what people think the best way to go is. (anyone with a 1500 rep want to create an lsjs tag :) ). Maybe

jQuery 1.7+, AMD (RequireJS), and Global Scope

江枫思渺然 提交于 2019-12-08 02:53:54
问题 I'm trying to get more in line w/ AMD, and I've come across something in jQuery source that I just can't quite undertand. Here is section (found just before the end of the file): if ( typeof define === "function" && define.amd && define.amd.jQuery ) { define( "jquery", [], function () { return jQuery; } ); } From what I can see, one of the major points of AMD is to keep the global scope clean. Yet jQuery chooses to return a reference to itself as a module, but still infects the global space.

Does the official OpenCL 2.2 standard support the WaveFront?

妖精的绣舞 提交于 2019-12-07 20:03:27
问题 As known, AMD-OpenCL supports WaveFront (August 2015): http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/12/AMD_OpenCL_Programming_Optimization_Guide2.pdf The AMD Radeon HD 7770 GPU, for example, supports more than 25,000 in-flight work-items and can switch to a new wavefront (containing up to 64 work-items) in a single cycle. But why in the OpenCL standards 1.0/2.0/2.2 there is no mention about the WaveFront? None of the PDF has not a word WaveFront : https://www.khronos.org

Sharing TypeScript classes between client and server

狂风中的少年 提交于 2019-12-07 17:38:40
问题 I have a Node.js project written in TypeScript. In my project, I have a folder named "public" which contains the client side code & HTML and also a file named classes.ts which is supposed to be shared to the server side. The problem is that I need to add "export" before the classes declaration in order to make them accessible in the server, but then in the browser I get this Error: Uncaught ReferenceError: exports is not defined I found these questions: https://github.com/Microsoft/TypeScript

Dojo 1.7 how to use dojo components outside of require()

时光毁灭记忆、已成空白 提交于 2019-12-07 15:29:21
问题 I have created Dojo widget like below using AMD loader in Dojo 1.7.2 var myCpane; require([ "dijit/layout/ContentPane" ], function(ContentPane) { myCpane = new ContentPane(); }); myCpane.startup(); // It gives 'myCpane' as undefined In the above example, in the last statment, the variable 'myCpane' is coming as 'undefined', if I use the 'myCpane.startup()' inside the 'require()' callback function then, it will work fine. But I want to use that 'myCpane' variable on outside of the 'require'