Skip to content

Commit 9760c06

Browse files
committed
ES2020 module
* updated package to latest version of all libs * tsc now export all .ts as es2020 files (instead of CommonJS) so no longer get warning by modern framework (like Angular) * fix #1989
1 parent 73f6ec4 commit 9760c06

File tree

8 files changed

+1959
-2307
lines changed

8 files changed

+1959
-2307
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
.npmrc
55
coverage
66
dist
7+
dist_save
78
node_modules
89
.vscode
910
.idea/

doc/CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ Change log
8484
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
8585

8686
## 7.3.0-dev (TBD)
87+
* package is now ES2020 (for TS exported files), webpack all.js still umd (could be commonjs ?), still have es5 files too
8788
* optimize [#2243](https://github.com/gridstack/gridstack.js/issues/2243) removed `gs-min|max_w|h` attribute generated in CSS or written out as they are never used for rendering, only for initial load. This reduce our column/row CSS in half!
8889
* optimize: removed `gs-w='1'` and `gs-h='1'` dom attribute writing since we already have min-width/min-height set, no need to set more attributes.
8990
* optimize: remove `'ui-draggable'` and `'ui-resizable'` since wasn't used in CSS and we have the `-disabled` version when off (so we can use `not(xyz-disabled)`).

es5/webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const config = {...webpackConfig,
1313
configFile: 'es5/tsconfig.json'
1414
}
1515
},
16-
exclude: ['/node_modules/', '/src/h5/', '/src/index-*.ts'],
16+
exclude: ['/node_modules/'],
1717
},
1818
],
1919
},

package.json

+22-22
Original file line numberDiff line numberDiff line change
@@ -58,37 +58,37 @@
5858
"homepage": "http://gridstackjs.com/",
5959
"dependencies": {},
6060
"devDependencies": {
61-
"@types/jasmine": "^3.5.9",
62-
"@typescript-eslint/eslint-plugin": "^4.6.0",
63-
"@typescript-eslint/parser": "^4.6.0",
61+
"@types/jasmine": "^4.3.1",
62+
"@typescript-eslint/eslint-plugin": "^5.58.0",
63+
"@typescript-eslint/parser": "^5.58.0",
6464
"connect": "^3.7.0",
65-
"core-js": "^3.6.4",
66-
"coveralls": "^3.0.9",
67-
"doctoc": "^1.4.0",
68-
"eslint": "^7.14",
69-
"grunt": "^1.0.4",
65+
"core-js": "^3.30.1",
66+
"coveralls": "^3.1.1",
67+
"doctoc": "^2.2.1",
68+
"eslint": "^8.38.0",
69+
"grunt": "^1.6.1",
7070
"grunt-cli": "^1.3.2",
7171
"grunt-contrib-connect": "^3.0.0",
7272
"grunt-contrib-copy": "^1.0.0",
73-
"grunt-contrib-cssmin": "^3.0.0",
74-
"grunt-contrib-uglify": "^5.0.0",
73+
"grunt-contrib-cssmin": "^4.0.0",
74+
"grunt-contrib-uglify": "^5.2.2",
7575
"grunt-contrib-watch": "^1.1.0",
76-
"grunt-eslint": "^23.0.0",
76+
"grunt-eslint": "^24.0.1",
7777
"grunt-protractor-runner": "^5.0.0",
7878
"grunt-protractor-webdriver": "^0.2.5",
7979
"grunt-sass": "3.1.0",
80-
"jasmine-core": "^3.5.0",
81-
"karma": "^6",
82-
"karma-chrome-launcher": "^3.1.0",
80+
"jasmine-core": "^4.6.0",
81+
"karma": "^6.4.1",
82+
"karma-chrome-launcher": "^3.1.1",
8383
"karma-cli": "^2.0.0",
84-
"karma-jasmine": "^4.0.1",
85-
"karma-typescript": "4.1.1",
84+
"karma-jasmine": "^5.1.0",
85+
"karma-typescript": "5.5.3",
8686
"protractor": "^7.0.0",
87-
"sass": "^1.42.1",
88-
"serve-static": "^1.14.1",
89-
"ts-loader": "^8.0.7",
90-
"typescript": "^3.7",
91-
"webpack": "^5.3.2",
92-
"webpack-cli": "^4.6.0"
87+
"sass": "^1.62.0",
88+
"serve-static": "^1.15.0",
89+
"ts-loader": "^9.4.2",
90+
"typescript": "^5.0.4",
91+
"webpack": "^5.79.0",
92+
"webpack-cli": "^5.0.1"
9393
}
9494
}

src/gridstack.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ export class GridStack {
660660

661661
// if we're loading a layout into for example 1 column (_prevColumn is set only when going to 1) and items don't fit, make sure to save
662662
// the original wanted layout so we can scale back up correctly #1471
663-
if (this._prevColumn && this._prevColumn !== this.opts.column && items.some(n => (n.x + n.w) > this.opts.column)) {
663+
if (this._prevColumn && this._prevColumn !== this.opts.column && items.some(n => (n.x + n.w) > (this.opts.column as number))) {
664664
this._ignoreLayoutsNodeChange = true; // skip layout update
665665
this.engine.cacheLayout(items, this._prevColumn, true);
666666
}

tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
"experimentalDecorators": true,
1111
"inlineSources": true,
1212
"lib": [ "es6", "es2015", "dom" ],
13-
"module": "CommonJS",
13+
"module": "ES2020",
1414
"noImplicitAny": false,
1515
"outDir": "./dist",
1616
"sourceMap": true,
1717
"strict": false,
18-
"target": "ES6"
18+
"target": "ES2020"
1919
},
2020
"exclude": [
2121
"./src/**/*.spec.ts",

webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
{
1313
test: /\.ts$/,
1414
use: 'ts-loader',
15-
exclude: ['/node_modules/', '/src/h5/', '/src/index-*.ts'], // TODO: doesn't seem to excluded for generating .d.ts !
15+
exclude: ['/node_modules/'],
1616
},
1717
],
1818
},

0 commit comments

Comments
 (0)