From 5120c590d60fa81392cc0c7b105c33b7adaff5f2 Mon Sep 17 00:00:00 2001 From: Alain Dumesny Date: Sat, 29 Apr 2023 08:46:24 -0700 Subject: [PATCH] v8.0.0 release --- Gruntfile.js | 6 +++--- README.md | 8 ++++++++ demo/angular/src/app/README.md | 12 +++++++----- demo/angular/src/app/dummy.component.ts | 2 +- demo/angular/src/app/gridstack-item.component.ts | 2 +- demo/angular/src/app/gridstack.component.ts | 2 +- demo/angular/tsconfig.lib.json | 12 ++++++++++++ doc/CHANGES.md | 7 ++++--- package.json | 5 +++-- src/dd-base-impl.ts | 2 +- src/dd-draggable.ts | 2 +- src/dd-droppable.ts | 2 +- src/dd-element.ts | 2 +- src/dd-gridstack.ts | 2 +- src/dd-manager.ts | 2 +- src/dd-resizable-handle.ts | 2 +- src/dd-resizable.ts | 2 +- src/dd-touch.ts | 2 +- src/gridstack-engine.ts | 2 +- src/gridstack-poly.js | 2 +- src/gridstack.scss | 2 +- src/gridstack.ts | 4 ++-- src/types.ts | 2 +- src/utils.ts | 2 +- tsconfig.json | 8 +++----- 25 files changed, 59 insertions(+), 37 deletions(-) create mode 100644 demo/angular/tsconfig.lib.json diff --git a/Gruntfile.js b/Gruntfile.js index 8ff8961ca..114d989db 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -43,9 +43,9 @@ module.exports = function(grunt) { 'dist/es5/gridstack-poly.js': ['src/gridstack-poly.js'], 'dist/src/gridstack.scss': ['src/gridstack.scss'], 'dist/src/gridstack-extra.scss': ['src/gridstack-extra.scss'], - 'dist/angular/README.md': ['demo/angular/src/app/README.md'], - 'dist/angular/gridstack.component.ts': ['demo/angular/src/app/gridstack.component.ts'], - 'dist/angular/gridstack-item.component.ts': ['demo/angular/src/app/gridstack-item.component.ts'], + 'dist/ng/README.md': ['demo/angular/src/app/README.md'], + // 'dist/ng/gridstack.component.ts': ['demo/angular/src/app/gridstack.component.ts'], + // 'dist/ng/gridstack-item.component.ts': ['demo/angular/src/app/gridstack-item.component.ts'], } } }, diff --git a/README.md b/README.md index a9f72b386..94f2be2e6 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ Join us on Slack: [https://gridstackjs.slack.com](https://join.slack.com/t/grids - [Migrating to v5](#migrating-to-v5) - [Migrating to v6](#migrating-to-v6) - [Migrating to v7](#migrating-to-v7) + - [Migrating to v8](#migrating-to-v8) - [jQuery Application](#jquery-application) - [Changes](#changes) - [The Team](#the-team) @@ -444,6 +445,13 @@ The main difference is you only need to include gridstack.js and get D&D (deskto New addition, no API breakage per say. See release notes about creating sub-grids on the fly. +## Migrating to v8 + +Possible breaking change if you use nested grid JSON format, or original Angular wrapper. Also target is now ES2020 (see release notes). +* `GridStackOptions.subGrid` -> `GridStackOptions.subGridOpts` rename +* We now have `GridStackWidget.subGridOpts` vs `GridStackNode.subGrid` (was `subGrid` with both types which is error prone) +* `GridStackOptions.addRemoveCB` -> `GridStack.addRemoveCB` is now global instead of grid option + # jQuery Application This is **old and no longer apply to v6+**. You'll need to use v5.1.1 and before diff --git a/demo/angular/src/app/README.md b/demo/angular/src/app/README.md index 0ea31b6fa..75fbc32fd 100644 --- a/demo/angular/src/app/README.md +++ b/demo/angular/src/app/README.md @@ -15,7 +15,7 @@ HTML Code ```ts import { GridStack, GridStackOptions } from 'gridstack'; -import { gsCreateNgComponents } from './gridstack.component'; +import { gsCreateNgComponents } from 'gridstack/dist/ng/gridstack.component'; constructor() { // use the built in component creation code @@ -48,7 +48,7 @@ Code ```ts import { Component } from '@angular/core'; import { GridStack, GridStackOptions } from 'gridstack'; -import { GridstackComponent, gsCreateNgComponents, NgGridStackWidget, nodesCB } from './gridstack.component'; +import { GridstackComponent, gsCreateNgComponents, NgGridStackWidget, nodesCB } from 'gridstack/dist/ng/gridstack.component'; // some custom components @Component({ @@ -107,7 +107,7 @@ HTML Code ```javascript import { GridStackOptions, GridStackWidget } from 'gridstack'; -import { nodesCB } from './gridstack.component'; +import { nodesCB } from 'gridstack/dist/ng/gridstack.component'; /** sample grid options and items to load... */ public gridOptions: GridStackOptions = { @@ -138,8 +138,10 @@ to build the demo, go to demo/angular and run `yarn` + `yarn start` and Navigate ## Caveats - - This wrapper needs v8.0+ to run as it needs the latest changes - - Code isn't compiled into a lib YET. You'll need to copy those files. Let me know (slack) if you are using it... + - This wrapper needs: + - gridstack v8.0+ to run as it needs the latest changes (use older version to match gs versions) + - Angular 13+ for dynamic createComponent() API + - Code in now shipped starting with v8.0+ in dist/ng for people to use directly! ## *ngFor Caveats - This wrapper handles well ngFor loops, but if you're using a trackBy function (as I would recommend) and no element id change after an update, diff --git a/demo/angular/src/app/dummy.component.ts b/demo/angular/src/app/dummy.component.ts index 0dc3fbbc6..ca0512674 100644 --- a/demo/angular/src/app/dummy.component.ts +++ b/demo/angular/src/app/dummy.component.ts @@ -1,5 +1,5 @@ /** - * gridstack.component.ts 7.3.0-dev + * gridstack.component.ts 8.0.0 * Copyright (c) 2022 Alain Dumesny - see GridStack root license */ diff --git a/demo/angular/src/app/gridstack-item.component.ts b/demo/angular/src/app/gridstack-item.component.ts index 329514380..1ea55a6d8 100644 --- a/demo/angular/src/app/gridstack-item.component.ts +++ b/demo/angular/src/app/gridstack-item.component.ts @@ -1,5 +1,5 @@ /** - * gridstack-item.component.ts 7.3.0-dev + * gridstack-item.component.ts 8.0.0 * Copyright (c) 2022 Alain Dumesny - see GridStack root license */ diff --git a/demo/angular/src/app/gridstack.component.ts b/demo/angular/src/app/gridstack.component.ts index cda71717d..2a8cbd0a3 100644 --- a/demo/angular/src/app/gridstack.component.ts +++ b/demo/angular/src/app/gridstack.component.ts @@ -1,5 +1,5 @@ /** - * gridstack.component.ts 7.3.0-dev + * gridstack.component.ts 8.0.0 * Copyright (c) 2022 Alain Dumesny - see GridStack root license */ diff --git a/demo/angular/tsconfig.lib.json b/demo/angular/tsconfig.lib.json new file mode 100644 index 000000000..9cb329033 --- /dev/null +++ b/demo/angular/tsconfig.lib.json @@ -0,0 +1,12 @@ +/* config to publish the angular wrapper classes */ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": ".../../../../dist/ng", + "declaration": true, + }, + "include": [ + "./src/app/gridstack.component.ts", + "./src/app/gridstack-item.component.ts", + ], +} diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 14c068ca8..c0bf8a8ca 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -5,7 +5,7 @@ Change log **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* -- [7.3.0-dev (TBD)](#730-dev-tbd) +- [8.0.0 (2023-04-29)](#800-2023-04-29) - [7.3.0 (2023-04-01)](#730-2023-04-01) - [7.2.3 (2023-02-02)](#723-2023-02-02) - [7.2.2 (2023-01-16)](#722-2023-01-16) @@ -83,8 +83,8 @@ Change log -## 7.3.0-dev (TBD) -* package is now ES2020 (TS exported files), webpack all.js still umd (could be commonjs), still have es5/ files unchanged (for now) +## 8.0.0 (2023-04-29) +* package is now ES2020 (TS exported files), webpack all.js still umd (better than commonjs for browsers), still have es5/ files unchanged (for now) * 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! * 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. * 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)`). @@ -92,6 +92,7 @@ Change log * move: `GridStack.addRemoveCB` is now global instead of grid option. `load()` can still be passed different optional callback * fix: addGrid() to handle passing an existing initialized grid already * break: `GridStackOptions.subGrid` -> `GridStackOptions.subGridOpts`. We now have `GridStackWidget.subGridOpts` vs `GridStackNode.subGrid` (subclass) rather than try to merge the two at runtime since very different types... +* tons of improvements for Angular wrapper. ## 7.3.0 (2023-04-01) * feat [#2229](https://github.com/gridstack/gridstack.js/pull/2229) support nonce for CSP. Thank you [@jedwards1211](https://github.com/jedwards1211) diff --git a/package.json b/package.json index 3181c2354..e13454cf4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gridstack", - "version": "7.3.0-dev", + "version": "8.0.0", "license": "MIT", "author": "Alain Dumesny (https://github.com/adumesny)", "contributors": [ @@ -25,9 +25,10 @@ } ], "scripts": { - "build": "yarn --no-progress && rm -rf dist/* && grunt && yarn build:es6 && yarn build:es5 && yarn doc", + "build": "yarn --no-progress && rm -rf dist/* && grunt && yarn build:es6 && yarn build:ng && yarn build:es5 && yarn doc", "build:es6": "webpack && tsc --stripInternal", "build:es5": "webpack --config es5/webpack.config.js && tsc --stripInternal --project es5/tsconfig.json", + "build:ng": "tsc --stripInternal --project ./demo/angular/tsconfig.lib.json", "w": "webpack", "t": "rm -rf dist/* && grunt && tsc --stripInternal", "doc": "doctoc ./README.md && doctoc ./doc/README.md && doctoc ./doc/CHANGES.md", diff --git a/src/dd-base-impl.ts b/src/dd-base-impl.ts index a77cf411f..3b9d4bc87 100644 --- a/src/dd-base-impl.ts +++ b/src/dd-base-impl.ts @@ -1,5 +1,5 @@ /** - * dd-base-impl.ts 7.3.0-dev + * dd-base-impl.ts 8.0.0 * Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license */ diff --git a/src/dd-draggable.ts b/src/dd-draggable.ts index 4ea5dc79d..0e657fbfe 100644 --- a/src/dd-draggable.ts +++ b/src/dd-draggable.ts @@ -1,5 +1,5 @@ /** - * dd-draggable.ts 7.3.0-dev + * dd-draggable.ts 8.0.0 * Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license */ diff --git a/src/dd-droppable.ts b/src/dd-droppable.ts index bdcc353bd..a0935a93f 100644 --- a/src/dd-droppable.ts +++ b/src/dd-droppable.ts @@ -1,5 +1,5 @@ /** - * dd-droppable.ts 7.3.0-dev + * dd-droppable.ts 8.0.0 * Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license */ diff --git a/src/dd-element.ts b/src/dd-element.ts index dd1489406..ef4a0906c 100644 --- a/src/dd-element.ts +++ b/src/dd-element.ts @@ -1,5 +1,5 @@ /** - * dd-elements.ts 7.3.0-dev + * dd-elements.ts 8.0.0 * Copyright (c) 2021 Alain Dumesny - see GridStack root license */ diff --git a/src/dd-gridstack.ts b/src/dd-gridstack.ts index 7f03f8e84..813b1f9a5 100644 --- a/src/dd-gridstack.ts +++ b/src/dd-gridstack.ts @@ -1,5 +1,5 @@ /** - * dd-gridstack.ts 7.3.0-dev + * dd-gridstack.ts 8.0.0 * Copyright (c) 2021 Alain Dumesny - see GridStack root license */ diff --git a/src/dd-manager.ts b/src/dd-manager.ts index 2a27217ff..50d2fa5f0 100644 --- a/src/dd-manager.ts +++ b/src/dd-manager.ts @@ -1,5 +1,5 @@ /** - * dd-manager.ts 7.3.0-dev + * dd-manager.ts 8.0.0 * Copyright (c) 2021 Alain Dumesny - see GridStack root license */ diff --git a/src/dd-resizable-handle.ts b/src/dd-resizable-handle.ts index 06362e97f..6ed824d95 100644 --- a/src/dd-resizable-handle.ts +++ b/src/dd-resizable-handle.ts @@ -1,5 +1,5 @@ /** - * dd-resizable-handle.ts 7.3.0-dev + * dd-resizable-handle.ts 8.0.0 * Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license */ diff --git a/src/dd-resizable.ts b/src/dd-resizable.ts index 515d48f6e..70fd9e8f8 100644 --- a/src/dd-resizable.ts +++ b/src/dd-resizable.ts @@ -1,5 +1,5 @@ /** - * dd-resizable.ts 7.3.0-dev + * dd-resizable.ts 8.0.0 * Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license */ diff --git a/src/dd-touch.ts b/src/dd-touch.ts index caae00521..fc33a1536 100644 --- a/src/dd-touch.ts +++ b/src/dd-touch.ts @@ -1,5 +1,5 @@ /** - * touch.ts 7.3.0-dev + * touch.ts 8.0.0 * Copyright (c) 2021 Alain Dumesny - see GridStack root license */ diff --git a/src/gridstack-engine.ts b/src/gridstack-engine.ts index 6be639064..f8f4ccdac 100644 --- a/src/gridstack-engine.ts +++ b/src/gridstack-engine.ts @@ -1,5 +1,5 @@ /** - * gridstack-engine.ts 7.3.0-dev + * gridstack-engine.ts 8.0.0 * Copyright (c) 2021-2022 Alain Dumesny - see GridStack root license */ diff --git a/src/gridstack-poly.js b/src/gridstack-poly.js index 3ba0679de..e7ef92f26 100644 --- a/src/gridstack-poly.js +++ b/src/gridstack-poly.js @@ -1,5 +1,5 @@ /** - * gridstack-poly.ts 7.3.0-dev used for IE and older browser support (not supported in v2-v4.3.1, but again in v4.4) + * gridstack-poly.ts 8.0.0 used for IE and older browser support (not supported in v2-v4.3.1, but again in v4.4) * Copyright (c) 2021 Alain Dumesny - see GridStack root license */ diff --git a/src/gridstack.scss b/src/gridstack.scss index f4ac46bb3..aa8e914f3 100644 --- a/src/gridstack.scss +++ b/src/gridstack.scss @@ -1,5 +1,5 @@ /** - * gridstack SASS styles 7.3.0-dev + * gridstack SASS styles 8.0.0 * Copyright (c) 2021 Alain Dumesny - see GridStack root license */ diff --git a/src/gridstack.ts b/src/gridstack.ts index aba695461..02d8a9c14 100644 --- a/src/gridstack.ts +++ b/src/gridstack.ts @@ -1,5 +1,5 @@ /*! - * GridStack 7.3.0-dev + * GridStack 8.0.0 * https://gridstackjs.com/ * * Copyright (c) 2021-2022 Alain Dumesny @@ -1649,7 +1649,7 @@ export class GridStack { return this; } - static GDRev = '7.3.0-dev'; + static GDRev = '8.0.0'; /* =========================================================================================== * drag&drop methods that used to be stubbed out and implemented in dd-gridstack.ts diff --git a/src/types.ts b/src/types.ts index 1f1d063c1..f68ea971f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,5 +1,5 @@ /** - * types.ts 7.3.0-dev + * types.ts 8.0.0 * Copyright (c) 2021 Alain Dumesny - see GridStack root license */ diff --git a/src/utils.ts b/src/utils.ts index 6dd20bf90..79ff69db4 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,5 @@ /** - * utils.ts 7.3.0-dev + * utils.ts 8.0.0 * Copyright (c) 2021 Alain Dumesny - see GridStack root license */ diff --git a/tsconfig.json b/tsconfig.json index 49196816c..5737f75f4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,8 @@ { "compilerOptions": { - /* - "allowJs": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true - */ + // "allowJs": true, + // "esModuleInterop": true, + // "allowSyntheticDefaultImports": true "declaration": true, "emitDecoratorMetadata": true, "experimentalDecorators": true,