From f429ddc26b949c3892828695a541bc2164b22843 Mon Sep 17 00:00:00 2001 From: Guilherme Oenning Date: Fri, 4 Nov 2016 06:20:20 -0200 Subject: [PATCH] [docs] Map is now required (#400) * es6 map & small typo * map is now required * no need to call it es6 ... --- README.md | 1 + wiki/environment.md | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 237dd6fd..84bc5ba8 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,7 @@ compilation options in your `tsconfig.json` file. InversifyJS requires a modern JavaScript engine with support for: - [Reflect metadata](https://github.com/rbuckton/ReflectDecorators/blob/master/spec/metadata.md) +- [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) - [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) (Only required if using [provider injection](https://github.com/inversify/InversifyJS#injecting-a-provider-asynchronous-factory)) - [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) (Only required if using [activation handlers](https://github.com/inversify/InversifyJS/blob/master/wiki/activation_handler.md)) diff --git a/wiki/environment.md b/wiki/environment.md index 53150cd8..966bec64 100644 --- a/wiki/environment.md +++ b/wiki/environment.md @@ -2,14 +2,15 @@ InversifyJS requires a modern JavaScript engine with support for the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise), +[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map), [Metadata Reflection API](http://rbuckton.github.io/ReflectDecorators/#reflect) and [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) objects. -If your environment don't support one of these you will need to import a shim or polypill. +If your environment don't support one of these you will need to import a shim or polyfill. ## Metadata Reflection API > :warning: **The `reflect-metadata` polyfill should be imported only once in your entire application** because the Reflect object is mean to be a global singleton. More details about this can be found [here](https://github.com/inversify/InversifyJS/issues/262#issuecomment-227593844). -Required always. Use [reflect-metadata](https://www.npmjs.com/package/reflect-metadata) as polypill. +Required always. Use [reflect-metadata](https://www.npmjs.com/package/reflect-metadata) as polyfill. ``` $ npm install reflect-metadata @@ -36,13 +37,18 @@ If you are working in a web browser you can use a script tag: This will create the Reflect object as a global. +## Map +[Maps](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) are required when using InversifyJS 3 or higher. + +Most modern JavaScript engines support map but if you need to support old browsers you will need to use a map polyfill (e.g. [es6-map](https://www.npmjs.com/package/es6-map)). + ## Promise -Promises are only required only if you use want to +[Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) are only required only if you use want to [inject a provider](https://github.com/inversify/InversifyJS#injecting-a-provider-asynchronous-factory). Most modern JavaScript engines support promises but if you need to support old browsers you will need to use a promise polyfill (e.g. [es6-promise](https://github.com/stefanpenner/es6-promise) or [bluebird](https://www.npmjs.com/package/bluebird)). ## Proxy -ES6 proxies are only required only if you want to [inject a proxy](https://github.com/inversify/InversifyJS/blob/master/wiki/activation_handler.md). +[Proxies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) are only required only if you want to [inject a proxy](https://github.com/inversify/InversifyJS/blob/master/wiki/activation_handler.md). As today (September 2016) proxies are not very well supported and it is very likely that you will need to use a proxy polyfill. For example, we use [harmony-proxy](https://www.npmjs.com/package/harmony-proxy) as polyfill to run our unit tests.