Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible with angular-legacy-sortablejs when update form 1.9.0 to 1.10.0 #1728

Closed
ChuckIsReady opened this issue Jan 22, 2020 · 2 comments

Comments

@ChuckIsReady
Copy link

Problem:

in version 1.9.0, i use angular-legacy-sortablejs by setting this on index.js (with webpack)

require('angular-legacy-sortablejs-maintained/angular-legacy-sortable.js');

after i update to 1.10.0 there is a error on console:

TypeError: Sortable.create is not a function

image

Then i find 1.10.0 is completely reconstructed.

in 1.9.0 :

(function sortableModule(factory) {
	"use strict";

	if (typeof define === "function" && define.amd) {
		define(factory);
	}
	else if (typeof module != "undefined" && typeof module.exports != "undefined") {
		module.exports = factory();
	}
	else {
		/* jshint sub:true */
		window["Sortable"] = factory();
	}
})(...)

in 1.10.0 :

(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  typeof define === 'function' && define.amd ? define(factory) :
  (global = global || self, global.Sortable = factory());
}(this, function (){...})

and angular-legacy-sortablejs get sortablejs by this way:

(function (factory) {
	'use strict';

	if (typeof define === 'function' && define.amd) {
		define(['angular', 'sortablejs'], factory);
	}
	else if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {
		require('angular');
		factory(angular, require('sortablejs'));
		module.exports = 'ng-sortable';
	}
	else if (window.angular && window.Sortable) {
		factory(angular, Sortable);
	}
})(function (angular, Sortable) {...}

So can you think about adding some conditions so that sortablejs can continue to be used by angular-legacy-sortablejs

thank you !

@owen-m1
Copy link
Member

owen-m1 commented Jan 25, 2020

It's an issue with how angular-sortablejs imports it, which had to be solved in ngx-sortablejs.
So you should open this issue in angular-sortablejs.

@romain-gilliotte
Copy link

IMO the issue is not how angular-sortablejs import it, but a semantic versionning bug on this module.

Since breaking changes were introduced, a new major version should have been issued, which would have prevented npm update from breaking all framework bindings which depend on this module.

(Nevertheless, this module is super convenient, thanks for the good work!)

karrui added a commit to opengovsg/angular-legacy-sortablejs that referenced this issue Jun 22, 2020
This is due to a breaking change in SortableJS: SortableJS/Sortable#1728, which causes angular-legacy-sortable to imports SortableJS incorrectly after versions 1.10.0, which leads to it not finding Sortablejs.create.
karrui added a commit to opengovsg/angular-legacy-sortablejs that referenced this issue Jun 22, 2020
This is due to a breaking change in SortableJS: SortableJS/Sortable#1728, which causes angular-legacy-sortable to imports SortableJS incorrectly after versions 1.10.0, which leads to it not finding Sortablejs.create.
karrui added a commit to opengovsg/angular-legacy-sortablejs that referenced this issue Jun 22, 2020
* fix: update the way SortableJS is imported into the library

This is due to a breaking change in SortableJS: SortableJS/Sortable#1728, which causes angular-legacy-sortable to imports SortableJS incorrectly after versions 1.10.0, which leads to it not finding Sortablejs.create.

* chore: bump package.json to 1.0.0

Big bump since this fixes a breaking change
karrui added a commit to opengovsg/angular-legacy-sortablejs that referenced this issue Jun 22, 2020
* fix: update the way SortableJS is imported into the library

This is due to a breaking change in SortableJS: SortableJS/Sortable#1728, which causes angular-legacy-sortable to imports SortableJS incorrectly after versions 1.10.0, which leads to it not finding Sortablejs.create.

* chore: bump package.json to 1.0.0

Big bump since this fixes a breaking change

* chore: update name of package to avoid conflicts
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

No branches or pull requests

3 participants