Skip to content

Conversation

@adumesny
Copy link
Member

@adumesny adumesny commented Sep 8, 2020

Description

develop (main branch) now has all the Typescript branch (soon to be delete) v2.0.0 release code

Checklist

  • Created tests which fail without the change (if possible)
  • All tests passing (yarn test)
  • Extended the README / documentation, if necessary

Alain Dumesny and others added 30 commits March 8, 2020 22:58
another BIG, BIG change
* converted all code to Typescript
* initial bundling with webpack to `gridstack.all.js` for browser inclusion
* added index.ts to include all modules and dependencies for build
* part-2 of gridstack gridstack#1084

TODO:
* modified float.html to test new code. still not running (missing `GridStack` export)
* need to use tsc to output for typescript native files ?
Fix missing `mode` warning
Replace `tslint` with `eslint`
* removed most JQ code in gridstack.ts, some harder parts remain.
* changed `.${val}` to just '.'+val to make it easier to search for $ replacement
* continued gridstack#1084

Note: float.html finally loads for me and add widget works! BUT drag/drop is still broken...
TS: Fix lint command on Windows
* removed a bunch more jquery code in main file
(more drag&drop will need to move out)
* all the demos are finally running, found a bunch of issues of DOM vs jquery
->all but knockout which always inserts at (0,0) now
-> RTL works a little better now, but still broken (hasn't worked in a while)
* public API that take string | HTMLElement will now handle list with selector
* using 'let' everywhere since not real global const

TODO: fix lint and test cases next...
* we now pass `yarn lint` stage
* removed more jquery calls
* `yarn test` is stuck with a 2min timeout
```cmd
HeadlessChrome 80.0.3987 (Windows 10.0.0): Executed 0 of 106 SUCCESS (0 secs / 0 secs)
HeadlessChrome 80.0.3987 (Windows 10.0.0) ERROR
  Disconnectedreconnect failed before timeout of 2000ms (ping timeout)
HeadlessChrome 80.0.3987 (Windows 10.0.0): Executed 0 of 106 DISCONNECTED (32.002 secs / 0 secs)
```
* part of gridstack#1084
Add Typescript support for Karma
* copied over the latest bug fixes from develop.
apparently I had missed some (row feature, etc..)
* `addWidget(el, x, y, width, ...)` now obsolete but sitll supported warning
* started 2.x readme section
more gridstack#1084
TS: update to latest develop branch
* the karma test cases are now all working again
(found some actual issues in new TS code)
* most test changes are `let` vs `var`
getSttribute() returning NULL instead of undefined
and removing jquery calls
* code coverage NOT working right now
(need to figure how to test .ts files ?)
* reverted karma.config.js for now (pre TS changes)
more gridstack#1084
* all methods now return at least `this` so they can be chainable if they don't return something specific
* `staticGrid` no longer disable oneColumnMode
TS: return signature cleanup, bug fix
adumesny and others added 29 commits August 2, 2020 09:26
renamed
GridStackDragDropPlugin -> GridStackDD
JQueryUIGridStackDragDropPlugin -> GridStackDDJQueryUI

* gridstack.all.js is now generated (190k) optimized with map and works great
* gridstack.js is also generated and complete without JQ anything and works great
* jq + jqui are now generated as min with map and appears to be OK

only thing remaining is to get gridstack-dd-jqueryui.js generated as stand alone file that could be imported.
(webpack will bundle dependencies so I need separate rule OR get tsc to do that
TS: progress on bundling for build, renamed DD files
* more fix for gridstack#1286
changed method to load() (rather than restore())
* added a callback function in additon to boolean which default to true (will add/remove widgets by default)
* use webpack to bundle gridstack.all.js (all inclusive, works in browsers)
* use tsc to compile each .TS into ES6 modules
verified that you can now do this in a sample app

import { GridStack } from 'gridstack';
import 'gridstack/dist/gridstack.css';

var grid = GridStack.init();
good re-write of D&D with generic non jquery code. this fixes the following:
* gridstack#1329 D&D wasn't working correctly in 2.0.0-rc
went through entire code with fine comb. "had to change 'drop' signature to have 2 elements (original drag and helper) do handle both cases
* gridstack#1102 we no longer make a copy when dragging between grids (just re-parent)
so all actions and settings stay the same.
Only time we make a copy is if dragging from an external toolbar and user has helper to clone item
*  rename of internal _prepareElementsByNode() -> _prepareDragDropByNode()
* more efficient node removal
* fix to check for dropped element being there before we add drag&drop feedback (which is delayed)
* more fixed for gridstack#1286
* load() was not correctly clearing the HTML items, and calling removed callback
* added sample text case
* also fixed other use cases includes
*make sure we remove drag&drop handler
* reset el.gridstackNode before callback to let callee know it's going away.
* Only remove if not already done.
TS: fixed package.json to refer to main module file
@adumesny adumesny merged commit d191a8d into gridstack:develop Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants