├── .gitignore ├── README.md ├── bin └── export ├── glossary ├── ADAPTER_PATTERN.md ├── AJAX.md ├── AMD.md ├── ANGULARJS.md ├── APACHECORDOVA.md ├── ARITY.md ├── BABEL.md ├── BACKBONE.md ├── BLUEBIRD.md ├── BOWER.md ├── BROCCOLI.md ├── BROWSERIFY.md ├── BRUNCH.md ├── BUILDER_PATTERN.md ├── CANVAS.md ├── CHAI.md ├── CLOSURE.md ├── COFFEESCRIPT.md ├── COMMAND_PATTERN.md ├── COMMONJS.md ├── COMPOSITE_PATTERN.md ├── CONSTRUCTOR_PATTERN.md ├── CORS.md ├── COUCHDB.md ├── CURRYING.md ├── D3JS.md ├── DECORATOR_PATTERN.md ├── DESIGN_PATTERNS.md ├── DOM.md ├── ECMASCRIPT.md ├── EMBER.md ├── ESLINT.md ├── EXPRESS.md ├── EXTJS.md ├── FACADE_PATTERN.md ├── FACTORY_PATTERN.md ├── FALCOR.md ├── FLUX.md ├── FLYWEIGHT_PATTERN.md ├── FOUR.md ├── GRUNT.md ├── GULP.md ├── HAPI.md ├── HOISTING.md ├── IIFE.md ├── ISOMORPHIC.md ├── ITERATOR_PATTERN.md ├── JASMINE.md ├── JQUERY.md ├── JQUERY_UI.md ├── JSCS.md ├── JSHINT.md ├── JSLINT.md ├── JSON-LD.md ├── JSON.md ├── JSONP.md ├── JSX.md ├── KNOCKOUT.md ├── LAZY_INITIALIZATION_PATTERN.md ├── LOCALFORAGE.md ├── LODASH.md ├── MEAN.md ├── MEDIATOR_PATTERN.md ├── MEMOIZE.md ├── METALSMITH.md ├── METEOR.md ├── MIXIN_PATTERN.md ├── MOCHA.md ├── MODERNIZR.md ├── MODULE_PATTERN.md ├── MOMENTJS.md ├── MONGODB.md ├── MOOTOOLS.md ├── NIGHTMARE.md ├── NIGHTWATCHJS.md ├── NODEJS.md ├── NPM.md ├── NVM.md ├── OBSERVER_PATTERN.md ├── PARTIAL_APPLICATION.md ├── PHANTOMJS.md ├── POLYMER.md ├── PROMISE.md ├── PROTOTYPE.md ├── PROTOTYPEJS.md ├── PROTOTYPE_PATTERN.md ├── PROXY_PATTERN.md ├── Q.md ├── QUNIT.md ├── RAMDA.md ├── REACT.md ├── REDUX.md ├── REQUIREJS.md ├── REVEALING_MODULE_PATTERN.md ├── REVEALING_PROTOTYPE_PATTERN.md ├── RXJS.md ├── SAILS.md ├── SINGLETON_PATTERN.md ├── THREEJS.md ├── TYPESCRIPT.md ├── UMD.md ├── UNDERSCORE.md ├── UNIVERSAL.md ├── V8.md ├── VANILLA.md ├── VIRTUAL_DOM.md ├── VUEJS.md ├── WEBGL.md ├── WEBPACK.md ├── XHR.md ├── XML.md ├── YEOMAN.md └── ZEPTO.md ├── images └── logo.png └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | data.json 3 | node_modules 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |  2 | 3 | *Упрощённый JavaScript-жаргон* (англ. *Simplified JavaScript Jargon*, сокр. *SJSJ*) — это курируемая сообществом попытка объяснить простыми словами множество сложных терминов, используемых в текущей экосистеме JavaScript. Идея заключается не в замене документации, а в создании своеобразного словаря, на который можно легко ссылаться. 4 | 5 | Этот репозиторий — перевод [оригинального словаря](https://github.com/HugoGiraudel/SJSJ). Если вы хотите принять участие в переводе, не стесняйтесь сделать пулл-реквест. Спасибо! 6 | 7 | ## Связанные проекты 8 | 9 | * [Инструмент для чтения](https://github.com/hanksudo/SJSJ-cli) SJSJ в командной строке; 10 | * [Расширение для Chrome](https://github.com/ismnoiet/JSJargon) от [ismnoiet](https://github.com/ismnoiet); 11 | * [Скрипт](#exportjson) для экспорта всех терминов в JSON. 12 | 13 | ## Словарь 14 | 15 | [A](#a) · 16 | [B](#b) · 17 | [C](#c) · 18 | [D](#d) · 19 | [E](#e) · 20 | [F](#f) · 21 | [G](#g) · 22 | [H](#h) · 23 | [I](#i) · 24 | [J](#j) · 25 | [K](#k) · 26 | [L](#l) · 27 | [M](#m) · 28 | [N](#n) · 29 | [O](#o) · 30 | [P](#p) · 31 | [Q](#q) · 32 | [R](#r) · 33 | [S](#s) · 34 | [T](#t) · 35 | [U](#u) · 36 | [V](#v) · 37 | [W](#w) · 38 | [X](#x) · 39 | [Y](#y) · 40 | [Z](#z) · 41 | [Паттерны проектирования](#patterns) 42 | 43 | ### A 44 | 45 | * [AJAX](/glossary/AJAX.md) (*ая́кс*, от англ. *Asynchronous Javascript and XML* — «асинхронный JavaScript и XML»): технология для совершения асинхронных HTTP-запросов. 46 | * [AMD](/glossary/AMD.md) (от англ. *Asynchronous Module Definition* — «асинхронное определение модуля»): стандарт, описывающий асинхронную загрузку JavaScript-библиотек или модулей. 47 | * [AngularJS](/glossary/ANGULARJS.md): фреймворк для разработки динамических веб-приложений. 48 | * [Apache Cordova](/glossary/APACHECORDOVA.md) (formerly **PhoneGap**): a popular mobile application development framework originally created by Nitobi. 49 | * [Arity](/glossary/ARITY.md): the number of arguments of a function. 50 | 51 | ### B 52 | 53 | * [Babel](/glossary/BABEL.md): инструментарий для трансформации JavaScript-кода, изначально был транспилером кода ECMAScript 2015 / ES6. 54 | * [Backbone](/glossary/BACKBONE.md): фреймворк для разработки динамических веб-приложений. 55 | * [Bluebird](/glossary/BLUEBIRD.md): полнофункциональная библиотека для работы с [промисами](/glossary/PROMISE.md) с фокусом на современных возможностях и производительности. 56 | * [Bower](/glossary/BOWER.md): менеджер пакетов для фронтенд-зависимостей. 57 | * [Broccoli](/glossary/BROCCOLI.md): быстрый и надёжный файлопровод (англ. *asset pipeline*). 58 | * [Browserify](/glossary/BROWSERIFY.md): инструмент, делающий возможным использование в браузере функции `require` из Node.js. 59 | * [Brunch](/glossary/BRUNCH.md): инструмент для производства готовых к деплою файлов из исходного кода проекта. 60 | 61 | ### C 62 | 63 | * [Canvas](/glossary/CANVAS.md): HTML-элемент для создания двумерных и трёхмерных графических приложений. 64 | * [Chai](/glossary/CHAI.md): assertion-библиотека, обычно используемая вместе с фреймворками для тестирования. 65 | * [Closure](/glossary/CLOSURE.md) (рус. *замыкание*): функция, вложенная в другие функции и имеющая доступ к переменным из внешних функций; при этом все её внутренние переменные скрыты для внешних функций. 66 | * [CoffeeScript](/glossary/COFFEESCRIPT.md): метаязык, компилируемый в JavaScript. 67 | * [CommonJS](/glossary/COMMONJS.md): a project with the goal of specifying an ecosystem for JavaScript outside the browser (for example, on the server or for native desktop applications). 68 | * [CORS](/glossary/CORS.md) (от англ. *Cross-origin resource sharing* — «кроссдоменной обмен ресурсами»): технология, позволяющая предоставлять веб-странице доступ к ресурсам другого домена. 69 | * [CouchDB](/glossary/COUCHDB.md): NoSQL база данных, использующая JavaScript как язык запросов и HTTP как API. 70 | * [Currying](/glossary/CURRYING.md) (рус. *каррирование*, *карринг*): процесс преобразования функции с несколькими аргументами в цепочку функций с одним аргументом. 71 | 72 | ### D 73 | 74 | * [D3.js](/glossary/D3JS.md): библиотека для обработки и визуализации данных. 75 | * [Design Patterns](/glossary/DESIGN_PATTERNS.md): a general reusable solution to a commonly occurring problem within a given context in software design. 76 | * [DOM](/glossary/DOM.md) (от англ. *Document Object Model* — «объектная модель документа»): не зависящий от платформы и языка программирования интерфейс, который позволяет программам и скриптам динамически получать доступ к документу и обновлять его содержимое, структуру и стили. 77 | 78 | ### E 79 | 80 | * [ECMAScript](/glossary/ECMASCRIPT.md): стандартизованная спецификация скриптового языка, используемая в JavaScript. 81 | * [Ember](/glossary/EMBER.md): an application framework based on the model-view-controller pattern. 82 | * [ESLint](/glossary/ESLINT.md): анализатор JavaScript-кода. 83 | * [Express](/glossary/EXPRESS.md): быстрый минималистичный фреймворк для разработки веб-приложений на Node.js. 84 | * [Ext JS](/glossary/EXTJS.md): a pure JavaScript application framework for building interactive cross platform web applications. 85 | 86 | ### F 87 | 88 | * [Falcor](/glossary/FALCOR.md): a JavaScript library for efficient data fetching. 89 | * [Flux](/glossary/FLUX.md): структура приложения с фокусом на улучшенном потоке данных. 90 | * [Four](/glossary/FOUR.md): a framework to develop 3D content for the web. 91 | 92 | ### G 93 | 94 | * [Grunt](/glossary/GRUNT.md): таск-менеджер, автоматизирующий рутинные и, возможно, сложные действия. 95 | * [Gulp](/glossary/GULP.md): таск-менеджер, автоматизирующий рутинные и, возможно, сложные действия. 96 | 97 | ### H 98 | 99 | * [Hapi](/glossary/HAPI.md): a Node.js framework for writing services and more. 100 | * [Hoisting](/glossary/HOISTING.md) (рус. *поднятие*): поднятие JavaScript-интерпретатором объявлений функций и переменных в верх их области видимости. 101 | 102 | ### I 103 | 104 | * [IIFE](/glossary/IIFE.md) (от англ. *Immediately-Invoked Function Expression* — «немедленно вызываемая функция»): функция, вызываемая сразу же после своего описания. 105 | * [Isomorphic](/glossary/ISOMORPHIC.md) (рус. *изоморфный*): приложение, которое может выполняться как на сервере, так и на клиенте. 106 | 107 | ### J 108 | 109 | * [Jasmine](/glossary/JASMINE.md): a testing framework for BDD (Behaviour-Driven Development). 110 | * [jQuery](/glossary/JQUERY.md): библиотека для работы с DOM и AJAX. 111 | * [jQuery UI](/glossary/JQUERY_UI.md): официальная библиотека jQuery для создания пользовательских интерфейсов. 112 | * [JSCS](/glossary/JSCS.md): a JavaScript code linter. 113 | * [JSHint](/glossary/JSHINT.md): a JavaScript code linter. 114 | * [JSLint](/glossary/JSLINT.md): a JavaScript code linter. 115 | * [JSON](/glossary/JSON.md) (от англ. *JavaScript Object Notation* — «объектное представление Javascript»): легковесный формат обмена данными. 116 | * [JSONP](/glossary/JSONP.md) (англ. *JSON Padding* — «JSON с подкладкой»): *to be completed.* 117 | * [JSON-LD](/glossary/JSON-LD.md) (англ. *JSON for Linked Data* — «JSON для связанных данных»): *to be completed.* 118 | * [JSX](/glossary/JSX.md): расширение языка для использования XML-подобного синтаксиса в JavaScript. 119 | 120 | ### K 121 | 122 | * [Knockout](/glossary/KNOCKOUT.md): a library that helps developers creating user interfaces with a clean underlying data model. 123 | 124 | ### L 125 | 126 | * [LocalForage](/glossary/LOCALFORAGE.md): a fast and simple storage library for JavaScript. 127 | * [LoDash](/glossary/LODASH.md): библиотека, предоставляющая набор утилит для работы с объектами, массивами и функциями. 128 | 129 | ### M 130 | 131 | * [Memoize](/glossary/MEMOIZE.md): an optimization used to speed up consecutive function calls by caching the result of calls with identical input. 132 | * [Meteor](/glossary/METEOR.md): JavaScript веб-фреймворк позволяющий вести быструю прототипную веб-разработку. 133 | * [Mocha](/glossary/MOCHA.md) (рус. *мо́ка*): расширяемый BDD/TDD фреймворк для тестирования 134 | * [Modernizr](/glossary/MODERNIZR.md): a browser feature detection library, useful to modify page styles when a feature is not available in the browser. 135 | * [Moment.js](/glossary/MOMENTJS.md): библиотека для работы с датами и временем в JavaScript. 136 | * [MongoDB](/glossary/MONGODB.md): документо-ориентированная база данных NoSQL, использующая JavaScript как язык запросов. 137 | * [Mootools](/glossary/MOOTOOLS.md): a collection of JavaScript utilities designed for the intermediate to advanced JavaScript developer. It allows you to write powerful and flexible code with its elegant, well documented, and coherent APIs. 138 | * [Metalsmith](/glossary/METALSMITH.md): простой модульный генератор статических сайтов. 139 | * [MEAN](/glossary/MEAN.md): технологический стек (набор ПО), используемый преимущественно для разработки веб-сервисов. Название образовано от первых букв инструментов, которые в него входят (**M**ongoDB, **E**xpress.js, **A**ngular.js, **N**ode.js). 140 | 141 | ### N 142 | 143 | * [Nightmare](/glossary/NIGHTMARE.md): a high-level browser automation library. 144 | * [NightwatchJS](/glossary/NIGHTWATCHJS): a framework for browser automated testing. 145 | * [Node.js](/glossary/NODEJS.md): кросcплатформенная среда выполнения на движке V8, предназначенная для разработки серверных приложений. 146 | * [npm](/glossary/NPM.md) (от англ. *node.js package manager* — «менеджер пакетов Node.js»): инструмент для публикации и установки пакетов через npm-репозитории. 147 | * [nvm](/glossary/NVM.md) (от англ. *node.js version manager* — «менеджер версий Node.js»): инструмент для запуска разных версий Node.js на одном и том же компьютере. 148 | 149 | ### P 150 | 151 | * [Partial Application](/glossary/PARTIAL_APPLICATION.md): *to be completed.* 152 | * [PhantomJS](/glossary/PHANTOMJS.md): a scripted, headless browser used for automating web page interaction. 153 | * [Polymer](/glossary/POLYMER.md): библиотека от Google для создания веб-компонентов. 154 | * [Promise](/glossary/PROMISE.md): специальный объект для работы с результатами выполнения асинхронного кода, получаемыми в неизвестный момент времени. 155 | * [Prototype (ООП)](/glossary/PROTOTYPE.md): *to be completed.* 156 | * [Prototype.js](/glossary/PROTOTYPEJS.md): a JavaScript framework that aims to ease development of dynamic web applications. It offers a familiar class-style OO framework, extensive Ajax support, higher-order programming constructs, and easy DOM manipulation. 157 | 158 | ### Q 159 | 160 | * [QUnit](/glossary/QUNIT.md): a powerful, easy-to-use JavaScript unit testing framework. 161 | * [Q](/glossary/Q.md): библиотека для работы с [промисами](/glossary/PROMISE.md). 162 | 163 | ### R 164 | 165 | * [Ramda](/glossary/RAMDA.md): a practical functional library for Javascript programmers. 166 | * [React](/glossary/REACT.md): библиотека для создания пользовательских интерфейсов, разработанная и используемая в Facebook. 167 | * [Redux](/glossary/REDUX.md): a predictable state container for apps. 168 | * [RxJS](/glossary/RXJS.md): a library for asynchronous programming using observable streams. 169 | * [Require.js](/glossary/REQUIREJS.md): a browser based module loader using AMD. 170 | 171 | ### S 172 | 173 | * [Sails](/glossary/SAILS.md): Node.js MVC-фреймворк для создания приложений, работающих в режиме реального времени. 174 | 175 | ### T 176 | 177 | * [Three.js](/glossary/THREEJS.md): небольшая библиотека для создания и отображения анимированой 3D-графики в браузере. 178 | * [TypeScript](/glossary/TYPESCRIPT.md): надмножество языка JavaScript, добавляющее поддержку использования классов, статического назначения типов. 179 | 180 | ### U 181 | 182 | * [UMD](/glossary/UMD.md) (от англ. *Universal Module Definition*): паттерн универсального объявления модулей для JavaScript. 183 | * [Underscore](/glossary/UNDERSCORE.md): библиотека, предоставляющая набор утилит для работы с объектами, массивами и функциями. 184 | * [Universal](/glossary/UNIVERSAL.md) (рус. *универсальный*): приложение, которое может выполняться как на сервере, так и на клиенте. 185 | 186 | ### V 187 | 188 | * [V8](/glossary/V8.md): движок JavaScript с открытым исходным кодом, разрабатываемый Google. Это тот движок, который работает в Chrome, но он также используется для других проектов вроде Node.js и MongoDB. 189 | * [Vanilla](/glossary/VANILLA.md): название для чистого JavaScript, без использования библиотек/фреймворков. 190 | * [Virtual DOM](/glossary/VIRTUAL_DOM.md) (рус. *виртуальная DOM*): копия DOM, с которой разработчик производит необходимые ему манипуляции. Хранится в оперативной памяти, за счёт чего манипуляции производятся быстрее, чем при прямом обращении к DOM. 191 | * [VueJS](/glossary/VUEJS.md): библиотека для разработки интерфейсов, основанная на моделях данных. 192 | 193 | ### W 194 | 195 | * [WebGL](/glossary/WEBGL.md) (от англ. *Web Graphics Library* — «графическая библиотека для Web»): JavaScript API для отрисовки интерактивной 3D и 2D графики, работающий в современных браузерах. 196 | * [Webpack](/glossary/WEBPACK.md): менеджер зависимостей с дружественным и быстрым окружением для разработки, упрощающий множество распространённых задач. 197 | 198 | ### X 199 | 200 | * [XML](/glossary/XML.md) (от англ. _e**X**tensible **M**arkup **L**anguage_ — «расширяемый язык разметки»): *to be completed.* 201 | * [XMLHttpRequest](/glossary/XHR.md): API, который предоставляет возможность обмениваться данными между клиентом и сервером. 202 | 203 | ### Y 204 | 205 | * [Yeoman](/glossary/YEOMAN.md): инструмент для автоматизации генерации шаблонных частей проекта. 206 | 207 | ### Z 208 | 209 | * [Zepto](/glossary/ZEPTO.md): легковесный клон jQuery, не содержащий дополнительного кода для обеспечения браузерной совместимости. 210 | 211 | ### Паттерны проектирования 212 | 213 | * [Adapter Pattern](/glossary/ADAPTER_PATTERN.md "Паттерн "Адаптер""): *to be completed.* 214 | * [Builder Pattern](/glossary/BUILDER_PATTERN.md "Паттерн "Строитель""): *to be completed.* 215 | * [Command Pattern](/glossary/COMMAND_PATTERN.md "Паттерн "Команда""): *to be completed.* 216 | * [Composite Pattern](/glossary/COMPOSITE_PATTERN.md "Паттерн "Компоновщик""): *to be completed.* 217 | * [Constructor Pattern](/glossary/CONSTRUCTOR_PATTERN.md "Паттерн "Конструктор""): *to be completed.* 218 | * [Decorator Pattern](/glossary/DECORATOR_PATTERN.md "Паттерн "Декоратор""): *to be completed.* 219 | * [Facade Pattern](/glossary/FACADE_PATTERN.md "Паттерн "Фасад""): a software design pattern commonly used with object-oriented programming. The name is by analogy to an architectural facade. 220 | * [Factory Pattern](/glossary/FACTORY_PATTERN.md "Паттерн "Фабрика""): a creational pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created. 221 | * [Flyweight Pattern](/glossary/FLYWEIGHT_PATTERN.md "Паттерн "Приспособленец""): *to be completed.* 222 | * [Iterator Pattern](/glossary/ITERATOR_PATTERN.md "Паттерн "Итератор""): *to be completed.* 223 | * [Lazy Initialization Pattern](/glossary/LAZY_INITIALIZATION_PATTERN.md "Паттерн "Ленивая инициализация""): *to be completed.* 224 | * [Mediator Pattern](/glossary/MEDIATOR_PATTERN.md "Паттерн "Медиатор", он же "Приспособленец""): an object that encapsulates how a set of objects interact. 225 | * [Mixin Pattern](/glossary/MIXIN_PATTERN.md "Паттерн "Примесь""): *to be completed.* 226 | * [Module Pattern](/glossary/MODULE_PATTERN.md "Паттерн "Модуль""): a design pattern used to implement the concept of software modules, defined by modular programming, in a programming language with incomplete direct support for the concept. 227 | * [Observer Pattern](/glossary/OBSERVER_PATTERN.md "Паттерн "Наблюдатель""): a software design pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods. 228 | * [Prototype Pattern](/glossary/PROTOTYPE_PATTERN.md "Паттерн "Прототип""): a creational design pattern in software development. It is used when the type of objects to create is determined by a prototypical instance, which is cloned to produce new objects. 229 | * [Proxy Pattern](/glossary/PROXY_PATTERN.md "Паттерн "Прокси""): *to be completed.* 230 | * [Revealing Module Pattern](/glossary/REVEALING_MODULE_PATTERN.md "Паттерн "Открытый модуль""): a design pattern conceptually based on the [Module Pattern](/glossary/MODULE_PATTERN.md). The only difference is that the *revealing module pattern* was engineered as a way to ensure that all methods and variables are kept private until they are explicitly exposed. 231 | * [Revealing Prototype Pattern](/glossary/REVEALING_PROTOTYPE_PATTERN.md "Паттерн "Открытый прототип""): *to be completed.* 232 | * [Singleton Pattern](/glossary/SINGLETON_PATTERN.md "Паттерн "Синглтон", он же "Одиночка""): a design pattern that restricts the instantiation of a class to one object. 233 | 234 | ## Экспорт терминов в JSON 235 | 236 | Этот репозиторий содержит небольшой Node.js-скрипт, экспортирующий все термины в JSON. Для использования скрипта клонируйте репозиторий и выполните следующие команды: 237 | 238 | ```sh 239 | npm install 240 | npm run export -- data.json 241 | ``` -------------------------------------------------------------------------------- /bin/export: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | 'use strict'; 4 | 5 | const fs = require('fs-promise') 6 | const path = require('path') 7 | const marked = require('marked') 8 | 9 | const GLOSSARY_FOLDER = path.join(process.cwd(), 'glossary') 10 | const DESTINATION_FILE = process.argv[2] || 'data.json' 11 | 12 | const parse = content => ({ 13 | name: content.match(/^#\s*(.+)$|^/m)[1], 14 | markdown: content.match(/^.*\n+([\s\S]+)|^/)[1] 15 | }) 16 | 17 | const collect = file => fs.readFile(path.join(GLOSSARY_FOLDER, file), 'utf8') 18 | .then(parse) 19 | .then(obj => Object.assign(obj, { 20 | html: marked(obj.markdown || ''), 21 | url: `https://github.com/HugoGiraudel/SJSJ/blob/master/glossary/${file}` 22 | })) 23 | 24 | fs.readdir(GLOSSARY_FOLDER) 25 | .then(files => Promise.all(files.map(collect))) 26 | .then(entries => JSON.stringify(entries, null, 2)) 27 | .then(data => fs.writeFile(DESTINATION_FILE, data)) 28 | .then(() => console.log(`${DESTINATION_FILE} successfully generated.`)) 29 | .catch(error => { throw error }) 30 | -------------------------------------------------------------------------------- /glossary/ADAPTER_PATTERN.md: -------------------------------------------------------------------------------- 1 | # Adapter pattern 2 | 3 | [Adapter pattern](#) section to be completed. 4 | -------------------------------------------------------------------------------- /glossary/AJAX.md: -------------------------------------------------------------------------------- 1 | # AJAX 2 | 3 | [AJAX (Asynchronous JavaScript and XML)](https://developer.mozilla.org/en-US/docs/AJAX) — это техника для создания интерактивных сайтов с асинхронным обменом данными между клиентом и сервером. AJAX облегчает коммуникацию с сервером путём динамического обновления нужной части страницы вместо традиционной полной перезагрузки страницы. -------------------------------------------------------------------------------- /glossary/AMD.md: -------------------------------------------------------------------------------- 1 | # AMD 2 | 3 | [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) расшифровывается как *Asynchronous Module Definition, определение асинхронного модуля*. Этот стандарт — альтернатива спецификации Common JS (CJS). 4 | 5 | API описывает механизм для определения таких модулей, что и сам модуль, и его зависимости загружаются асинхронно. Это особенно хорошо подходит для браузерной среды, где синхронная по умолчанию загрузка модулей вызывает проблемы с производительностью, юзабилити, отладкой и кроссдоменным доступом. 6 | 7 | AMD-библиотеки предоставляют глобальную функцию `define` для определения модуля 8 | 9 | 10 | ```js 11 | define(modulename?,[dependencyA?, dependencyB?, ...], function (objectA, objectB, ...) { 12 | ... 13 | var myExportedObj = function() {...} 14 | return myExportedObj; 15 | 16 | }); 17 | ``` 18 | 19 | Где 20 | 21 | - `modulename` это необязательный строковый параметр, явно задающий идентификатор определяемого модуля 22 | - `dependencyA`, `dependencyB` и так далее — зависимости определяемого модуля 23 | - `function(objectA, objectB) {...}` — функция-фабрика, аргументами которой являются экспортированные объекты каждой из зависимостей 24 | - `myExportedObj` — необязательное возвращаемое значение (модуль ведь может просто добавлять методы к существующему объекту и ничего не возвращать). Если какое-либо значение возвращается, то оно становится экспортируемым объектом своего модуля, и именно его получат другие модули, если укажут `modulename` в списке своих зависимостей. 25 | 26 | Помимо глобальной функции `define` AMD-совместимая библиотека должна иметь свойство `define.amd`, значение которого — объект. Проверка `define` и `define.amd` на существование в глобальной области видимости позволяет любому скрипту определить, что он вызывается AMD-загрузчиком. 27 | 28 | Примеры библиотек, реализующих загрузку AMD-модулей: 29 | 30 | - [Require JS](http://requirejs.org/docs/whyamd.html), написана [Джеймсом Бёрком](https://github.com/jrburke/) из Mozilla. Одна из первых библиотек, получивших широкое распространение, и всё ещё одна из самых популярных. Предоставляет ограниченную совместимость с CommonJS-модулями. 31 | - [CurlJS](https://github.com/cujojs/curl), часть фреймворка [CujoJS](http://cujojs.com/). CurlJS менее популярна, чем RequireJS. С 2014 года её поддерживают в рабочем состоянии, но не добавляют никаких новых возможностей. 32 | - [Alameda](https://github.com/requirejs/alameda), также написанная Джеймсом Бёрком. Похожа на RequireJS, но использует [промисы](/glossary/PROMISE.md) для работы с результирующими событиями. 33 | - [Cajon](https://github.com/requirejs/cajon) также написанная Джеймсом Бёрком. Можно считать её декоратором для RequireJS, заменяющим метод `load` для загрузки зависимостей через Ajax. 34 | - [SystemJS](https://github.com/systemjs/systemjs), написана [Гаем Бедфордом](https://github.com/guybedford), который несколько лет назад был одним из наиболее активных разработчиков плагинов для RequireJS. SystemJS может загружать модули AMD, CommonJS и ES6. Часто используется в связке с [jspm](http://jspm.io/) — менеджером зависимостей (наподобие [Bower](Bower.md)), подгружаемых с Github и NPM. 35 | 36 | Все эти библиотеки позволяют разработчику запустить проект без сборки, подгружая все зависимости асинхронно. Однако, собирать или упаковывать все модули в один файл для «боевого» окружения всё же рекомендуется — это уменьшит вес кода и количество запросов к серверу, а значит увеличит скорость загрузки страницы. Говорят, что поддержка браузерами и серверами стандарта [HTTP2](https://http2.github.io/) устранит необходимость совершения дополнительных запросов при асинхронной подгрузке зависимостей, так что и потребность в сборке проекта тоже будет устранена. 37 | 38 | Пример других библиотек, которые не могут загружать зависимости асинхронно, но могут включать AMD-модули в свой процесс сборки: 39 | 40 | - [Webpack](WEBPACK.md) 41 | - [Rollup](http://rollupjs.org/) 42 | - [StealJS](http://stealjs.com/) 43 | -------------------------------------------------------------------------------- /glossary/ANGULARJS.md: -------------------------------------------------------------------------------- 1 | # AngularJS 2 | 3 | [AngularJS](https://angularjs.org/) — это фреймворк для разработки динамических веб-приложений. Он позволяет разработчикам расширять синтаксис HTML, а также использовать HTML как шаблонизатор, благодаря чему компоненты приложения описываются ясно и лаконично. 4 | 5 | Связывание данных и инъекция зависимостей сильно уменьшает количество кода, который разработчикам пришлось бы написать, если бы реализации этих вещей не было в Angular. И всё это работает в браузере, так что Angular можно легко использовать с любой серверной технологией. -------------------------------------------------------------------------------- /glossary/APACHECORDOVA.md: -------------------------------------------------------------------------------- 1 | # PhoneGap 2 | 3 | [Apache Cordova](http://phonegap.com/) (formerly **PhoneGap**) is a popular mobile application development framework originally created by Nitobi. Adobe Systems purchased Nitobi in 2011, rebranded it as PhoneGap, and later released an open source version of the software called Apache Cordova. Apache Cordova enables software programmers to build applications for mobile devices using JavaScript, HTML5, and CSS3, instead of relying on platform-specific APIs like those in Android, iOS, or Windows Phone. It enables wrapping up of CSS, HTML, and JavaScript code depending upon the platform of the device. It extends the features of HTML and JavaScript to work with the device. The resulting applications are hybrid, meaning that they are neither truly native mobile application (because all layout rendering is done via Web views instead of the platform's native UI framework) nor purely Web-based (because they are not just Web apps, but are packaged as apps for distribution and have access to native device APIs). Mixing native and hybrid code snippets has been possible since version 1.9. 4 | 5 | The software was previously called just "PhoneGap", then "Apache Callback". As open-source software, Apache Cordova allows wrappers around it, such as Intel XDK or Appery.io. 6 | 7 | PhoneGap is Adobe’s productized version and ecosystem on top of Cordova. Like PhoneGap, many other tools and frameworks are also built on top of Cordova, including Ionic, the Intel XDK, Monaca, TACO, and the Telerik Platform. These tools use Cordova, and not PhoneGap for their core tools. 8 | 9 | Contributors to the Apache Cordova project include Adobe, IBM, Google, Microsoft, Intel, BlackBerry, Mozilla, and others. 10 | 11 | ## History 12 | 13 | First developed at an iPhoneDevCamp event in San Francisco, PhoneGap went on to win the People's Choice Award at O'Reilly Media's 2009 Web 2.0 Conference, and the framework has been used to develop many apps. Apple Inc. has confirmed that the framework has its approval, even with the new 4.0 developer license agreement changes. The PhoneGap framework is used by several mobile application platforms such as Asial's Monaca, ViziApps, Worklight, Convertigo, and appMobi as the backbone of their mobile client development engine. 14 | 15 | Adobe officially announced the acquisition of Nitobi Software (the original developer) on October 4, 2011. Coincident with that, the PhoneGap code was contributed to the Apache Software Foundation to start a new project called Apache Cordova. The project's original name, Apache Callback, was viewed as too generic. Then it also appears in Adobe Systems as Adobe PhoneGap and also as Adobe Phonegap Build. 16 | 17 | Early versions of PhoneGap required an Apple computer to create iOS apps and a Windows computer to create Windows Mobile apps. After September 2012, Adobe's PhoneGap Build service allows programmers to upload HTML, CSS, and JavaScript source code to a "cloud compiler" that generates apps for every supported platform. 18 | 19 | ## Design and rationale 20 | 21 | The core of Apache Cordova applications use HTML5 and CSS3 for their rendering and JavaScript for their logic. HTML5 now provides access to underlying hardware such as the accelerometer, camera, and GPS. However, browser support for HTML5-based device access is not consistent across mobile browsers, particularly older versions of Android. To overcome these limitations, Apache Cordova embeds HTML5 code inside a native WebView on the device, using a foreign function interface to access the native resources of the device. 22 | 23 | Apache Cordova can be extended with native plug-ins that allow for developers to add functionality that can be called from JavaScript, allowing for direct communication between the native layer and the HTML5 page. Apache Cordova includes basic plugins that allow access to the device's accelerometer, camera, microphone, compass, file system, and more. 24 | 25 | However, the use of Web-based technologies leads some Apache Cordova applications to run slower than native applications with similar functionality. Adobe Systems warns that applications may be rejected by Apple for being too slow or not feeling "native" enough (having appearance and functionality consistent with what users have come to expect on the platform). This can be an issue for some Apache Cordova applications. 26 | 27 | ## Supported platforms 28 | 29 | As of January 2016, Apache Cordova currently supports development for the operating systems Apple iOS, BlackBerry, Google Android, LG webOS, Microsoft Windows Phone (7 and 8), Nokia Symbian OS, Tizen (SDK 2.x), Bada, Firefox OS, and Ubuntu Touch. The table below is a list of supported features for each operating system. 30 | 31 | | Feature | iPhone | Android | Windows Phone | BlackBerry OS | Bada | Symbian | Tizen | 32 | | --- | --- | --- | --- | --- | --- | --- | --- | 33 | | Accelerometer | Yes | Yes | Yes | 5.0+ | Yes | Yes | Yes | 34 | | Camera | Yes | Yes | Yes | 5.0+ | Yes | Yes | Yes | 35 | | Compass | 3GS+ | Yes | Yes | 10+ | Yes | **N/A** | Yes | 36 | | Contacts | Yes | Yes | Yes | 5.0+ | Yes | Yes | Yes | 37 | | File | Yes | Yes | Yes | 5.0+ | Yes | **N/A** | Yes | 38 | | Geolocation | Yes | Yes | Yes | Yes | Yes | Yes | Yes | 39 | | Media | Yes | Yes | Yes | 10+ | **N/A** | **N/A** | Yes | 40 | | Network | Yes | Yes | Yes | Yes | Yes | Yes | Yes | 41 | | Notification | Yes | Yes | Yes | Yes | Yes | Yes | Yes | 42 | | Storage | Yes | Yes | Yes | 5.0+ | **N/A** | Yes | Yes | 43 | 44 | ---------- 45 | 46 | *Source:* 47 | 48 | - [Apache Cordova](https://en.wikipedia.org/wiki/Apache_Cordova)*. From Wikipedia, the free encyclopedia* -------------------------------------------------------------------------------- /glossary/ARITY.md: -------------------------------------------------------------------------------- 1 | # Arity 2 | 3 | Arity (from Latin) is the term used to refer to the number of arguments or operands in a function or operation, respectively. You're most likely to come across this word in the realm of JavaScript when it’s used to mention the number of arguments expected by a JavaScript function. 4 | 5 | There’s even a property named [arity](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/arity), of the `Function` object that returns the number of expected arguments in a function. It’s now obsolete though and replaced by `length`. 6 | 7 | As an example, the following function has an arity of 3. 8 | 9 | ```js 10 | function getName(first, middle, last) { 11 | return first + ' ' + middle + ' ' + last; 12 | } 13 | ``` 14 | 15 | Source: https://gist.github.com/nucliweb/8de961282f64095b1a57. 16 | -------------------------------------------------------------------------------- /glossary/BABEL.md: -------------------------------------------------------------------------------- 1 | # Babel 2 | 3 | [Babel](https://babeljs.io/) (ранее назывался *6to5*) по существу является транспилером кода [ECMAScript](ECMASCRIPT.md) 2015 (ES6). Это значит, что Babel превращает JavaScript будущего в обычный JavaScript, который используется сегодня и понимается всеми браузерами. Идея этого инструмента состоит в том, чтобы разработчики могли использовать новейшие возможности ECMAScript, при этом поддерживая современные (и не очень) браузеры. 4 | 5 | Начиная с [шестой версии](http://babeljs.io/blog/2015/10/29/6.0.0/) Babel стремится стать платформой для создания нового поколения JavaScript-инструментов. Это означает, что Babel может стать единым фундаментом для разработки любых инструментов, будь то минификаторы, линтеры, инструменты для проверки типов, для подсветки синтаксиса, для форматирования кода и для чего угодно ещё. -------------------------------------------------------------------------------- /glossary/BACKBONE.md: -------------------------------------------------------------------------------- 1 | # Backbone 2 | 3 | [Backbone.js](http://backbonejs.org/) это фреймворк для придания структуры вашему веб-приложению. Backbone предоставляет разработчикам модели со связкой данных вида «ключ-значение», пользовательские события, коллекции с богатым API из перечислимых функций, представления с декларативной обработкой событий, и связывает всё это с существующими API через RESTful [JSON](JSON.md)-интерфейс. 4 | -------------------------------------------------------------------------------- /glossary/BLUEBIRD.md: -------------------------------------------------------------------------------- 1 | # Bluebird 2 | 3 | [Bluebird](http://bluebirdjs.com/docs/getting-started.html) — это полнофункциональная библиотека для работы с [промисами](PROMISE.md) с фокусом на современных возможностях и производительности. Это означает, что Bluebird реализует и улучшает поведение JavaScript-промисов. -------------------------------------------------------------------------------- /glossary/BOWER.md: -------------------------------------------------------------------------------- 1 | # Bower 2 | 3 | [Bower](http://bower.io/) — это менеджер пакетов для фронтенд-зависимостей. Он берёт на себя поиск, скачивание и обновление этих зависимостей. Отслеживание всех зависимостей происходит через специальный файл, названный `bower.json`. Bower использует плоскую структуру дерева зависимостей, запрашивая только одну версию каждого пакета, благодаря чему вес страницы уменьшается до минимума. 4 | -------------------------------------------------------------------------------- /glossary/BROCCOLI.md: -------------------------------------------------------------------------------- 1 | # Broccoli 2 | 3 | [Broccoli](https://github.com/broccolijs/broccoli) — это быстрый и надёжный файлопровод (англ. *asset pipeline*), поддерживающий циклически запускаемую сборку и компактные объявления задач. В целом сравним с файлопроводом [Rails](http://rubyonrails.org/), хотя Broccoli работает на [Node.js](NODEJS.md) и не зависит от бэкенда. 4 | -------------------------------------------------------------------------------- /glossary/BROWSERIFY.md: -------------------------------------------------------------------------------- 1 | # Browserify 2 | 3 | [Browserify](http://browserify.org/) — это инструмент, позволяющий использовать функцию [require](https://nodejs.org/api/modules.html) из [Node.js](NODEJS.md) прямо в браузере с помощью сборки всех зависимостей в один файл. 4 | 5 | Идея Browserify состоит в том, чтобы сделать возможным использование библиотек из [npm](NPM.md) даже если вы пишете код для клиента, а не для сервера. Чтобы код работал на стороне клиента, Browserify читает его, запрашивает все зависимости и затем создаёт один файл, содержащий всё вместе — и сами зависимости, и код, использующий их. -------------------------------------------------------------------------------- /glossary/BRUNCH.md: -------------------------------------------------------------------------------- 1 | # Brunch 2 | 3 | [Brunch](http://brunch.io/) — это сборщик проекта. Не обычный таск-раннер, а специализированный инструмент для производства небольшого количества готовых к деплою файлов из множества различных файлов с исходным кодом проекта. 4 | 5 | Brunch специализируется на создании файлов, которые используются в продакшене итоговой средой выполнения (обычно это браузер). Поэтому в набор стандартных возможностей Brunch входит конкатенация, минификация и отслеживание изменений в исходных файлах. -------------------------------------------------------------------------------- /glossary/BUILDER_PATTERN.md: -------------------------------------------------------------------------------- 1 | # Builder pattern 2 | 3 | [Builder pattern](#) section to be completed. 4 | -------------------------------------------------------------------------------- /glossary/CANVAS.md: -------------------------------------------------------------------------------- 1 | # Canvas 2 | 3 | [HTML-элемент Canvas](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas) позволяет разрабатывать сложные графические приложения, в которых нужна быстрая отрисовка и возможность контролирования каждого пикселя. 4 | 5 | Canvas даёт доступ к [WebGL](WEBGL.md) для 3D-графики и к [API для 2D-рисования](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D). 6 | -------------------------------------------------------------------------------- /glossary/CHAI.md: -------------------------------------------------------------------------------- 1 | # Chai 2 | 3 | [Chai](http://chaijs.com/) — это BDD/TDD assertion-библиотека для [Node.js](NODEJS.md) и браузеров. Обычно используется вместе с фреймворками для тестирования, такими как, например, [Mocha](MOCHA.md). 4 | 5 | Одной из особенностей данной библиотеки является возможность писать утверждения (assertions) не только в классической форме: `assert.typeOf(foo, 'string')`, но и в «цепочечной», что позволяет формулировать утверждения в более естественной, удобной и выразительной манере: `expect(foo).to.be.a('string')`. -------------------------------------------------------------------------------- /glossary/CLOSURE.md: -------------------------------------------------------------------------------- 1 | # Closure (замыкание) 2 | 3 | Замыкание — это функция, имеющая доступ ко всем внешним переменным (переменным из родительских областей видимости), при этом создающая собственную область видимости, скрытую для внешнего кода. Иначе говоря, эта функция имеет доступ к значениям переменных из родительских функций, но её внутренние переменные являются для родительских функций приватными. 4 | 5 | Пример: 6 | 7 | ```js 8 | (function (){ 9 | var scopeVar="Hello"; 10 | 11 | (function closure(){ 12 | var closureVar=" World"; 13 | console.log(scopeVar+closureVar); 14 | })() 15 | })(); 16 | ``` 17 | 18 | `scopeVar` доступна во внешней и внутренней функции, но `closureVar` доступна только во внутренней функции. 19 | -------------------------------------------------------------------------------- /glossary/COFFEESCRIPT.md: -------------------------------------------------------------------------------- 1 | # CoffeeScript 2 | 3 | [CoffeeScript](http://coffeescript.org/) — это метаязык (язык второго уровня), компилируемый в JavaScript. Разработан как попытка показать лучшие стороны JS, используя простой и дружественный синтаксис. Весь язык подвергается золотому правилу: «Это просто JavaScript». 4 | 5 | Код полностью компилируется в эквивалентный ему JavaScript, ничего не интерпретируется в момент выполнения. Скомпилированный код легко читается и прекрасно отформатирован. Выполняется в любом JavaScript окружении, иногда даже быстрее, чем тот же код, написанный руками. 6 | -------------------------------------------------------------------------------- /glossary/COMMAND_PATTERN.md: -------------------------------------------------------------------------------- 1 | # Command Pattern 2 | 3 | [Command Pattern](https://addyosmani.com/resources/essentialjsdesignpatterns/book/#commandpatternjavascript) section to be completed. -------------------------------------------------------------------------------- /glossary/COMMONJS.md: -------------------------------------------------------------------------------- 1 | # CommonJS 2 | 3 | **CommonJS** is a project with the goal of specifying an ecosystem for JavaScript outside the browser (for example, on the server or for native desktop applications). 4 | 5 | Server side JavaScript has been around for a long time, and potentially offers some unique and interesting advantages over other languages because the same language is spoken by both client and server. 6 | 7 | Unfortunately, though, server side JavaScript is very fragmented. A script that accesses files can’t be used without modification on both rhino and [V8](V8.md). Spidermonkey and JavaScriptCore can’t both load in additional modules in the same way. A JavaScript web framework is very much tied to its interpreter and is often forced to create a bunch of APIs that Python, Ruby and Java programmers take for granted. 8 | 9 | The goal for this project is to create a standard library that will ultimately allow web developers to choose among any number of web frameworks and tools and run that code on the platform that makes the most sense for their application. 10 | 11 | ## History 12 | 13 | The project was started by Mozilla engineer Kevin Dangoor in January 2009 and initially named **ServerJS**. 14 | 15 | > What I’m describing here is not a technical problem. It’s a matter of people getting together and making a decision to step forward and start building up something bigger and cooler together. 16 | > — Kevin Dangoor 17 | 18 | In August 2009, the project was renamed **CommonJS** to show the broader applicability of the APIs. Specifications are created and approved in an open process. A specification is only considered final after it has been finished by multiple implementations. **CommonJS** is not affiliated with the [ECMA](ECMASCRIPT.md) International group TC39 working on ECMAScript, but some members of TC39 participate in the project. 19 | 20 | In May 2013, Isaac Z. Schlueter, the author of [npm](NPM.md), the package manager for [Node.js](NODEJS.md), said **CommonJS** is being made obsolete by Node.js, and is avoided by the core Node.js developers. 21 | 22 | ## Example usage 23 | 24 | As an example, `foo.js` loads the module `circle.js` in the same directory. 25 | 26 | The contents of `foo.js`: 27 | 28 | ```js 29 | const circle = require('./circle.js'); 30 | console.log( `The area of a circle of radius 4 is ${circle.area(4)}`); 31 | ``` 32 | 33 | The contents of `circle.js`: 34 | 35 | ```js 36 | const PI = Math.PI; 37 | 38 | exports.area = function (r) { 39 | return PI * r * r; 40 | }; 41 | 42 | exports.circumference = function (r) { 43 | return 2 * PI * r; 44 | }; 45 | ``` 46 | 47 | The module `circle.js` has exported the functions `area(..)` and `circumference(..)`. To add functions and objects to the root of your module, you can add them to the special `exports` object. 48 | 49 | Variables local to the module will be private, as though the module was wrapped in a function. In this example the variable `PI` is private to `circle.js`. 50 | 51 | If you want the root of your module’s export to be a function (such as a constructor) or if you want to export a complete object in one assignment instead of building it one property at a time, assign it to `module.exports` instead of `exports`. 52 | 53 | Below, `bar.js` makes use of the square module, which exports a constructor: 54 | 55 | ```js 56 | const square = require('./square.js'); 57 | var mySquare = square(2); 58 | console.log(`The area of my square is ${mySquare.area()}`); 59 | ``` 60 | 61 | The `square` module is defined in `square.js`: 62 | 63 | ```js 64 | // Assigning to exports will not modify module, must use module.exports 65 | module.exports = function (width) { 66 | return { 67 | area: function () { 68 | return (width * width); 69 | } 70 | }; 71 | } 72 | ``` 73 | 74 | The module system is implemented in the `require('module')` module. 75 | 76 | *This section was taken from [Node.js documentation site](https://nodejs.org/docs/latest/api/modules.html).* 77 | -------------------------------------------------------------------------------- /glossary/COMPOSITE_PATTERN.md: -------------------------------------------------------------------------------- 1 | # Composite pattern 2 | 3 | [Composite pattern](#) section to be completed. 4 | -------------------------------------------------------------------------------- /glossary/CONSTRUCTOR_PATTERN.md: -------------------------------------------------------------------------------- 1 | # Constructor Pattern 2 | 3 | [Constructor Pattern](https://addyosmani.com/resources/essentialjsdesignpatterns/book/#constructorpatternjavascript) section to be completed. -------------------------------------------------------------------------------- /glossary/CORS.md: -------------------------------------------------------------------------------- 1 | # CORS 2 | 3 | [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) — это механизм, позволяющий страницам из одного домена получать доступ к ограниченным ресурсам (например, шрифтам) другого домена. 4 | 5 | Вообще, веб-страница позволяет свободно встраивать различный контент, такой как изображения, скрипты, видео, аудио и пр. Тем не менее, [AJAX](AJAX.md)-запросы и веб-шрифты могут делать запросы только из того же источника, что и сама страница, согласно [принципу одинакового источника](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy). 6 | 7 | Чтобы избежать этой проблемы, механизм CORS позволяет серверу отмечать такие ресурсы как доступные из других источников при помощи специального [заголовка](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers) `Access-Control-Allow-Origin`. Иными словами, если сервер разрешает кросс-доменный запрос с домена `http://example.com` – он должен добавить к ответу заголовок `Access-Control-Allow-Origin`, содержащий домен запроса (`http://example.com`) или разрешить все домены (при помощи звёздочки «*»). 8 | 9 | ### Ссылки: 10 | [W3C спецификация CORS](https://www.w3.org/TR/cors/) 11 | [Браузеры, поддерживающие CORS](http://caniuse.com/#feat=cors) 12 | [Инструкция для использования CORS на сервере](http://enable-cors.org/server.html). -------------------------------------------------------------------------------- /glossary/COUCHDB.md: -------------------------------------------------------------------------------- 1 | # CouchDB 2 | 3 | [Apache CouchDB](http://couchdb.apache.org/), часто называемая просто CouchDB — это простая в использовании база данных с открытым исходным кодом. 4 | 5 | CouchDB — это документо-ориентированная NoSQL база данных, использующая [JSON](JSON.md) для хранения данных, JavaScript для обработки запросов (с использованием MapReduce) и HTTP для API. 6 | 7 | Первая версия CouchDB была выпущена в 2005 году. В 2008 году CouchDB стала проектом Apache. 8 | -------------------------------------------------------------------------------- /glossary/CURRYING.md: -------------------------------------------------------------------------------- 1 | # Currying 2 | 3 | Currying (рус. *каррирование*, *карринг*) — это техника преобразования функции с N аргументами в цепочку из N функций, каждая из которых принимает по одному аргументу. 4 | 5 | Это достигается при помощи создания функции с одним аргументом, возвращающей новую функцию, связанную с контекстом внешней через [замыкание](CLOSURE.md). 6 | 7 | ```js 8 | // К примеру мы имеем функцию add, которая принимает два аргумента: 9 | add(3, 5); 10 | 11 | // После каррирования функции add, сигнатура функции будет другая: 12 | curryAdd(3)(5); 13 | ``` 14 | 15 | Данная техника позволяет в частности создавать так называемые [частичные применения](PARTIAL_APPLICATION.md). В частности, для нашей функции: 16 | 17 | ```js 18 | // Создали частичное применение для функции add 19 | 20 | var add3 = curryAdd(3); 21 | var add10 = curryAdd(10); 22 | 23 | // И теперь мы можем переиспользовать функцию 24 | add3(5); // => 8 25 | add3(7); // => 10 26 | add3(17); // => 20 27 | add10(5); // => 15 28 | ``` 29 | 30 | Стоит отметить, что реализацию каррирования можно как описать самому, так и использовать готовые решения, в частности [Lodash](https://lodash.com/docs#curry), [Wu](https://fitzgen.github.io/wu.js/#curryable), [Ramda](http://ramdajs.com/docs/#curry). 31 | -------------------------------------------------------------------------------- /glossary/D3JS.md: -------------------------------------------------------------------------------- 1 | # D3.js 2 | 3 | [D3.js](http://d3js.org/) — это библиотека для обработки и визуализации данных. D3 помогает «оживлять» информацию, используя HTML, SVG и CSS. Опираясь на веб-стандарты, библиотека использует все возможности современных браузеров без привязки к проприетарным фреймворкам, сочетая в себе мощные компоненты для визуализации и data-driven (управляемый данными) подход к манипуляциям с [DOM](DOM.md). 4 | -------------------------------------------------------------------------------- /glossary/DECORATOR_PATTERN.md: -------------------------------------------------------------------------------- 1 | # Decorator Pattern 2 | 3 | [Decorator Pattern](https://addyosmani.com/resources/essentialjsdesignpatterns/book/#decoratorpatternjavascript) section to be completed. -------------------------------------------------------------------------------- /glossary/DESIGN_PATTERNS.md: -------------------------------------------------------------------------------- 1 | # Design Patterns 2 | 3 | In software engineering, a [design pattern](https://en.wikipedia.org/wiki/Software_design_pattern) is a general reusable solution to a commonly occurring problem within a given context in software design. A design pattern is not a finished design that can be transformed directly into source or machine code. It is a description or template for how to solve a problem that can be used in many different situations. Patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system. Object-oriented design patterns typically show relationships and interactions between classes or objects, without specifying the final application classes or objects that are involved. Patterns that imply mutable state may be unsuited for functional programming languages, some patterns can be rendered unnecessary in languages that have built-in support for solving the problem they are trying to solve, and object-oriented patterns are not necessarily suitable for non-object-oriented languages. 4 | 5 | Design patterns may be viewed as a structured approach to computer programming intermediate between the levels of a programming paradigm and a concrete algorithm. 6 | 7 | ## Types 8 | 9 | Design patterns reside in the domain of modules and interconnections. At a higher level there are architectural patterns which are larger in scope, usually describing an overall pattern followed by an entire system. 10 | 11 | There are many types of design patterns, for instance: 12 | 13 | - **Algorithm strategy patterns** addressing concerns related to high-level strategies describing how to exploit application characteristics on a computing platform. 14 | - **Computational design patterns** addressing concerns related to key computation identification. 15 | - **Execution patterns** which address issues related to lower-level support of application execution, including strategies for executing streams of tasks and for the definition of building blocks to support task synchronization. 16 | - **Implementation strategy patterns** addressing concerns related to implementing source code to support 17 | 1. program organization, and 18 | 2. the common data structures specific to parallel programming. 19 | - **Structural design patterns** addressing concerns related to global structures of applications being developed. 20 | 21 | ## History 22 | 23 | Patterns originated as an architectural concept by [Christopher Alexander](https://en.wikipedia.org/wiki/Christopher_Alexander) (1977/79). In 1987, [Kent Beck](https://en.wikipedia.org/wiki/Kent_Beck) and [Ward Cunningham](https://en.wikipedia.org/wiki/Ward_Cunningham) began experimenting with the idea of applying patterns to programming – specifically pattern languages – and presented their results at the [OOPSLA](https://en.wikipedia.org/wiki/OOPSLA) conference that year. In the following years, Beck, Cunningham and others followed up on this work. 24 | 25 | Design patterns gained popularity in computer science after the book [Design Patterns: Elements of Reusable Object-Oriented Software](https://en.wikipedia.org/wiki/Design_Patterns_(book)) was published in 1994 by the so-called "Gang of Four" (Gamma et al.), which is frequently abbreviated as "GoF". That same year, the first Pattern Languages of Programming Conference was held and the following year, the Portland Pattern Repository was set up for documentation of design patterns. The scope of the term remains a matter of dispute. Notable books in the design pattern genre include: 26 | 27 | - [Gamma, Erich](https://en.wikipedia.org/wiki/Erich_Gamma); [Helm, Richard](https://en.wikipedia.org/wiki/Richard_Helm); [Johnson, Ralph](https://en.wikipedia.org/wiki/Ralph_Johnson_(computer_scientist)); [Vlissides, John](https://en.wikipedia.org/wiki/John_Vlissides) (1995). [Design Patterns: Elements of Reusable Object-Oriented Software](https://en.wikipedia.org/wiki/Design_Patterns_(book)). Addison-Wesley. ISBN 0-201-63361-2. 28 | - [Brinch Hansen, Per](https://en.wikipedia.org/wiki/Per_Brinch_Hansen) (1995). *Studies in Computational Science: Parallel Programming Paradigms.* Prentice Hall. ISBN 0-13-439324-4. 29 | - Buschmann, Frank; Meunier, Regine; Rohnert, Hans; Sommerlad, Peter (1996). *Pattern-Oriented Software Architecture, Volume 1: A System of Patterns.* John Wiley & Sons. ISBN 0-471-95869-7. 30 | - [Schmidt, Douglas C.](https://en.wikipedia.org/wiki/Douglas_C._Schmidt); Stal, Michael; Rohnert, Hans; Buschmann, Frank (2000). *Pattern-Oriented Software Architecture, Volume 2: Patterns for Concurrent and Networked Objects.* John Wiley & Sons. ISBN 0-471-60695-2. 31 | - [Fowler, Martin](https://en.wikipedia.org/wiki/Martin_Fowler) (2002). *Patterns of Enterprise Application Architecture.* Addison-Wesley. ISBN 978-0-321-12742-6. 32 | - Hohpe, Gregor; Woolf, Bobby (2003). [Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions.](https://en.wikipedia.org/wiki/Enterprise_Integration_Patterns) Addison-Wesley. ISBN 0-321-20068-3. 33 | - Freeman, Eric T; Robson, Elisabeth; Bates, Bert; [Sierra, Kathy](https://en.wikipedia.org/wiki/Kathy_Sierra) (2004). *Head First Design Patterns.* O'Reilly Media. ISBN 0-596-00712-4. 34 | 35 | Although design patterns have been applied practically for a long time, formalization of the concept of design patterns languished for several years. 36 | 37 | ## Practice 38 | 39 | Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns. 40 | 41 | In order to achieve flexibility, design patterns usually introduce additional levels of indirection, which in some cases may complicate the resulting designs and hurt application performance. 42 | 43 | By definition, a pattern must be programmed anew into each application that uses it. Since some authors see this as a step backward from software reuse as provided by components, researchers have worked to turn patterns into components. Meyer and Arnout were able to provide full or partial componentization of two-thirds of the patterns they attempted. 44 | 45 | Software design techniques are difficult to apply to a broader range of problems. Design patterns provide general solutions, documented in a format that does not require specifics tied to a particular problem. 46 | 47 | ## Classification and list 48 | 49 | Design patterns were originally grouped into the categories: *creational patterns*, *structural patterns*, and *behavioral patterns*, and described using the concepts of delegation, aggregation, and consultation. For further background on object-oriented design, see coupling and cohesion, inheritance, interface, and polymorphism. Another classification has also introduced the notion of architectural design pattern that may be applied at the architecture level of the software such as the Model–View–Controller pattern. 50 | 51 | ### Creational patterns 52 | 53 | | Name | Description | 54 | | --- | --- | 55 | | [Abstract factory](https://en.wikipedia.org/wiki/Abstract_factory_pattern) | Provide an interface for creating families of related or dependent objects without specifying their concrete classes. | 56 | | [Builder](https://en.wikipedia.org/wiki/Builder_pattern) | Separate the construction of a complex object from its representation, allowing the same construction process to create various representations. | 57 | | [Factory method](FACTORY_PATTERN.md) | Define an interface for creating a single object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses (dependency injection). | 58 | | [Lazy initialization](https://en.wikipedia.org/wiki/Lazy_initialization) | Tactic of delaying the creation of an object, the calculation of a value, or some other expensive process until the first time it is needed. This pattern appears in the GoF catalog as "virtual proxy", an implementation strategy for the Proxy pattern. | 59 | | [Multiton](https://en.wikipedia.org/wiki/Multiton_pattern) | Ensure a class has only named instances, and provide a global point of access to them. | 60 | | [Object pool](https://en.wikipedia.org/wiki/Object_pool_pattern) | Avoid expensive acquisition and release of resources by recycling objects that are no longer in use. Can be considered a generalisation of connection pool and thread pool patterns. | 61 | | [Prototype](PROTOTYPE_PATTERN.md) | Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype. | 62 | | [Resource acquisition is initialization](https://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization) | Ensure that resources are properly released by tying them to the lifespan of suitable objects. | 63 | | [Singleton](SINGLETON_PATTERN.md) | Ensure a class has only one instance, and provide a global point of access to it. | 64 | 65 | ### Structural patterns 66 | 67 | | Name | Description | 68 | | --- | --- | 69 | | [Adapter](https://en.wikipedia.org/wiki/Adapter_pattern) or Wrapper or Translator | Convert the interface of a class into another interface clients expect. An adapter lets classes work together that could not otherwise because of incompatible interfaces. The enterprise integration pattern equivalent is the translator. | 70 | | [Bridge](https://en.wikipedia.org/wiki/Bridge_pattern) | Decouple an abstraction from its implementation allowing the two to vary independently. | 71 | | [Composite](https://en.wikipedia.org/wiki/Composite_pattern) | Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly. | 72 | | [Decorator](https://en.wikipedia.org/wiki/Decorator_pattern) | Attach additional responsibilities to an object dynamically keeping the same interface. Decorators provide a flexible alternative to subclassing for extending functionality. | 73 | | [Facade](FACADE_PATTERN.md) | Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use. | 74 | | [Flyweight](https://en.wikipedia.org/wiki/Flyweight_pattern) | Use sharing to support large numbers of similar objects efficiently. | 75 | | [Front controller](https://en.wikipedia.org/wiki/Front_controller) | The pattern relates to the design of Web applications. It provides a centralized entry point for handling requests. | 76 | | [Marker](https://en.wikipedia.org/wiki/Marker_interface_pattern) | Empty interface to associate metadata with a class. | 77 | | [Module](MODULE_PATTERN.md) | Group several related elements, such as classes, singletons, methods, globally used, into a single conceptual entity. | 78 | | [Proxy](https://en.wikipedia.org/wiki/Proxy_pattern) | Provide a surrogate or placeholder for another object to control access to it. | 79 | | [Twin](https://en.wikipedia.org/wiki/Twin_pattern) | Twin allows modeling of multiple inheritance in programming languages that do not support this feature. | 80 | 81 | ### Behavioural patterns 82 | 83 | | Name | Description | 84 | | --- | --- | 85 | | [Blackboard](https://en.wikipedia.org/wiki/Blackboard_design_pattern) | Artificial intelligence pattern for combining disparate sources of data (see blackboard system) | 86 | | [Chain of responsibility](https://en.wikipedia.org/wiki/Chain_of_responsibility_pattern) | Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it. | 87 | | [Command](https://en.wikipedia.org/wiki/Command_pattern) | Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations. | 88 | | [Interpreter](https://en.wikipedia.org/wiki/Interpreter_pattern) | Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language. | 89 | | [Iterator](https://en.wikipedia.org/wiki/Iterator_pattern) | Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation. | 90 | | [Mediator](MEDIATOR_PATTERN.md) | Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently. | 91 | | [Memento](https://en.wikipedia.org/wiki/Memento_pattern) | Without violating encapsulation, capture and externalize an object's internal state allowing the object to be restored to this state later. | 92 | | [Null object](https://en.wikipedia.org/wiki/Null_Object_pattern) | Avoid null references by providing a default object. | 93 | | [Observer](OBSERVER_PATTERN.md) or [Publish/subscribe](https://en.wikipedia.org/wiki/Publish/subscribe) | Define a one-to-many dependency between objects where a state change in one object results in all its dependents being notified and updated automatically. | 94 | | [Servant](https://en.wikipedia.org/wiki/Design_pattern_Servant) | Define common functionality for a group of classes. | 95 | | [Specification](https://en.wikipedia.org/wiki/Specification_pattern) | Recombinable business logic in a Boolean fashion. | 96 | | [State](https://en.wikipedia.org/wiki/State_pattern) | Allow an object to alter its behavior when its internal state changes. The object will appear to change its class. | 97 | | [Strategy](https://en.wikipedia.org/wiki/Strategy_pattern) | Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it. | 98 | | [Template method](https://en.wikipedia.org/wiki/Template_method_pattern) | Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure. | 99 | | [Visitor](https://en.wikipedia.org/wiki/Visitor_pattern) | Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates. | 100 | 101 | ### Concurrency patterns 102 | 103 | | Name | Description | 104 | | --- | --- | 105 | | [Active Object](https://en.wikipedia.org/wiki/Active_object) | Decouples method execution from method invocation that reside in their own thread of control. The goal is to introduce concurrency, by using asynchronous method invocation and a scheduler for handling requests. | 106 | | [Balking](https://en.wikipedia.org/wiki/Balking_pattern) | Only execute an action on an object when the object is in a particular state. | 107 | | [Binding properties](https://en.wikipedia.org/wiki/Binding_properties_pattern) | Combining multiple observers to force properties in different objects to be synchronized or coordinated in some way. | 108 | | [Block chain](https://en.wikipedia.org/wiki/Block_chain_(database)) | Decentralized way to store data and agree on ways of processing it in a Merkle tree, optionally using Digital signature for any individual contributions. | 109 | | [Double-checked locking](https://en.wikipedia.org/wiki/Double_checked_locking_pattern) | Reduce the overhead of acquiring a lock by first testing the locking criterion (the 'lock hint') in an unsafe manner; only if that succeeds does the actual locking logic proceed. Can be unsafe when implemented in some language/hardware combinations. It can therefore sometimes be considered an anti-pattern. | 110 | | [Event-based asynchronous](https://en.wikipedia.org/wiki/Event-Based_Asynchronous_Pattern) | Addresses problems with the asynchronous pattern that occur in multithreaded programs. | 111 | | [Guarded suspension](https://en.wikipedia.org/wiki/Guarded_suspension) | Manages operations that require both a lock to be acquired and a precondition to be satisfied before the operation can be executed. | 112 | | [Join](https://en.wikipedia.org/wiki/Join-pattern) | Join-pattern provides a way to write concurrent, parallel and distributed programs by message passing. Compared to the use of threads and locks, this is a high-level programming model. | 113 | | [Lock](https://en.wikipedia.org/wiki/Lock_(computer_science)) | One thread puts a "lock" on a resource, preventing other threads from accessing or modifying it. | 114 | | [Messaging design pattern (MDP)](https://en.wikipedia.org/wiki/Messaging_pattern) | Allows the interchange of information (i.e. messages) between components and applications. | 115 | | [Monitor object](https://en.wikipedia.org/wiki/Monitor_(synchronization)) | An object whose methods are subject to mutual exclusion, thus preventing multiple objects from erroneously trying to use it at the same time. | 116 | | [Reactor](https://en.wikipedia.org/wiki/Reactor_pattern) | A reactor object provides an asynchronous interface to resources that must be handled synchronously. | 117 | | [Read-write lock](https://en.wikipedia.org/wiki/Read/write_lock_pattern) | Allows concurrent read access to an object, but requires exclusive access for write operations. | 118 | | [Scheduler](https://en.wikipedia.org/wiki/Scheduler_pattern) | Explicitly control when threads may execute single-threaded code. | 119 | | [Thread pool](https://en.wikipedia.org/wiki/Thread_pool_pattern) | A number of threads are created to perform a number of tasks, which are usually organized in a queue. Typically, there are many more tasks than threads. Can be considered a special case of the object pool pattern. | 120 | | [Thread-specific storage](https://en.wikipedia.org/wiki/Thread-Specific_Storage) | Static or "global" memory local to a thread. | 121 | 122 | ## Documentation 123 | 124 | The documentation for a design pattern describes the context in which the pattern is used, the forces within the context that the pattern seeks to resolve, and the suggested solution. There is no single, standard format for documenting design patterns. Rather, a variety of different formats have been used by different pattern authors. However, according to Martin Fowler, certain pattern forms have become more well-known than others, and consequently become common starting points for new pattern-writing efforts. One example of a commonly used documentation format is the one used by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides (collectively known as the "Gang of Four", or GoF for short) in their book Design Patterns. It contains the following sections: 125 | 126 | - **Pattern Name and Classification**: A descriptive and unique name that helps in identifying and referring to the pattern. 127 | - **Intent**: A description of the goal behind the pattern and the reason for using it. 128 | - **Also Known As**: Other names for the pattern. 129 | - **Motivation (Forces)**: A scenario consisting of a problem and a context in which this pattern can be used. 130 | - **Applicability**: Situations in which this pattern is usable; the context for the pattern. 131 | - **Structure**: A graphical representation of the pattern. Class diagrams and Interaction diagrams may be used for this purpose. 132 | - **Participants**: A listing of the classes and objects used in the pattern and their roles in the design. 133 | - **Collaboration**: A description of how classes and objects used in the pattern interact with each other. 134 | - **Consequences**: A description of the results, side effects, and trade offs caused by using the pattern. 135 | - **Implementation**: A description of an implementation of the pattern; the solution part of the pattern. 136 | - **Sample Code**: An illustration of how the pattern can be used in a programming language. 137 | - **Known Uses**: Examples of real usages of the pattern. 138 | - **Related Patterns**: Other patterns that have some relationship with the pattern; discussion of the differences between the pattern and similar patterns. 139 | 140 | ---------- 141 | 142 | *Source:* 143 | - [Software design pattern](https://en.wikipedia.org/wiki/Software_design_pattern)*. From Wikipedia, the free encyclopedia.* -------------------------------------------------------------------------------- /glossary/DOM.md: -------------------------------------------------------------------------------- 1 | # DOM 2 | 3 | [DOM (Document Object Model)](http://www.w3.org/DOM/) это не зависящий от платформы и языка программирования интерфейс, который позволяет программам и скриптам динамично получать доступ и обновлять содержимое, структуру и стиль документа. Документ может быть дополнительно обработан и результат этой обработки может быть включен обратно в представленную страницу. 4 | -------------------------------------------------------------------------------- /glossary/ECMASCRIPT.md: -------------------------------------------------------------------------------- 1 | # ECMAScript (ES) 2 | 3 | [ECMAScript](http://www.ecmascript.org/) (сокращенно как *ES*) это стандартизованная спецификация сценарного (скриптового) языка программирования используемая в JavaScript, и в других менее известных языках программирования JScript и ActionScript. 4 | 5 | Соглашение по управлению версиями ECMAScript было предметом горячих дебатов. Мы часто ссылаемся на ES5 (воспринимается большинством браузеров), ES6 (будущее JavaScript) и даже ES7 (далекое будущее JavaScript), но официальным наименованием для ES6 на самом деле будет ES2015. Намерение выпускать новую версию спецификаций каждый год, позволяет языку развиваться быстрее чем когда-либо. Тем не менее, большинство разработчиков используют термины ES5 и ES6. 6 | -------------------------------------------------------------------------------- /glossary/EMBER.md: -------------------------------------------------------------------------------- 1 | # Ember 2 | 3 | [Ember](http://emberjs.com/) is an application framework based on the model-view-controller pattern. By incorporating common patterns and idioms into the framework it aims to allow developers to create ambitious web applications quickly and easily. A side-effect of these abilities (either negative or positive depending upon the readers point of view) is that a certain conformity of naming and structure within those applications is expected. 4 | 5 | A key aim of the Ember project is that backward compatibility is an important feature of the framework so that applications may be built with Ember in the knowledge that future releases of the framework will not break those applications. 6 | 7 | Ember relies upon the following [core concepts](https://guides.emberjs.com/v2.1.0/getting-started/core-concepts/): 8 | 9 | - **Templates**: Ember.js templates use [handlebars](http://handlebarsjs.com/) style syntax and are used to integrate data with pre-written HTML. 10 | - **Models**: In Ember.js models allow the objects which the web application makes use of to be persisted. 11 | - **Components**: Components are used to define the behavior of the user interface in Ember.js. By combining a template and some javascript a component works to produce a representation which is useful to the web application user. 12 | - **Routes**: A route loads a component, a template and, optionally, some models. The resulting HTML is then rendered to the user agent. 13 | - **The Router**: Maps a URL to a given route. 14 | -------------------------------------------------------------------------------- /glossary/ESLINT.md: -------------------------------------------------------------------------------- 1 | # ESLint 2 | 3 | [ESLint](http://eslint.org/) — это один из новейших анализаторов JavaScript-кода. Он поставляется с большим набором готовых правил, который можно расширить с помощью плагинов. Он выводит сообщения в консоль лаконично, но не жертвует их информативностью. 4 | 5 | Две самые популярные конфигурации для ESLint: [стандартная](https://github.com/feross/standard) (без точек с запятой) и [полу-стандартная](https://github.com/Flet/semistandard). -------------------------------------------------------------------------------- /glossary/EXPRESS.md: -------------------------------------------------------------------------------- 1 | # Express 2 | 3 | [Express](http://expressjs.com/en/index.html) — это быстрый минималистичный фреймворк для разработки веб-приложений на [Node.js](NODEJS.md). Express предоставляет минимально необходимое количество готовых возможностей, при этом не заставляя разработчиков отказываться от известных и любимых стандартных возможностей Node.js. Огромное количество вспомогательных методов (особенно для работы с HTTP) позволяет очень легко создать надёжные API. 4 | -------------------------------------------------------------------------------- /glossary/EXTJS.md: -------------------------------------------------------------------------------- 1 | # Ext JS 2 | 3 | The most comprehensive JavaScript framework for building feature-rich cross-platform web applications targeting desktop, tablets, and smartphones. **Ext JS** leverages HTML5 features on modern browsers while maintaining compatibility and functionality for legacy browsers. 4 | 5 | ## Create feature-rich HTML5 applications using JavaScript 6 | 7 | [Sencha Ext JS](https://www.sencha.com/products/extjs/) is the most comprehensive MVC/MVVM JavaScript framework for building feature-rich cross-platform web applications targeting desktops, tablets, and smartphones. **Ext JS** leverages HTML5 features on modern browsers while maintaining compatibility and functionality for legacy browsers. 8 | 9 | **Ext JS** features hundreds of high-performance UI widgets that are meticulously designed to fit the needs of the simplest as well as the most complex web applications. **Ext JS** templates and layout manager give you full control over your display irrespective of devices and screen sizes. An advanced charting package allows you to visualize large quantities of data. The framework includes a robust data package that can consume data from any backend data source. **Ext JS** also offers several out-of-the-box themes, and complete theming support that lets you build applications that reflect your brand. It also includes an accessibility package (ARIA) to help with Section 508 compliance. 10 | 11 | ### High-Performance Customizable UI Widgets 12 | 13 | Sencha **Ext JS** provides the industry’s most comprehensive collection of high-performance, customizable UI widgets. These widgets include HTML5 grids, trees, lists, forms, menus, toolbars, panels, windows, and much more. If you don’t find a widget you are looking for, hundreds of user extensions are available from the Sencha community. 14 | 15 | ### Backend Agnostic Data Package 16 | 17 | The robust data package included in Sencha **Ext JS** decouples the UI widgets from the data layer. The data package allows client-side collections of data using highly functional models that offer features such as sorting and filtering. The data package is protocol agnostic, and can consume data from any backend source. It comes with session management capabilities that allow several client-side operations, minimizing round-trips to the server. 18 | 19 | ### Layout Manager and Responsive Configs 20 | 21 | Sencha **Ext JS** includes a flexible layout manager to help organize the display of data and content across multiple browsers, devices, and screen sizes. It helps you to control the display of components, even for the most complex user interfaces. **Ext JS** also provides a responsive config system that allows application components to adapt to specific device orientation (landscape or portrait) or available browser window size. 22 | 23 | ### Advanced Charting Package 24 | 25 | The Sencha **Ext JS** charting package allows you to visually represent data with a broad range of chart types — including line, bar, and pie charts. The charts use surfaces and sprites developed with a drawing package implemented using SVG, VML, and Canvas technologies. Browser variations are handled automatically so that the charts always display correctly. **Ext JS** charts also support touch gestures on mobile devices, thereby providing enhanced interactive features to the charts such as pan, zoom, and pinch. 26 | 27 | ### Easily Customizable Themes 28 | 29 | Sencha **Ext JS** widgets are available in multiple out-of-the-box themes such as Classic, Neptune, and Crisp. The themes are customizable to reflect a specific brand identity. Sencha Cmd exposes hundreds of variables used by **Ext JS** themes, which can be altered to design custom themes. A visual theme builder is also available in Sencha Architect that lets you customize the themes via a WYSIWYG editor. 30 | 31 | ### Accessibility Package (ARIA) for Section 508 compliance 32 | 33 | Sencha **Ext JS** ARIA Package makes it possible to add accessibility support to your applications by providing tools that developers need to achieve Section 508 Compliance. Using the ARIA package, developers can create apps that are usable for people who need assistive technologies such as screen readers to navigate the web. 34 | 35 | ### App Templates 36 | 37 | A variety of application templates come pre-installed to kickstart your app, instead of starting from a blank canvas. Templates are editable and completely customizable, and you can even create your own templates and reuse them for future projects. 38 | -------------------------------------------------------------------------------- /glossary/FACADE_PATTERN.md: -------------------------------------------------------------------------------- 1 | # Facade Pattern 2 | 3 | The [Facade Pattern](https://en.wikipedia.org/wiki/Facade_pattern) (**or façade pattern**) is a software design pattern commonly used with *object-oriented programming*. The name is by analogy to an architectural facade. 4 | 5 | A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can: 6 | 7 | - make a software library easier to use, understand and test, since the facade has convenient methods for common tasks; 8 | - make the library more readable, for the same reason; 9 | - reduce dependencies of outside code on the inner workings of a library, since most code uses the facade, thus allowing more flexibility in developing the system; 10 | - wrap a poorly designed collection of APIs with a single well-designed API. 11 | 12 | The Facade design pattern is often used when a system is very complex or difficult to understand because the system has a large number of interdependent classes or its source code is unavailable. This pattern hides the complexities of the larger system and provides a simpler interface to the client. It typically involves a single wrapper class which contains a set of members required by client. These members access the system on behalf of the facade client and hide the implementation details. 13 | 14 | ## Usage 15 | 16 | A Facade is used when an easier or simpler interface to an underlying object is desired. Alternatively, an [adapter](https://en.wikipedia.org/wiki/Adapter_pattern) can be used when the wrapper must respect a particular interface and must support polymorphic behavior. A [decorator](https://en.wikipedia.org/wiki/Decorator_pattern) makes it possible to add or alter behavior of an interface at run-time. 17 | 18 | | Pattern | Intent | 19 | |---|---| 20 | | Adapter | Converts one interface to another so that it matches what the client is expecting | 21 | | Decorator | Dynamically adds responsibility to the interface by wrapping the original code | 22 | | Facade | Provides a simplified interface | 23 | 24 | The facade pattern is typically used when: 25 | 26 | - a simple interface is required to access a complex system; 27 | - the abstractions and implementations of a subsystem are tightly coupled; 28 | - need an entry point to each level of layered software; or 29 | - a system is very complex or difficult to understand. 30 | 31 | ## Structure 32 | 33 |  34 | 35 | **Facade**: The facade class abstracts Packages 1, 2, and 3 from the rest of the application. 36 | **Clients**: The objects are using the Facade Pattern to access resources from the Packages. 37 | 38 | ## Example 39 | 40 | This is an abstract example of how a client (“you”) interacts with a facade (the “computer”) to a complex system (internal computer parts, like CPU and HardDrive). 41 | 42 | ```js 43 | /* Complex parts */ 44 | 45 | class CPU { 46 | freeze() { /* code here */ } 47 | jump(position) { /* code here */ } 48 | execute() { /* code here */ } 49 | } 50 | 51 | class Memory { 52 | load(position, data) { /* code here */ } 53 | } 54 | 55 | class HardDrive { 56 | read(lba, size) { /* code here */ } 57 | } 58 | 59 | /* Facade */ 60 | 61 | class ComputerFacade { 62 | constructor() { 63 | this.processor = new Cput(); 64 | this.ram = new Memory(); 65 | this.hd = new HardDrive(); 66 | } 67 | 68 | start() { 69 | this.processor.freeze(); 70 | this.ram.load(this.BOOT_ADDRESS, this.hd.read(this.BOOT_SECTOR, this.SECTOR_SIZE)); 71 | this.processor.jump(this.BOOT_ADDRESS); 72 | this.processor.execute(); 73 | } 74 | } 75 | 76 | /* Client */ 77 | 78 | let computer = new ComputerFacade(); 79 | computer.start(); 80 | 81 | ``` 82 | 83 | *Source: [Facade pattern](https://en.wikipedia.org/wiki/Facade_pattern). Wikipedia®* 84 | -------------------------------------------------------------------------------- /glossary/FACTORY_PATTERN.md: -------------------------------------------------------------------------------- 1 | # Factory Pattern 2 | 3 | In class-based programming, the **factory method pattern** is a creational pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created. This is done by creating objects by calling a factory method—either specified in an interface and implemented by child classes, or implemented in a base class and optionally overridden by derived classes—rather than by calling a constructor. 4 | 5 | ## Definition 6 | 7 | > Define an interface for creating an object, but let subclasses decide which class to instantiate. The Factory method lets a class defer instantiation it uses to subclasses. 8 | > — [Gang Of Four](https://en.wikipedia.org/wiki/Gang_of_Four_(software)) 9 | 10 | Creating an object often requires complex processes not appropriate to include within a composing object. The object's creation may lead to a significant duplication of code, may require information not accessible to the composing object, may not provide a sufficient level of abstraction, or may otherwise not be part of the composing object's concerns. The factory method design pattern handles these problems by defining a separate method for creating the objects, which subclasses can then override to specify the derived type of product that will be created. 11 | 12 | The factory method pattern may rely on inheritance, as object creation is delegated to subclasses that implement the factory method to create objects. 13 | 14 | ## Structure 15 | 16 |  17 | 18 | - **Product** 19 | - it defines the interface of objects created by the abstract; 20 | - **ConcreteProduct** 21 | - implements the `Product`; 22 | - **Creator** 23 | - Ii declares the factory method that returns an object of type `Product`. It may also include the implementation of this method as "*default*"; 24 | - it can cause a factory method to create an object of type `Product`; 25 | - **ConcreteCreator** 26 | - it overrides the factory method so that he created and returns an object of class `ConcreteProduct`. 27 | 28 | ## Example 29 | 30 | ```js 31 | class Product() { 32 | getName() { 33 | return null; 34 | } 35 | } 36 | 37 | class ConcreteProductA extends Product { 38 | getName() { 39 | return "ConcreteProductA"; 40 | } 41 | } 42 | 43 | class ConcreteProductB extends Product { 44 | getName() { 45 | return "ConcreteProductB"; 46 | } 47 | } 48 | 49 | class Creator() { 50 | factoryMethod() { 51 | return null; 52 | } 53 | } 54 | 55 | class ConcreteCreatorA extends Creator { 56 | factoryMethod() { 57 | return new ConcreteProductA(); 58 | } 59 | } 60 | 61 | class ConcreteCreatorB extends Creator { 62 | factoryMethod() { 63 | return new ConcreteProductB(); 64 | } 65 | } 66 | 67 | // An array of creators 68 | let creators = [new ConcreteCreatorA(), new ConcreteCreatorB()]; 69 | 70 | // Iterate over creators and create products 71 | for (let i = 0; i < creators.length; i++) { 72 | let product = creators[i].factoryMethod(); 73 | console.log(product.getName()); 74 | } 75 | ``` 76 | 77 | *Source: [Factory method pattern](https://en.wikipedia.org/wiki/Factory_method_pattern). Wikipedia®* -------------------------------------------------------------------------------- /glossary/FALCOR.md: -------------------------------------------------------------------------------- 1 | # Falcor 2 | 3 | [Falcor](https://netflix.github.io/falcor/) is a JavaScript library for efficient data fetching. 4 | 5 | ### One Model Everywhere 6 | 7 | Falcor lets you represent all your remote data sources as a single domain model via a virtual [JSON](JSON.md) graph. You code the same way no matter where the data is, whether in memory on the client or over the network on the server. 8 | 9 | ### The Data is the API 10 | 11 | A JavaScript-like path syntax makes it easy to access as much or as little data as you want, when you want it. You retrieve your data using familiar JavaScript operations like get, set, and call. If you know your data, you know your API. 12 | 13 | ### Bind to the Cloud 14 | 15 | Falcor automatically traverses references in your graph and makes requests as needed. Falcor transparently handles all network communications, opportunistically batching and de-duping requests. 16 | 17 | ## Getting Started 18 | 19 | You can check out a working example server for a Netflix-like application [here](http://github.com/netflix/falcor-express-demo) right now. Alternately you can go through this barebones tutorial in which we use the Falcor Router to create a Virtual JSON resource. In this tutorial we will use Falcor’s express middleware to serve the Virtual JSON resource on an application server at the URL /model.json. We will also host a static web page on the same server which retrieves data from the Virtual JSON resource. 20 | 21 | ### Creating a Virtual JSON Resource 22 | 23 | In this example we will use the Falcor Router to build a Virtual JSON resource on an app server and host it at `/model.json`. The JSON resource will contain the following contents: 24 | 25 | ```json 26 | { 27 | "greeting": "Hello World" 28 | } 29 | ``` 30 | 31 | Normally Routers retrieve the data for their Virtual JSON resource from backend datastores or other web services on-demand. However in this simple tutorial the Router will simply return static data for a single key. 32 | 33 | First we create a folder for our application server. 34 | 35 | ```sh 36 | mkdir falcor-app-server 37 | cd falcor-app-server 38 | npm init 39 | ``` 40 | 41 | Now we install the falcor Router. 42 | 43 | ```sh 44 | npm install falcor-router --save 45 | ``` 46 | 47 | Then install express and falcor-express. Support for [restify](https://github.com/netflix/falcor-restify), and [Hapi](https://github.com/netflix/falcor-hapi) is also available. 48 | 49 | ```sh 50 | npm install express --save 51 | npm install falcor-express --save 52 | ``` 53 | 54 | Now we create an `index.js` file with the following contents: 55 | 56 | ```js 57 | // index.js 58 | var falcorExpress = require('falcor-express'); 59 | var Router = require('falcor-router'); 60 | 61 | var express = require('express'); 62 | var app = express(); 63 | 64 | app.use('/model.json', falcorExpress.dataSourceRoute(function (req, res) { 65 | // create a Virtual JSON resource with single key ("greeting") 66 | return new Router([ 67 | { 68 | // match a request for the key "greeting" 69 | route: 'greeting', 70 | // respond with a PathValue with the value of 'Hello World.' 71 | get: function () { 72 | return { 73 | path: ['greeting'], 74 | value: 'Hello World' 75 | }; 76 | } 77 | } 78 | ]); 79 | })); 80 | 81 | // serve static files from current directory 82 | app.use(express.static(__dirname + '/')); 83 | 84 | var server = app.listen(3000); 85 | ``` 86 | 87 | Now we run the server, which will listen on port 3000 for requests for `/model.json`. 88 | 89 | ```sh 90 | node index.js 91 | ``` 92 | 93 | ### Retrieving Data from the Virtual JSON resource 94 | 95 | Now that we’ve built a simple virtual JSON document with a single read-only key “greeting”, we will create a test web page and retrieve this key from the server. 96 | 97 | Now create an index.html file with the following contents: 98 | 99 | ```html 100 | 101 | 102 |
103 | 104 | 105 | 117 | 118 | 119 | 120 | 121 | ``` 122 | 123 | Now visit http://localhost:3000/index.html and you should see the message retrieved from the server: 124 | 125 |  126 | 127 | *This section was taken from [Falcor documentation site](http://netflix.github.io/falcor/).* 128 | -------------------------------------------------------------------------------- /glossary/FLUX.md: -------------------------------------------------------------------------------- 1 | # Flux 2 | 3 | [Flux](https://facebook.github.io/flux/) — это разработанная и используемая в Facebook структура приложения, расширяющая премимущества одностороннего потока данных в [React](REACT.md). В Flux состояние приложения и его логика содержатся в хранилищах. -------------------------------------------------------------------------------- /glossary/FLYWEIGHT_PATTERN.md: -------------------------------------------------------------------------------- 1 | # Flyweight Pattern 2 | 3 | [Flyweight Pattern](https://addyosmani.com/resources/essentialjsdesignpatterns/book/#flyweightpatternjavascript) section to be completed. -------------------------------------------------------------------------------- /glossary/FOUR.md: -------------------------------------------------------------------------------- 1 | # Four 2 | 3 | [Four](https://github.com/allotrop3/four) is a high level graphics API based on WebGL 1.0 for developing 3D content for the web. It lets you avoid the burden of repetition and complexity to speed up and simplify the development while exposing the flexibility of the [WebGL](WEBGL.md) API. 4 | 5 | Here are an [introduction](http://www.sitepoint.com/introducing-four-webgl-easier/) and a [demo](http://allotrop3.github.io/four/). 6 | -------------------------------------------------------------------------------- /glossary/GRUNT.md: -------------------------------------------------------------------------------- 1 | # Grunt 2 | 3 | [Grunt](http://gruntjs.com/) — это таск-менеджер, автоматизирующий рутинные и, возможно, сложные действия. Основной идеей Grunt (а также его аналога [Gulp](GULP.md)) является описание тасков (задач), выполняющих какие-либо (обычно связанные с файлами) действия. Впоследствии эти задачи могут быть вызваны вручную с помощью командной строки или автоматически другими задачами. -------------------------------------------------------------------------------- /glossary/GULP.md: -------------------------------------------------------------------------------- 1 | # Gulp 2 | 3 | [Gulp](http://gulpjs.com/) — это таск-менеджер, автоматизирующий рутинные и, возможно, сложные действия. Основной идеей Grunt (а также его аналога [Gulp](GULP.md)) является описание тасков (задач), выполняющих какие-либо (обычно связанные с файлами) действия. Впоследствии эти задачи могут быть вызваны вручную с помощью командной строки или автоматически другими задачами. 4 | 5 | Gulp довольно популярен благодаря большой экосистеме плагинов, позволяющей автоматизировать ежедневные задачи без необходимости написания большого количества кода. 6 | -------------------------------------------------------------------------------- /glossary/HAPI.md: -------------------------------------------------------------------------------- 1 | # Hapi 2 | 3 | [Hapi](http://hapijs.com/) is a simple to use configuration-centric framework with built-in support for input validation, caching, authentication, and other essential facilities for building web and services applications. Hapi enables developers to focus on writing reusable application logic in a highly modular and prescriptive approach. 4 | -------------------------------------------------------------------------------- /glossary/HOISTING.md: -------------------------------------------------------------------------------- 1 | # Hoisting 2 | 3 | [Hoisting](http://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html) (рус. *поднятие*) — это действие, совершаемое JavaScript-интерпретатором и заключающееся в перемещении всех объявлений функций вида `function foo() {}` и всех объявлений переменных вида `var foo;` в верх их области видимости. Важно, что в самый верх перемещаются только объявления функций и переменных, но не их присвоенные значения. -------------------------------------------------------------------------------- /glossary/IIFE.md: -------------------------------------------------------------------------------- 1 | # IIFE 2 | 3 | IIFE (*Immediately Invoked Function Expression*) — это функция, которая выполняется сразу же после своего описания. Наиболее часто используется для создания областей видимости (внутри которых все переменные и объявления функций являются вложенными в эту область видимости). 4 | 5 | IIFE может быть написана с вызывающими функцию скобками (`()`) внутри оборачивающих выражение скобок: 6 | 7 | ```js 8 | (function foo () { 9 | // [body] 10 | }()); 11 | ``` 12 | 13 | Или с вызывающими скобками снаружи: 14 | 15 | ```js 16 | (function foo () { 17 | // [body] 18 | })(); 19 | ``` 20 | 21 | В примерах выше обе IIFE-функции имеют имя (`foo`), но также довольно распространено создание анонимных IIFE (не имеющих имени функции). 22 | -------------------------------------------------------------------------------- /glossary/ISOMORPHIC.md: -------------------------------------------------------------------------------- 1 | # Изоморфное приложение 2 | 3 | Изоморфные приложения (после [этой статьи](https://medium.com/@mjackson/universal-javascript-4761051b7ae9) их все чаще стали называть [универсальными](UNIVERSAL.md)) — это приложения, которые могут выполняться как на сервере, так и на клиенте. 4 | 5 | Ключевая идея состоит в том, что сервер может отрисовывать страницы и осуществлять маршрутизацию (routing). Это может пригодиться, например, если у пользователя отключен JavaScript. Приложение продолжит полностью функционировать, предоставляя пользователю возможность быстрого взаимодействия со страницей. При этом можно избежать традиционных перезагрузок страниц. 6 | 7 | В изоморфных приложениях первый запрос от браузера обрабатывается сервером, а последующие — клиентом. -------------------------------------------------------------------------------- /glossary/ITERATOR_PATTERN.md: -------------------------------------------------------------------------------- 1 | # Iterator pattern 2 | 3 | [Iterator pattern](#) section to be completed. 4 | -------------------------------------------------------------------------------- /glossary/JASMINE.md: -------------------------------------------------------------------------------- 1 | # Jasmine 2 | 3 | [Jasmine](http://jasmine.github.io/) is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM. 4 | 5 | Jasmine is developed by [Pivotal Labs](http://pivotal.io/labs), and has many features like [Spies](http://jasmine.github.io/2.0/introduction.html#section-Spies) built in. 6 | 7 | It also has support for mocking [AJAX](http://jasmine.github.io/2.0/ajax.html). 8 | -------------------------------------------------------------------------------- /glossary/JQUERY.md: -------------------------------------------------------------------------------- 1 | # jQuery 2 | 3 | [jQuery](https://jquery.com/) — быстрая, небольшая и богатая на возможности клиентская библиотека. Она имеет простое API, работающее в большинстве браузеров и упрощающее обработку событий и работу с DOM, [AJAX](AJAX.md) и анимациями. Благодаря комбинации универсальности и расширяемости, jQuery изменила подход миллионов людей к написанию JavaScript кода. 4 | -------------------------------------------------------------------------------- /glossary/JQUERY_UI.md: -------------------------------------------------------------------------------- 1 | # jQuery UI 2 | 3 | [jQuery UI](#) section to be completed. 4 | -------------------------------------------------------------------------------- /glossary/JSCS.md: -------------------------------------------------------------------------------- 1 | # JSCS 2 | 3 | [JSCS — JavaScript Code Style](http://jscs.info/) is different from the others in that it doesn’t do anything unless you give it a configuration file or tell it to use a preset. You can download configurations from their website, so it’s not a big problem, and it has a number of presets, such as the [jQuery](JQUERY.md) coding style preset and the Google preset. JSCS is a code style checker. This means it only catches issues related to code formatting, and not potential bugs or errors. 4 | -------------------------------------------------------------------------------- /glossary/JSHINT.md: -------------------------------------------------------------------------------- 1 | # JSHint 2 | 3 | [JSHint](http://jshint.com/) was created as a more configurable version of [JSLint](JSLINT.md) (of which it is a fork). You can configure every rule, and put them into a configuration file, which makes JSHint easy to use in bigger projects. JSHint also has good documentation for each of the rules, so you know exactly what they do. 4 | -------------------------------------------------------------------------------- /glossary/JSLINT.md: -------------------------------------------------------------------------------- 1 | # JSLint 2 | 3 | [JSLint](http://www.jslint.com/) is a static analysis “code quality” tool for JavaScript.The downsides are that JSLint is not configurable or extensible. You can’t disable many features at all, and some of them lack documentation. 4 | -------------------------------------------------------------------------------- /glossary/JSON-LD.md: -------------------------------------------------------------------------------- 1 | # JSON-LD 2 | 3 | [JSON-LD (JSON for Linked Data)](http://json-ld.org/) is a lightweight Linked Data format. It is easy for humans to read and write. It is based on the already successful JSON format and provides a way to help [JSON](JSON.md) data interoperate at Web-scale. JSON-LD is an ideal data format for programming environments, REST Web services, and unstructured databases such as [CouchDB](COUCHDB.md) and [MongoDB](MONGODB.md). 4 | -------------------------------------------------------------------------------- /glossary/JSON.md: -------------------------------------------------------------------------------- 1 | # JSON 2 | 3 | [JSON (JavaScript Object Notation)](http://www.json.org/) легковесный формат обмена данными. Широко используется в [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) веб-сервисах. Он прост как и для людей, чтобы читать и писать, так и для машинного разбора (парсинга) и генерации. 4 | -------------------------------------------------------------------------------- /glossary/JSONP.md: -------------------------------------------------------------------------------- 1 | # JSONP 2 | 3 | [JSONP](https://ru.wikipedia.org/wiki/JSON#JSONP_.D0.B8_JSONPP) section to be completed. 4 | -------------------------------------------------------------------------------- /glossary/JSX.md: -------------------------------------------------------------------------------- 1 | # JSX 2 | 3 | [JSX](https://facebook.github.io/jsx/) — это расширение языка для использования XML-подобного синтаксиса в JavaScript. JSX позволяет разработчикам писать HTML-код прямо в JS, но прежде чем использовать этот код в браузере, его нужно транспилировать. JSX разработан в Facebook и чаще всего используется вместе с [React](REACT.md). 4 | -------------------------------------------------------------------------------- /glossary/KNOCKOUT.md: -------------------------------------------------------------------------------- 1 | # Knockout 2 | 3 | [Knockout](http://knockoutjs.com/) (shortened as *KO*) is a JavaScript library that helps developers creating rich, responsive display and editor user interfaces with a clean underlying data model. Knockout helps implementing sections of UI that update dynamically (e.g. changes depending on user’s actions or when external data source gets updated) more simply and maintainably. 4 | -------------------------------------------------------------------------------- /glossary/LAZY_INITIALIZATION_PATTERN.md: -------------------------------------------------------------------------------- 1 | # Lazy initialization pattern 2 | 3 | [Lazy initialization pattern](#) section to be completed. 4 | -------------------------------------------------------------------------------- /glossary/LOCALFORAGE.md: -------------------------------------------------------------------------------- 1 | # localForage 2 | 3 | **Offline storage, improved.** 4 | 5 | [localForage](https://mozilla.github.io/localForage/#localforage) is a JavaScript library that improves the offline experience of your web app by using an asynchronous data store with a simple, `localStorage`-like API. It allows developers to store many types of data instead of just strings. 6 | 7 | localForage includes a localStorage-backed fallback store for browsers with no IndexedDB or WebSQL support. Asynchronous storage is available in the current versions of all major browsers: Chrome, Firefox, IE, and Safari (including Safari Mobile). 8 | 9 | **localForage offers a callback API as well as support for the** [ES6 Promises API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise), so you can use whichever you prefer. 10 | 11 | ## Installation 12 | 13 | To use localForage, [download the latest release](https://github.com/mozilla/localForage/releases) or install with npm: 14 | 15 | ```sh 16 | $ npm install localforage 17 | ``` 18 | 19 | or bower: 20 | 21 | ```sh 22 | $ bower install localforage 23 | ``` 24 | 25 | Then simply include the JS file and start using localForage: 26 | 27 | ```html 28 | . 29 | ``` 30 | 31 | You don’t need to run any init method or wait for any `onready` events. 32 | 33 | ## How to use localForage 34 | 35 | ### Callbacks 36 | 37 | Because localForage uses async storage, it has an async API. It's otherwise exactly the same as the [localStorage API](https://hacks.mozilla.org/2009/06/localstorage/). 38 | 39 | ```js 40 | // In localStorage, we would do: 41 | var obj = { value: "hello world" }; 42 | localStorage.setItem('key', JSON.stringify(obj)); 43 | alert(obj.value); 44 | 45 | // With localForage, we use callbacks: 46 | localforage.setItem('key', obj, function(err, result) { alert(result.value); }); 47 | ``` 48 | 49 | Similarly, please don't expect a return value from calls to `localforage.getItem()`. Instead, use a callback: 50 | 51 | ```js 52 | // Synchronous; slower! 53 | var value = JSON.parse(localStorage.getItem('key')); 54 | alert(value); 55 | 56 | // Async, fast, and non-blocking! 57 | localforage.getItem('key', function(err, value) { alert(value) }); 58 | ``` 59 | 60 | Callbacks in localForage are Node-style (error argument first) since version `0.9.3`. This means if you're using callbacks, your code should look like this: 61 | 62 | ```js 63 | // Use err as your first argument. 64 | localforage.getItem('key', function(err, value) { 65 | if (err) { 66 | console.error('Oh noes!'); 67 | } else { 68 | alert(value); 69 | } 70 | }); 71 | ``` 72 | 73 | You can store any type in localForage; you aren't limited to strings like in localStorage. Even if localStorage is your storage backend, localForage automatically does `JSON.parse()` and `JSON.stringify()` when getting/setting values. 74 | 75 | ### Promises 76 | 77 | Promises are pretty cool! If you'd rather use promises than callbacks, localForage supports that too: 78 | 79 | ```js 80 | function doSomethingElse(value) { 81 | console.log(value); 82 | } 83 | 84 | // With localForage, we allow promises: 85 | localforage.setItem('key', 'value').then(doSomethingElse); 86 | ``` 87 | 88 | When using Promises, `err` is **not** the first argument passed to a function. Instead, you handle an error with the rejection part of the Promise: 89 | 90 | ```js 91 | // A full setItem() call with Promises. 92 | localforage.setItem('key', 'value').then(function(value) { 93 | alert(value + ' was set!'); 94 | }, function(error) { 95 | console.error(error); 96 | }); 97 | ``` 98 | 99 | localForage relies on native [ES6 Promises](https://www.promisejs.org/), but [ships with an awesome polyfill](https://github.com/jakearchibald/es6-promise) for browsers that don't support ES6 Promises yet. 100 | 101 | ### Storing Blobs, TypedArrays, and other JS objects 102 | 103 | localForage supports storing all native JS objects that can be serialized to JSON, as well as ArrayBuffers, Blobs, and TypedArrays. Check the [API docs](https://mozilla.github.io/localForage/#setitem) for a full list of types supported by localForage. 104 | 105 | All types are supported in every storage backend, though storage limits in localStorage make storing many large Blobs impossible. 106 | 107 | ### Configuration 108 | 109 | You can set database information with the `config()` method. Available options are `driver`, `name`, `storeName`, `version`, `size`, and `description`. 110 | 111 | Example: 112 | 113 | ```js 114 | localforage.config({ 115 | driver : localforage.WEBSQL, // Force WebSQL; same as using setDriver() 116 | name : 'myApp', 117 | version : 1.0, 118 | size : 4980736, // Size of database, in bytes. WebSQL-only for now. 119 | storeName : 'keyvaluepairs', // Should be alphanumeric, with underscores. 120 | description : 'some description' 121 | }); 122 | ``` 123 | 124 | **Note**: you must call `config()` before you interact with your data. This means calling `config()` before using `getItem()`, `setItem()`, `removeItem()`, `clear()`, `key()`, `keys()` or `length()`. 125 | 126 | ### Multiple instances 127 | 128 | You can create multiple instances of localForage that point to different stores using `createInstance`. All the configuration options used by [`config`](https://github.com/mozilla/localForage#configuration) are supported. 129 | 130 | ```js 131 | var store = localforage.createInstance({ 132 | name: "nameHere" 133 | }); 134 | 135 | var otherStore = localforage.createInstance({ 136 | name: "otherName" 137 | }); 138 | 139 | // Setting the key on one of these doesn't affect the other. 140 | store.setItem("key", "value"); 141 | otherStore.setItem("key", "value2"); 142 | ``` 143 | 144 | ### RequireJS 145 | 146 | You can use localForage with [RequireJS](http://requirejs.org/): 147 | 148 | ```js 149 | define(['localforage'], function(localforage) { 150 | // As a callback: 151 | localforage.setItem('mykey', 'myvalue', console.log); 152 | 153 | // With a Promise: 154 | localforage.setItem('mykey', 'myvalue').then(console.log); 155 | }); 156 | ``` 157 | 158 | ### Browserify and Webpack 159 | 160 | localForage 1.3+ works with both Browserify and Webpack. If you're using an earlier version of localForage and are having issues with Browserify or Webpack, please upgrade to 1.3.0 or above. 161 | 162 | If you're using localForage in your own build system (eg. browserify or webpack) make sure you have the [required plugins and transformers](https://github.com/mozilla/localForage/blob/master/package.json#L24) installed (eg. `$ npm install --save-dev babel-plugin-system-import-transformer`). 163 | 164 | ### Framework Support 165 | 166 | If you use a framework listed, there's a localForage storage driver for the models in your framework so you can store data offline with localForage. We have drivers for the following frameworks: 167 | 168 | - [AngularJS](https://github.com/ocombe/angular-localForage) 169 | - [Backbone](https://github.com/mozilla/localForage-backbone) 170 | - [Ember](https://github.com/genkgo/ember-localforage-adapter) 171 | 172 | ### Custom Drivers 173 | 174 | You can create your own driver if you want; see the [`defineDriver`](https://mozilla.github.io/localForage/#definedriver) API docs. 175 | 176 | There is a [list of custom drivers on the wiki](https://github.com/mozilla/localForage/wiki/Custom-Drivers). 177 | 178 | ---------- 179 | 180 | *Source:* 181 | 182 | - [mozilla/localForage](https://github.com/mozilla/localForage)*. Official GitHub repo.* 183 | - [localForage API Reference](https://mozilla.github.io/localForage/)*.* -------------------------------------------------------------------------------- /glossary/LODASH.md: -------------------------------------------------------------------------------- 1 | # LoDash 2 | 3 | [LoDash](https://lodash.com) — небольшая библиотека, которая предоставляет набор утилит для удобной работы с типами данных javascript (строками, объектами и др.) Каждый отдельная утилита в библиотеке [самодостаточна](https://www.npmjs.com/browse/keyword/lodash-modularized) и может быть использована без подключения всей библиотеки. Дополнительно, эти утилиты делают код более элегантным и эффективным, предлагая разработчику такие удобства, как использование функционального стиля, цепочек методов и [других особенностей](https://lodash.com/#features). 4 | 5 | LoDash упрощает работу с типами данных, предоставляя разработчику такие функции, как: 6 | - Обработка массивов: `map`, `reduce`, `filter`, `merge`, `difference`… 7 | - Трансформации строк: `capitalize`, `camelCase`, `truncate`, `template`… 8 | - Обработка коллекций: `find`, `where`, `contains`, `any`, `all`… 9 | - Обработка объектов: `pick`, `omit`, `forIn`, `pluck`… 10 | - Методы для работы с геттерами и сеттерами: `property`, `method`, `get`, `set`… 11 | - Утилиты для функционального программирования: `partial`, `curry`, `compose`, `debounce`… 12 | 13 | Также данный набор API позволяет вызывать функции в конвеерном стиле: 14 | 15 | ```js 16 | _.chain(myArray) 17 | .map(x => x * 3) 18 | .filter(x => x % 2) 19 | .sum() 20 | .value() 21 | // возвращает сумму всех утроенных четных чисел в массиве myArray 22 | ``` 23 | 24 | [Официальный сайт](https://lodash.com/) 25 | [Github](https://github.com/lodash/lodash) 26 | 27 | Также см. [Underscore](UNDERSCORE.md) -------------------------------------------------------------------------------- /glossary/MEAN.md: -------------------------------------------------------------------------------- 1 | # MEAN 2 | 3 | [MEAN](https://en.wikipedia.org/wiki/MEAN_(software_bundle)) — технологический стек (набор ПО), используемый преимущественно для разработки веб-сервисов. Состоит из: 4 | 5 | * [**M** ongoDB](MONGODB.md) — NoSQL СУБД; 6 | * [**E** xpressJS](EXPRESS.md) — серверный веб-фреймворк; 7 | * [**A** ngularJS](ANGULARJS.md) — клиентский MVC фреймворк; 8 | * [**N** ode.js](NODEJS.md) — среда исполнения Javascript; 9 | 10 | ### Известные MEAN-фреймворки 11 | * [MEAN](http://meanjs.org) от [meanjs.org](http://meanjs.org) ([Github](https://github.com/meanjs/mean)) 12 | * [MEAN](http://mean.io/) от [mean.io](http://mean.io/) ([Github](https://github.com/linnovate/mean)) -------------------------------------------------------------------------------- /glossary/MEDIATOR_PATTERN.md: -------------------------------------------------------------------------------- 1 | # Mediator Pattern 2 | 3 | In software engineering, the [mediator pattern](https://en.wikipedia.org/wiki/Mediator_pattern) defines an object that encapsulates how a set of objects interact. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. 4 | 5 | Usually a program is made up of a large number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. 6 | 7 | With the **mediator pattern**, communication between objects is encapsulated with a **mediator** object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling. 8 | 9 | ## Definition 10 | 11 | The essence of the Mediator Pattern is to "define an object that encapsulates how a set of objects interact". It promotes loose coupling by keeping objects from referring to each other explicitly, and it allows their interaction to be varied independently.[1] Client classes can use the mediator to send messages to other clients, and can receive messages from other clients via an event on the mediator class. 12 | 13 | ## Structure 14 | 15 |  16 | 17 | The objects participating in this pattern are: 18 | 19 | - **Mediator** - In sample code: `Chatroom` 20 | - defines an interface for communicating with `Colleague` objects 21 | - maintains references to `Colleague` objects 22 | - manages central control over operations 23 | - **Colleagues** - In sample code: `Participants` 24 | - objects that are being mediated by the `Mediator` 25 | - each instance maintains a reference to the `Mediator` 26 | 27 | ## Example 28 | 29 | In the example code we have four participants that are joining in a chat session by registering with a Chatroom (the Mediator). Each participant is represented by a Participant object. Participants send messages to each other and the Chatroom handles the routing. 30 | 31 | This example is simple, but other complex rules could have been added, such as a 'junk filter' to protect participants from receiving junk messages. 32 | 33 | The log function is a helper which collects and displays results. 34 | 35 | ```js 36 | class Participant { 37 | constructor(name) { 38 | this.name = name; 39 | this.chatroom = null; 40 | } 41 | 42 | send(message, to) { 43 | this.chatroom.send(message, this, to); 44 | }, 45 | receive(message, from) { 46 | log.add(from.name + " to " + this.name + ": " + message); 47 | } 48 | } 49 | 50 | let Chatroom = function() { 51 | let participants = {}; 52 | 53 | return { 54 | register: function(participant) { 55 | participants[participant.name] = participant; 56 | participant.chatroom = this; 57 | }, 58 | send: function(message, from, to) { 59 | if (to) { // single message 60 | to.receive(message, from); 61 | } else { // broadcast message 62 | for (let key in participants) { 63 | if (participants[key] !== from) { 64 | participants[key].receive(message, from); 65 | } 66 | } 67 | } 68 | } 69 | }; 70 | }, 71 | 72 | // log helper 73 | log = (function() { 74 | let log = ''; 75 | 76 | return { 77 | add: msg => { log += msg + '\n'; }, 78 | show: () => { alert(log); log = ''; } 79 | } 80 | })(); 81 | 82 | function run() { 83 | let yoko = new Participant('Yoko'), 84 | john = new Participant('John'), 85 | paul = new Participant('Paul'), 86 | ringo = new Participant('Ringo'), 87 | chatroom = new Chatroom(), 88 | 89 | chatroom.register(yoko); 90 | chatroom.register(john); 91 | chatroom.register(paul); 92 | chatroom.register(ringo); 93 | 94 | yoko.send('All you need is love.'); 95 | yoko.send('I love you John.'); 96 | john.send('Hey, no need to broadcast', yoko); 97 | paul.send('Ha, I heard that!'); 98 | ringo.send('Paul, what do you think?', paul); 99 | 100 | log.show(); 101 | } 102 | 103 | run(); 104 | ``` 105 | 106 | ---------- 107 | 108 | *Source:* 109 | 110 | - [Mediator pattern](https://en.wikipedia.org/wiki/Mediator_pattern)*. From Wikipedia, the free encyclopedia.* 111 | - [Mediator](http://www.dofactory.com/javascript/mediator-design-pattern)*. Mediator JavaScript Design Pattern with examples.* -------------------------------------------------------------------------------- /glossary/MEMOIZE.md: -------------------------------------------------------------------------------- 1 | # Memoize 2 | 3 | An optimization used to speed up consecutive function calls by caching the result of calls with identical input. 4 | 5 | Here is an example of a memoizer function, taken from the book **JavaScript The Good Parts** by Douglas Crockford, 6 | that caches the results from a fibonacci number generator function: 7 | 8 | ```js 9 | var memoizer = function (memo, formula) { 10 | var recur = function (n) { 11 | var result = memo[n]; 12 | if (typeof result !== 'number') { 13 | result = formula(recur, n); 14 | memo[n] = result; 15 | } 16 | return result; 17 | }; 18 | return recur; 19 | }; 20 | 21 | var fibonacci = memoizer([0, 1], function (recur, n) { 22 | return recur(n − 1) + recur(n − 2); 23 | }); 24 | ``` 25 | 26 | ## References 27 | 28 | * [Faster JavaScript Memoization For Improved Application Performance](https://addyosmani.com/blog/faster-javascript-memoization/), by Addy Osmani. 29 | * [Implementing Memoization in JavaScript](http://www.sitepoint.com/implementing-memoization-in-javascript/) 30 | * [Wikipedia article](https://en.wikipedia.org/wiki/Memoization) on Memoization. 31 | 32 | 33 | ## NPM Memoize Modules 34 | 35 | * [mem](https://github.com/sindresorhus/mem) 36 | * [Memoizee](https://github.com/medikoo/memoizee) 37 | -------------------------------------------------------------------------------- /glossary/METALSMITH.md: -------------------------------------------------------------------------------- 1 | # Metalsmith 2 | 3 | [Metalsmith](http://metalsmith.io/) — это абстракция для манипуляции файлами. Проще говоря, это генератор статических сайтов. 4 | 5 | Metalsmith берет файлы в исходном каталоге, выполняет с ними определённые операции с помощью плагинов и записывает результат в целевой каталог. Плагины могут делать практически всё что угодно: создавать новые файлы, фильтровать, изменять файлы по какому-то принципу и многое другое (важно помнить, что порядок плагинов имеет значение — изменения, сделанные одним плагином, будут видны и использованы следующими плагинами). Именно развитая экосистема плагинов делает Metalsmith столь гибким инструментом. 6 | -------------------------------------------------------------------------------- /glossary/METEOR.md: -------------------------------------------------------------------------------- 1 | # Meteor 2 | 3 | [Meteor](https://www.meteor.com/) это JavaScript-фреймворк, написанный с использованием [Node.js](NODEJS.md). Он интегрируется с [MongoDB](MONGODB.md) и использует Протокол Распределённых Данных (DDP) в связке с шаблоном издатель-подписчик (pub/sub) для обеспечения автоматической синхронизации изменений данных на клиентах, освобождая тем самым разработчика от необходимости написания кода, обеспечивающего синхронизацию. -------------------------------------------------------------------------------- /glossary/MIXIN_PATTERN.md: -------------------------------------------------------------------------------- 1 | # Mixin Pattern 2 | 3 | [Mixin Pattern](https://addyosmani.com/resources/essentialjsdesignpatterns/book/#mixinpatternjavascript) section to be completed. -------------------------------------------------------------------------------- /glossary/MOCHA.md: -------------------------------------------------------------------------------- 1 | # Mocha 2 | 3 | [Mocha](https://mochajs.org/) (мо́ка) — расширяемый open-source фреймворк для тестирования программ на Javascript в [Node.js](NODEJS.md) и браузере. Фреймворк поддерживает TDD (Test-driven development) и BDD (Behavior-driven development), позволяя использать такие assertion-библиотеки, как [chai](CHAI.md), [should.js](https://github.com/shouldjs/should.js) и [expect.js](https://github.com/Automattic/expect.js). 4 | 5 | Mocha имеет поддержку тестовых шпионов (spy), стабов (stub) и моков (mock) при помощи специальных библиотек, таких как, например, [Sinon](https://github.com/sinonjs/sinon). 6 | 7 | Mocha также имеет поддержку тестирования синхронного и асинхронного кода, в том числе, тестирование [промисов](http://www.sitepoint.com/promises-in-javascript-unit-tests-the-definitive-guide/). -------------------------------------------------------------------------------- /glossary/MODERNIZR.md: -------------------------------------------------------------------------------- 1 | # Modernizr 2 | 3 | [Modernizr](https://modernizr.com/) is a feature detection library to determine which HTML/CSS features are available in the user’s browser. 4 | 5 | It is done by injecting specific classes on the document’s root element, so that the designer or the developer can treat the page differently should a feature not be available in the browser. 6 | 7 | For instance, if the browser does not support *CSS gradients*, Modernizr will add the class `no-cssgradients` to the document’s root element. That way, it is possible to create a rule that will set a regular background for non-supported browsers, like so: 8 | 9 | ```css 10 | .no-cssgradients .my-element { 11 | background-color: red; 12 | } 13 | ``` 14 | 15 | Another example is if the user has disabled Javascript on the page, then Modernizr will inject a `no-js` style on the page. The design of the page can then be adapted based on the lack of JavaScript given how certain features are likely to be unavailable. 16 | -------------------------------------------------------------------------------- /glossary/MODULE_PATTERN.md: -------------------------------------------------------------------------------- 1 | # Module Pattern 2 | 3 | In software engineering, the [module pattern](https://en.wikipedia.org/wiki/Module_pattern) is a design pattern used to implement the concept of software modules, defined by modular programming, in a programming language with incomplete direct support for the concept. 4 | 5 | This pattern can be implemented in several ways depending on the host programming language, such as the singleton design pattern, object-oriented static members in a class and procedural global functions. 6 | 7 | ## Structure 8 | 9 | The module software design pattern provides the features and syntactic structure defined by the modular programming paradigm to programming languages that have incomplete support for the concept. 10 | 11 |  12 | 13 | ## Concept 14 | 15 | In software development, source code can be organized into components that accomplish a particular function or contain everything necessary to accomplish a particular task. Modular programming is one of those approaches. 16 | 17 | The concept of a "module" is not fully supported in many common programming languages. 18 | 19 | ## Features 20 | 21 | In order to consider that a Singleton or any group of related code implements this pattern, the following features must be supplied: 22 | 23 | - A portion of the code must have global or public access and be designed for use as global/public code. Additional private or protected code can be executed by the main public code. 24 | - A module must have an initializer function that is equivalent to, or complementary to an object constructor method. This feature is not supported by regular namespaces. 25 | - A module must have a finalizer function that is equivalent to, or complementary to an object destructor method. This feature is not supported by regular namespaces. 26 | - Supporting members may require initialization/finalization code that is executed by the module's initializer/finalizer function. 27 | - Most members are functions that perform operations on elements external to the class, provided as arguments by calling functions. Such functions are "utilities", "tools" or "libraries". 28 | 29 | ## Example 30 | 31 | JavaScript does not have built-in support for modules, but the community has created impressive work-arounds. The two most popular standards are: 32 | 33 | - [CommonJS Modules](COMMONJS.md): The dominant implementation of this standard is in Node.js ([Node.js](NODEJS.md) modules have a few features that go beyond CommonJS). Characteristics: 34 | - Compact syntax 35 | - Designed for synchronous loading 36 | - Main use: server 37 | - [Asynchronous Module Definition (AMD)](AMD.md): The most popular implementation of this standard is [RequireJS](REQUIREJS.md). Characteristics: 38 | - Slightly more complicated syntax, enabling AMD to work without eval() (or a compilation step). 39 | - Designed for asynchronous loading 40 | - Main use: browsers 41 | 42 | In the middle of 2015, [TC39](https://github.com/tc39) have accepted the new standard **ECMAScript 2015** (**ES6**) which supports built-in modules through the new syntax. 43 | 44 | #### CommonJS example 45 | 46 | ##### Definition 47 | 48 | ```js 49 | // helper/MathHelper.js 50 | module.exports = { 51 | add: function(left, right) { 52 | return left + right; 53 | }, 54 | 55 | times: function(left, right) { 56 | return left * right; 57 | } 58 | } 59 | ``` 60 | 61 | ##### Implementation 62 | 63 | ```js 64 | // program.js 65 | var mathHelper = require('./helper/MathHelper'); 66 | 67 | console.log(mathHelper.add(5, 8)); // 13 68 | console.log(mathHelper.times(3, 4)); // 12 69 | ``` 70 | 71 | #### AMD example 72 | 73 | ##### Definition 74 | 75 | ```js 76 | // helper/MathHelper.js 77 | define(function() { 78 | return { 79 | add: function(left, right) { 80 | return left + right; 81 | }, 82 | 83 | times: function(left, right) { 84 | return left * right; 85 | } 86 | } 87 | }); 88 | ``` 89 | 90 | ##### Implementation 91 | 92 | ```js 93 | // program.js 94 | requirejs(['helper/MathHelper'], function(matHelper) { 95 | console.log(mathHelper.add(5, 8)); // 13 96 | console.log(mathHelper.times(3, 4)); // 12 97 | }); 98 | ``` 99 | 100 | #### ES6 example 101 | 102 | ##### Definition 103 | 104 | ```js 105 | // helper/MathHelper.js 106 | export function add(left, right) { 107 | return left + right; 108 | } 109 | 110 | export function times(left, right) { 111 | return left * right; 112 | } 113 | ``` 114 | 115 | ##### Implementation 116 | 117 | ```js 118 | // program.js 119 | import { add, times } from './helper/MathHelper'; 120 | 121 | console.log(add(5, 8)); // 13 122 | console.log(times(3, 4)); // 12 123 | ``` 124 | 125 | ## Module as a design pattern 126 | 127 | The Module pattern can be considered a creational pattern and a structural pattern. It manages the creation and organization of other elements, and groups them as the structural pattern does. 128 | 129 | An object that applies this pattern can provide the equivalent of a namespace, providing the initialization and finalization process of a static class or a class with static members with cleaner, more concise syntax and semantics. 130 | 131 | It supports specific cases where a class or object can be considered structured, procedural data. And, vice versa, migrate structured, procedural data, and considered as object-oriented. 132 | 133 | ---------- 134 | 135 | *Source:* 136 | - [Module pattern](https://en.wikipedia.org/wiki/Module_pattern)*. From Wikipedia, the free encyclopedia* 137 | - [ECMAScript 6 modules: the final syntax](http://www.2ality.com/2014/09/es6-modules-final.html)*. ②ality – JavaScript and more* -------------------------------------------------------------------------------- /glossary/MOMENTJS.md: -------------------------------------------------------------------------------- 1 | # Moment.js 2 | 3 | [Moment.js](http://momentjs.com/) — продвинутая библиотека для работы с датами в JavaScript. 4 | Умеет: 5 | * Производить парсинг (разбор) большого количества данных в дату: строки, строки с указанием формата, локалей, UTC, различные объекты, массивы, Unix-time и пр.; 6 | * Извлекать любую информацию из даты в любом формате: часы, минуты, секунды, недели, месяцы, дни и др., и все это с учётом локали; 7 | * Производить манипуляции с датами: вычислять последние месяцы, дни, вычислять UTC-смещения и пр.; 8 | * Вывод даты в любых форматах: строки, Unix-time, разницу между промежутками, массивы, объекты и пр.; 9 | * Различные проверки: какая дата раньше, позже, проверка на летнее/зимнее время, високосный/невисокосный год и др.; 10 | * Работа с локалями (культурами): добавление локалей, изменение, проверка, конвертация, вывод даты в нужной локали; 11 | * Работа с отрезками времени: арифметика, конвертация из одного отрезка в другой (7 дней -> неделя), вывод; 12 | * Поддержка различных плагинов, вроде [Moment Timezone](http://momentjs.com/timezone/) (для работы с временными зонами) или [Moment Twitter](https://github.com/hijonathan/moment.twitter) (показ отрезков времени как в Twitter); 13 | 14 | ### Ссылки 15 | [Официальный сайт](http://momentjs.com/) 16 | [GitHub](https://github.com/moment/moment/) -------------------------------------------------------------------------------- /glossary/MONGODB.md: -------------------------------------------------------------------------------- 1 | # MongoDB 2 | 3 | [MongoDB](https://www.mongodb.org/) — быстрая, надёжная и высокопроизводительная **NoSQL** СУБД, имеющая поддержку JavaScript. В ней используется концепция **документов**, представляющих собой модели данных в формате, похожем на [JSON](JSON.md) (он называется **BSON** — *Binary Simple Object Model*, простая модель бинарных объектов), позволяющая выбирать данные быстрее и проще. 4 | 5 | Основное преимущество по сравнению с традиционными СУБД, такими, как, например, MySQL, — это гибкость документной модели, обеспечивающая простоту и высокую скорость внедрения. 6 | -------------------------------------------------------------------------------- /glossary/MOOTOOLS.md: -------------------------------------------------------------------------------- 1 | # MooTools 2 | 3 | [MooTools](http://mootools.net/) (My Object-Oriented Tools) is a lightweight, object-oriented JavaScript framework. It is released under the free, open-source MIT License. It is used on more than 4% of all websites, and is one of the most popular JavaScript libraries. 4 | 5 | > **MooTools** is a collection of JavaScript utilities designed for the intermediate to advanced JavaScript developer. It allows you to write powerful and flexible code with its elegant, well documented, and coherent APIs. 6 | > 7 | > **MooTools** code is extensively documented and easy to read, enabling you to extend the functionality to match your requirements. 8 | > 9 | > — Official MooTools site. 10 | 11 | ## History 12 | 13 | Valerio Proietti first authored the framework and released it in September 2006 taking as his inspiration [Prototype](PROTOTYPE.md) and Dean Edward's [base2](http://code.google.com/p/base2/). MooTools originated from [Moo.fx](https://en.wikipedia.org/wiki/Moo.fx), a popular plug-in Proietti produced for Prototype in October 2005, which is still maintained and used. 14 | 15 | Whereas Prototype extended—prototyped—many of JavaScript's native String, Array, and Function objects with additional methods, Proietti desired a framework that (at the time) further extended the native Element object as well to offer greater control of the [Document Object Model](DOM.md) (DOM). 16 | 17 | ## Components 18 | 19 | MooTools includes a number of components, but not all need to be loaded for each application. Some of the component categories are: 20 | 21 | - **Core**: A collection of utility functions that all the other components require. 22 | - **More**: An official collection of add-ons that extend the Core and provide enhanced functionality. 23 | - **Class**: The base library for Class object instantiation. 24 | - **Natives**: A collection of JavaScript Native Object enhancements. The Natives add functionality, compatibility, and new methods that simplify coding. 25 | - **Element**: Contains a large number of enhancements and compatibility standardization to the HTML Element object. 26 | - **Fx**: An advanced effects-API to animate page elements. 27 | - **Request**: Includes [XHR](XHR.md) interface, Cookie, [JSON](JSON.md), and HTML retrieval-specific tools for developers to exploit. 28 | - **Window**: Provides a cross-browser interface to client-specific information, such as the dimensions of the window. 29 | 30 | ## Browser compatibility 31 | 32 | MooTools is compatible and tested with: 33 | 34 | - Safari 3+ 35 | - Internet Explorer 6+ 36 | - Mozilla Firefox 2+ 37 | - Opera 9+ 38 | - Chrome 4+ 39 | 40 | ## Benefits 41 | 42 | MooTools provides the user with a number of advantages over native JavaScript. These include: 43 | 44 | - An extensible and modular framework allowing developers to choose their own customized combination of components. 45 | - MooTools follows object-oriented practices and the DRY principle. 46 | - An advanced effects component, with optimized transitions such as easing equations used by many Flash developers. 47 | - Enhancements to the DOM, enabling developers to easily add, modify, select, and delete DOM elements. Storing and retrieving information with Element storage is also supported. 48 | 49 | The framework includes built-in functions for manipulation of CSS, DOM elements, native JavaScript objects, Ajax requests, DOM effects, and more. MooTools also provides a detailed, coherent application programming interface (API) as well as a custom downloads module allowing developers to download only the modules and dependencies they need for a particular app. 50 | 51 | ## Emphasis on modularity and reusability 52 | 53 | Every JavaScript framework has its philosophy, and MooTools is interested in taking full advantage of the flexibility and power of JavaScript in a way that emphasizes greater modularity and code reuse. MooTools accomplishes these goals in a way that is intuitive to a developer coming from a class-based inheritance language like Java with the MooTools **Class **object. 54 | 55 | **Class** is an object of key/value pairs that can contain either properties or methods (functions). **Class** is effortlessly mixed and extended with other Class instantiations allowing for the greatest focus of MooTools: Code reuse achieved through maximizing the power of JavaScript's prototypical inheritance, but in a **Class** object syntax more familiar to classical inheritance models. 56 | 57 | ## Object-oriented programming 58 | 59 | MooTools contains a robust Class creation and inheritance system that resembles most classically based Object-oriented programming languages. For example, the following is MooTools' equivalent of the examples in Wikipedia's polymorphism page: 60 | 61 | ```js 62 | var Animal = new Class({ 63 | 64 | initialize: function(name) { 65 | this.name = name; 66 | } 67 | 68 | }); 69 | 70 | var Cat = new Class({ 71 | Extends: Animal, 72 | 73 | talk: function() { 74 | return 'Meow!'; 75 | } 76 | 77 | }); 78 | 79 | var Dog = new Class({ 80 | 81 | Extends: Animal, 82 | 83 | talk: function() { 84 | return 'Arf! Arf'; 85 | } 86 | 87 | }); 88 | 89 | var animals = { 90 | a: new Cat('Missy'), 91 | b: new Cat('Mr. Bojangles'), 92 | c: new Dog('Lassie') 93 | }; 94 | 95 | Object.each(animals, function(animal) { 96 | alert(animal.name + ': ' + animal.talk()); 97 | }); 98 | 99 | // alerts the following: 100 | // 101 | // Missy: Meow! 102 | // Mr. Bojangles: Meow! 103 | // Lassie: Arf! Arf! 104 | ``` 105 | 106 | ---------- 107 | *Source:* 108 | 109 | - [MooTools](https://en.wikipedia.org/wiki/MooTools)*. From Wikipedia, the free encyclopedia* 110 | - [MooTools](http://mootools.net/)*. MooTools official site.* -------------------------------------------------------------------------------- /glossary/NIGHTMARE.md: -------------------------------------------------------------------------------- 1 | # Nightmare 2 | 3 | [Nightmare](http://nightmarejs.org/) is a high-level browser automation library. 4 | 5 | The goal is to expose just a few simple methods, and have an API that feels synchronous for each block of scripting, rather than deeply nested callbacks. It is designed for automating tasks across sites that do not have APIs. 6 | 7 | Under the cover, it uses [Electron](http://electron.atom.io/), which is similar to [PhantomJS](PHANTOMJS.md) but faster and more modern. 8 | -------------------------------------------------------------------------------- /glossary/NIGHTWATCHJS.md: -------------------------------------------------------------------------------- 1 | # NightwatchJS 2 | 3 | [NightwatchJS](http://nightwatchjs.org/.org/) is an extensible, open-source JavaScript testing framework that runs in [Node.js](NODEJS.md). It has clean syntax, a built-in test runner, support for Cloud providers like SauceLabs or BrowserStack, Continuos integration, also, NightwatchJS supports CSS and XPath selectors. 4 | -------------------------------------------------------------------------------- /glossary/NODEJS.md: -------------------------------------------------------------------------------- 1 | # Node.js 2 | 3 | [Node.js](https://nodejs.org/en/) — это кроссплатформенная среда выполнения с открытым исходным кодом, основанная на JavaScript-движке [V8](#v8) браузера Chrome. Предназначена для разработки серверных веб-приложений на языке JavaScript, запускаемых в среде её выполнения. 4 | 5 | Node.js использует событийно-ориентированную, неблокирующую ввод/вывод (I/O) модель, которая делает его лёгким и эффективным и вместе с тем оптимизированным для производительных и масштабируемых веб-приложений, работающих в режиме реального времени. 6 | 7 | Его разработка распространяется и поддерживается [Node.js Foundation](https://nodejs.org/en/foundation/) — совместным проектом консорциума Linux Foundation. -------------------------------------------------------------------------------- /glossary/NPM.md: -------------------------------------------------------------------------------- 1 | # npm 2 | 3 | [npm](https://www.npmjs.com/) — это инструмент для публикации и установки пакетов через npm-репозитории. Самый известный репозиторий — [npmjs.com](http://npmjs.com) — содержит много полезных пакетов, написанных и протестированных силами сообщества. -------------------------------------------------------------------------------- /glossary/NVM.md: -------------------------------------------------------------------------------- 1 | # nvm 2 | 3 | [nvm](https://github.com/creationix/nvm/blob/master/README.markdown) — это инструмент для запуска разных версий (и веток) Node.js на одном и том же компьютере. С его помощью можно устанавливать разные версии, просматривать список версий и выбирать текущую версию Node.js. Является аналогом [RVM](https://rvm.io/) (Ruby Version Manager). 4 | -------------------------------------------------------------------------------- /glossary/OBSERVER_PATTERN.md: -------------------------------------------------------------------------------- 1 | # Observer Pattern 2 | 3 | The [observer pattern](https://en.wikipedia.org/wiki/Observer_pattern) is a software design pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods. It is mainly used to implement distributed event handling systems. The Observer pattern is also a key part in the familiar [model–view–controller](MVC.md) (MVC) architectural pattern. The observer pattern is implemented in numerous programming libraries and systems, including almost all GUI toolkits. 4 | 5 | The observer pattern can cause memory leaks, known as the [lapsed listener problem](https://en.wikipedia.org/wiki/Lapsed_listener_problem), because in basic implementation it requires both explicit registration and explicit deregistration, as in the dispose pattern, because the subject holds strong references to the observers, keeping them alive. This can be prevented by the subject holding weak references to the observers. 6 | 7 | ## Definition 8 | 9 | Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. 10 | 11 | ## Summary 12 | 13 | The Observer pattern offers a subscription model in which objects subscribe to an event and get notified when the event occurs. This pattern is the cornerstone of event driven programming, including JavaScript. The Observer pattern facilitates good object-oriented design and promotes loose coupling. 14 | 15 | When building web apps you end up writing many event handlers. Event handlers are functions that will be notified when a certain event fires. These notifications optionally receive an event argument with details about the event (for example the x and y position of the mouse at a click event). 16 | 17 | The event and event-handler paradigm in JavaScript is the manifestation of the Observer design pattern. Another name for the Observer pattern is Pub/Sub, short for Publication/Subscription. 18 | 19 | ## Diagram 20 | 21 |  22 | 23 | The objects participating in this pattern are: 24 | 25 | - **Subject** - In sample code: `Click` 26 | - maintains list of observers. Any number of Observer objects may observe a Subject 27 | - implements an interface that lets observer objects subscribe or unsubscribe 28 | - sends a notification to its observers when its state changes 29 | - **Observers** - In sample code: `clickHandler` 30 | - has a function signature that can be invoked when Subject changes (i.e. event occurs) 31 | 32 | ## Example 33 | 34 | The `Click` object represents the *Subject*. The `clickHandler` function is the subscribing *Observer*. This handler subscribes, unsubscribes, and then subscribes itself while events are firing. It gets notified only of events #1 and #3. 35 | 36 | Notice that the fire method accepts two arguments. The first one has details about the event and the second one is the context, that is, the this value for when the eventhandlers are called. If no context is provided this will be bound to the global object (`window`). 37 | 38 | The `log` function is a helper which collects and displays results. 39 | 40 | ```js 41 | class Click { 42 | constructor() { 43 | this.handlers = []; // observers 44 | } 45 | 46 | subscribe(fn) { 47 | this.handlers.push(fn); 48 | } 49 | 50 | unsubscribe(fn) { 51 | this.handlers = this.handlers.filter(item => { return item !== fn ? item : null; }); 52 | } 53 | 54 | fire(o, thisObj) { 55 | let scope = thisObj || window; 56 | 57 | this.handlers.forEach(item => { item.call(scope, o) }); 58 | } 59 | } 60 | 61 | // log helper 62 | let log = (function() { 63 | let log = ''; 64 | 65 | return { 66 | add: msg => { log += msg + '\n'; }, 67 | show: () => { alert(log); log = ''; } 68 | } 69 | })(); 70 | 71 | function run() { 72 | var click = new Click(), 73 | clickHandler = item => { log.add('fired: ' + item); }; 74 | 75 | click.subscribe(clickHandler); 76 | click.fire('event #1'); 77 | click.unsubscribe(clickHandler); 78 | click.fire('event #2'); 79 | click.subscribe(clickHandler); 80 | click.fire('event #3'); 81 | 82 | log.show(); 83 | } 84 | 85 | run(); 86 | ``` 87 | 88 | ---------- 89 | 90 | *Source:* 91 | 92 | - [Observer pattern](https://en.wikipedia.org/wiki/Observer_pattern)*. From Wikipedia, the free encyclopedia.* 93 | - [Observer](http://www.dofactory.com/javascript/observer-design-pattern)*. Observer JavaScript Design Pattern with examples.* -------------------------------------------------------------------------------- /glossary/PARTIAL_APPLICATION.md: -------------------------------------------------------------------------------- 1 | # Partial Application 2 | 3 | [Partial Application](#) section to be completed. -------------------------------------------------------------------------------- /glossary/PHANTOMJS.md: -------------------------------------------------------------------------------- 1 | # PhantomJS 2 | 3 | [PhantomJS](http://phantomjs.org/) is a headless WebKit scriptable with a JavaScript API. It has **fast** and **native** support for various web standards: DOM handling, CSS selectors, JSON, Canvas, and SVG. 4 | 5 | ## Use Cases 6 | 7 | - **Headless web testing**. Lightning-fast testing without the browser is now possible! Various [test frameworks](http://phantomjs.org/headless-testing.html) such as [Jasmine](https://github.com/HugoGiraudel/SJSJ/blob/master/glossary/JASMINE.md), Capybara, [QUnit](https://github.com/HugoGiraudel/SJSJ/blob/master/glossary/QUNIT.md), [Mocha](https://github.com/HugoGiraudel/SJSJ/blob/master/glossary/MOCHA.md), WebDriver, YUI Test, BusterJS, FuncUnit, Robot Framework, and many others are supported. 8 | - **Page automation.** [Access and manipulate](http://phantomjs.org/page-automation.html) web pages with the standard DOM API, or with usual libraries like [jQuery](https://github.com/HugoGiraudel/SJSJ/blob/master/glossary/JQUERY.md). 9 | - **Screen capture.** Programmatically [capture web contents](http://phantomjs.org/screen-capture.html), including CSS, SVG and Canvas. Build server-side web graphics apps, from a screenshot service to a vector chart rasterizer. 10 | - **Network monitoring.** Automate performance analysis, track [page loading](http://phantomjs.org/network-monitoring.html) and export as standard HAR format. 11 | 12 | ## Features 13 | 14 | - **Multiplatform**, available on major operating systems: Windows, Mac OS X, Linux, and other Unices. 15 | - **Fast and native implementation** of web standards: DOM, CSS, JavaScript, Canvas, and SVG. No emulation! 16 | - **Pure headless (no X11) on Linux**, ideal for continuous integration systems. Also runs on Amazon EC2, Heroku, and Iron.io. 17 | - **Easy to install**: [Download](http://phantomjs.org/download.html), unpack, and start having fun in just 5 minutes. 18 | 19 | ## PhantomJS usage 20 | 21 | The PhantomJS JavaScript API can be used to open web pages, take screenshots, execute user actions, and run injected JavaScript in the page context. For example, the following code will open Wikipedia and, upon loading, will save a screenshot to a file and exit. 22 | 23 | ```js 24 | console.log('Loading a web page'); 25 | var page = require('webpage').create(); 26 | var url = 'http://en.wikipedia.org/'; 27 | page.open(url, function (status) { 28 | console.log('Page loaded'); 29 | page.render('wikipedia.org.png'); 30 | phantom.exit(); 31 | }); 32 | ``` 33 | 34 |