amd

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

江枫思渺然 提交于 2019-12-06 08:40:39
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. It seems to me, that adding "jQuery.noConflict();" just before the return would resolve this and still

what (amd) script loader to use for mobile site

不羁岁月 提交于 2019-12-06 07:42:40
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 either of the creators of these libraries (todd burke or richard backhouse) have an opinion on this

16寸MacBook Pro配置好不好 16寸MacBook Pro配置怎么样

南笙酒味 提交于 2019-12-06 06:37:09
前一阵,苹果在其官网上线了全新的16寸MacBook Pro。全新的16寸MacBook Pro将Mac笔记本电脑的强大性能,推上新的高度。拥有更大的屏幕,具有超快的性能、最大的电池、最好的笔记本键盘、超棒的扬声器和大量的存储空间。一起来详细了解一下。 https://www.macdown.com   16寸MacBook Pro配置详细介绍:   16寸MacBook Pro价格:   2.6GHz 6 核处理器,512GB 存储容量,AMD Radeon Pro 5300M(标配):18,999 元   2.3GHz 8 核处理器,1TB 存储容量,AMD Radeon Pro 5500M(高配):22,199 元   处理器:   2.6GHz 6 核 Intel Core i7 处理器 (Turbo Boost 最高可达 4.5GHz),配备 12MB 共享三级缓存(标配)   2.3GHz 8 核 Intel Core i9 处理器 (Turbo Boost 最高可达 4.8GHz),配备 16MB 共享三级缓存(高配)   显示屏:   视网膜显示屏,16 英寸 (对角线) LED 背光显示屏 (采用 IPS 技术);初始分辨率 3072 x 1920 (226 ppi),支持上千万色彩   支持的扩展分辨率:1920 x 1200;1680 x 1050;1280

How to use Bluebird with current TypeScript?

给你一囗甜甜゛ 提交于 2019-12-06 04:39:27
问题 I just don't get it. Once this was relatively easy, I downloaded the snippet from DefinitelyTyped, it assumed it was globally declared, I added the script and it worked. Now it seems that I have no other option that to use a complex package manager and asynchronous loading system, possibly with an optimizer for production. Ideally I just want some TypeScript code like this // maybe some import? Promise.resolve("foo").then(function(msg) { console.log(msg); } compile to some JavaScript like

DataJS library not loading in RequireJS

此生再无相见时 提交于 2019-12-06 04:37:15
I am new to RequireJS, so this might be a stupid question! I am using require-jquery. I want to load the DataJS library as a module. It is a standalone library and does not depend on jQuery. This is what my HTML file start.htm looks like: <html> <head> </head> <body> <script type="text/javascript" src="Scripts/Loader.js"></script> </body> </html> This is what the Loader.js file looks like: (function (window, undefined) { var script = document.createElement('script'); script.async = true; script.src = "scripts/require-jquery.js"; var entry = document.getElementsByTagName('script')[0]; entry

Restructuring TypeScript internal modules to external modules

梦想与她 提交于 2019-12-06 04:07:17
I have a website that uses a large typescript code base. All clases as in their own files, and wrapped with an internal module like so: file BaseClass.ts module my.module { export class BaseClass { } } file ChildClass.ts module my.module { export ChildClass extends my.module.BaseClass { } } All file are included globally with script tags, in the appropriate order (using ASP.NET Bundling). I would like to move to a more modern setup and use webpack. I would like my module syntax to use whatever the new ECMASCRIPT module standard is. But there is much code using the existing "module namespaces"

Sharing TypeScript classes between client and server

只愿长相守 提交于 2019-12-06 03:55:23
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/issues/5094 , Setup a Typescript project with classes shared between client and server apps? , Share

How can I import TypeScript AMD modules without making the dependent code a module

时光毁灭记忆、已成空白 提交于 2019-12-06 01:39:15
I have a Chrome extension content script that has 2 AMD dependencies. The script works fine when I load the dependencies using the requirejs "require" function. I ported the script to TypeScript with the rest of my project, and am now using import Dependency = require("Dependency"); which is all fine and dandy, the modules have been ported to TS and are working fine in other parts of the project. My issue is that as soon as I add an import statement, the TS compiler wants to make my script into a module, and in the generated JS it imports the modules using requirejs "define". My chrome

Dojo1.6新特性:AMD规范

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 00:57:55
1. AMD的由来 前端技术虽然在不断发展之中,却一直没有质的飞跃。除了已有的各大著名框架,比如Dojo,JQuery,ExtJs等等,很多公司也都有着自己的 前端开发框架。这些框架的使用效率以及开发质量在很大程度上都取决于开发者对其的熟悉程度,以及对JavaScript的熟悉程度,这也是为什么很多公司 的技术带头人都喜欢开发一个自己的框架。开发一个自己会用的框架并不难,但开发一个大家都喜欢的框架却很难。从一个框架迁移到一个新的框架,开发者很有可 能还会按照原有框架的思维去思考和解决问题。这其中的一个重要原因就是JavaScript本身的灵活性:框架没办法绝对的约束你的行为,一件事情总可以 用多种途径去实现,所以我们只能在方法学上去引导正确的实施方法。庆幸的是,在这个层面上的软件方法学研究,一直有人在去不断的尝试和改 进,CommonJS就是其中的一个重要组织。他们提出了许多新的JavaScript架构方案和标准,希望能为前端开发提供银蛋,提供统一的指引。 AMD规范 就 是其中比较著名一个,全称是Asynchronous Module Definition,即异步模块加载机制。从它的规范描述页面看,AMD很短也很简单,但它却完整描述了模块的定义,依赖关系,引用关系以及加载机制。 从它被requireJS,NodeJs,Dojo,JQuery使用也可以看出它具有很大的价值,没错

AMD perf events

a 夏天 提交于 2019-12-06 00:32:37
I am trying to use perf on my device with an AMD cpu, but I can't really find any information about how to get, let's say, cache-misses from AMD. I read that you need to write -e rNNN , where NNN is a hex-code of event, but I didn't manage to find any table or something to look at those codes. Could you help me with this, because it seems that there is no information in the internet at all! Actually, in the manual for perf there are some links, but they are not valid :( Check perf list output, in modern Linux kernel versions it may report some architecture-specific hardware events. Some