From 586512ecb619bbdcb994e91e45da47fee073ecd3 Mon Sep 17 00:00:00 2001 From: Evgeniy Timokhov Date: Thu, 3 Mar 2022 09:45:37 +0000 Subject: [PATCH] Changed target of TypeScript compilation to es2016 Partially addressed to #745 --- .size-limit.js | 4 ++-- tsconfig.options.json | 9 ++------- website/docs/intro.md | 9 +++++++++ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.size-limit.js b/.size-limit.js index c9337ebae..59ed788b2 100644 --- a/.size-limit.js +++ b/.size-limit.js @@ -4,11 +4,11 @@ module.exports = [ { name: 'ESM', path: 'dist/lightweight-charts.esm.production.js', - limit: '45.3 KB', + limit: '42.9 KB', }, { name: 'Standalone', path: 'dist/lightweight-charts.standalone.production.js', - limit: '45.9 KB', + limit: '43.5 KB', }, ]; diff --git a/tsconfig.options.json b/tsconfig.options.json index 10167f7e6..46a821667 100644 --- a/tsconfig.options.json +++ b/tsconfig.options.json @@ -5,12 +5,7 @@ "importHelpers": true, "lib": [ "dom", - "es2015.collection", - "es2015.core", - "es2015.iterable", - "es2015.symbol.wellknown", - "es2016.array.include", - "es5" + "es2016" ], "module": "esnext", "moduleResolution": "node", @@ -24,7 +19,7 @@ "rootDir": "./", "strict": true, "stripInternal": false, - "target": "es5", + "target": "es2016", "typeRoots": [ "./src/typings", "node_modules/@types" diff --git a/website/docs/intro.md b/website/docs/intro.md index 6ae68a00a..9da20cbdb 100644 --- a/website/docs/intro.md +++ b/website/docs/intro.md @@ -6,6 +6,15 @@ sidebar_position: 0 # Getting started +## Requirements + +First of all, Lightweight Charts is _a client-side_ library. +This means that it does not and cannot work on the server-side (i.e. NodeJS), at least out of the box. + +The code of `lightweight-charts` package is targeted to _es2016_ language specification. +Thus, all the browsers you need to work with should support this language revision (see [this compatibility table](https://kangax.github.io/compat-table/es2016plus/)). +If you need to support the previous revisions, you could try to setup a transpilation of the package to the target you need to support in your build system (e.g. by using Babel). + ## Installation The first thing you need to do to use `lightweight-charts` is to install it from [npm](https://www.npmjs.com/):