Skip to content

Commit 98ba374

Browse files
committed
🐞 Fix AMD file paths. Fixes #1088
Same issue as metafizzy/packery#372 πŸ‘· build v3.0.1 ⬆️ update ev-emitter v1.0.3, fizzy-ui-utils v2.0.2
1 parent 812c3f8 commit 98ba374

File tree

7 files changed

+313
-30
lines changed

7 files changed

+313
-30
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ See [isotope.metafizzy.co](http://isotope.metafizzy.co) for complete docs and de
1313

1414
### CDN
1515

16-
Link directly to [Isotope files on cdnjs](https://cdnjs.com/libraries/jquery.isotope).
16+
Link directly to Isotope files on [npmcdn](https://npmcdn.com).
1717

1818
``` html
1919
<script src="https://npmcdn.com/[email protected]/dist/isotope.pkgd.min.js"></script>

β€Ždist/isotope.pkgd.jsβ€Ž

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Isotope PACKAGED v3.0.0
2+
* Isotope PACKAGED v3.0.1
33
*
44
* Licensed GPLv3 for open source use
55
* or Isotope Commercial License for commercial use
@@ -154,7 +154,7 @@ return jQueryBridget;
154154
}));
155155

156156
/**
157-
* EvEmitter v1.0.2
157+
* EvEmitter v1.0.3
158158
* Lil' event emitter
159159
* MIT License
160160
*/
@@ -163,7 +163,7 @@ return jQueryBridget;
163163

164164
( function( global, factory ) {
165165
// universal module definition
166-
/* jshint strict: false */ /* globals define, module */
166+
/* jshint strict: false */ /* globals define, module, window */
167167
if ( typeof define == 'function' && define.amd ) {
168168
// AMD - RequireJS
169169
define( 'ev-emitter/ev-emitter',factory );
@@ -175,7 +175,7 @@ return jQueryBridget;
175175
global.EvEmitter = factory();
176176
}
177177

178-
}( this, function() {
178+
}( typeof window != 'undefined' ? window : this, function() {
179179

180180

181181

@@ -528,7 +528,7 @@ return getSize;
528528
}));
529529

530530
/**
531-
* Fizzy UI utils v2.0.1
531+
* Fizzy UI utils v2.0.2
532532
* MIT license
533533
*/
534534

@@ -699,7 +699,8 @@ utils.debounceMethod = function( _class, methodName, threshold ) {
699699
// ----- docReady ----- //
700700

701701
utils.docReady = function( callback ) {
702-
if ( document.readyState == 'complete' ) {
702+
var readyState = document.readyState;
703+
if ( readyState == 'complete' || readyState == 'interactive' ) {
703704
callback();
704705
} else {
705706
document.addEventListener( 'DOMContentLoaded', callback );
@@ -2266,7 +2267,7 @@ return Outlayer;
22662267
/* jshint strict: false */ /*globals define, module, require */
22672268
if ( typeof define == 'function' && define.amd ) {
22682269
// AMD
2269-
define( 'isotope/item',[
2270+
define( 'isotope/js/item',[
22702271
'outlayer/outlayer'
22712272
],
22722273
factory );
@@ -2344,7 +2345,7 @@ return Item;
23442345
/* jshint strict: false */ /*globals define, module, require */
23452346
if ( typeof define == 'function' && define.amd ) {
23462347
// AMD
2347-
define( 'isotope/layout-mode',[
2348+
define( 'isotope/js/layout-mode',[
23482349
'get-size/get-size',
23492350
'outlayer/outlayer'
23502351
],
@@ -2710,7 +2711,7 @@ return Item;
27102711
/* jshint strict: false */ /*globals define, module, require */
27112712
if ( typeof define == 'function' && define.amd ) {
27122713
// AMD
2713-
define( 'isotope/layout-modes/masonry',[
2714+
define( 'isotope/js/layout-modes/masonry',[
27142715
'../layout-mode',
27152716
'masonry/masonry'
27162717
],
@@ -2783,7 +2784,7 @@ return Item;
27832784
/* jshint strict: false */ /*globals define, module, require */
27842785
if ( typeof define == 'function' && define.amd ) {
27852786
// AMD
2786-
define( 'isotope/layout-modes/fit-rows',[
2787+
define( 'isotope/js/layout-modes/fit-rows',[
27872788
'../layout-mode'
27882789
],
27892790
factory );
@@ -2852,7 +2853,7 @@ return FitRows;
28522853
/* jshint strict: false */ /*globals define, module, require */
28532854
if ( typeof define == 'function' && define.amd ) {
28542855
// AMD
2855-
define( 'isotope/layout-modes/vertical',[
2856+
define( 'isotope/js/layout-modes/vertical',[
28562857
'../layout-mode'
28572858
],
28582859
factory );
@@ -2899,7 +2900,7 @@ return Vertical;
28992900
}));
29002901

29012902
/*!
2902-
* Isotope v3.0.0
2903+
* Isotope v3.0.1
29032904
*
29042905
* Licensed GPLv3 for open source use
29052906
* or Isotope Commercial License for commercial use
@@ -2918,12 +2919,12 @@ return Vertical;
29182919
'get-size/get-size',
29192920
'desandro-matches-selector/matches-selector',
29202921
'fizzy-ui-utils/utils',
2921-
'./item',
2922-
'./layout-mode',
2922+
'isotope/js/item',
2923+
'isotope/js/layout-mode',
29232924
// include default layout modes
2924-
'./layout-modes/masonry',
2925-
'./layout-modes/fit-rows',
2926-
'./layout-modes/vertical'
2925+
'isotope/js/layout-modes/masonry',
2926+
'isotope/js/layout-modes/fit-rows',
2927+
'isotope/js/layout-modes/vertical'
29272928
],
29282929
function( Outlayer, getSize, matchesSelector, utils, Item, LayoutMode ) {
29292930
return factory( window, Outlayer, getSize, matchesSelector, utils, Item, LayoutMode );
@@ -2936,12 +2937,12 @@ return Vertical;
29362937
require('get-size'),
29372938
require('desandro-matches-selector'),
29382939
require('fizzy-ui-utils'),
2939-
require('./item'),
2940-
require('./layout-mode'),
2940+
require('isotope/js/item'),
2941+
require('isotope/js/layout-mode'),
29412942
// include default layout modes
2942-
require('./layout-modes/masonry'),
2943-
require('./layout-modes/fit-rows'),
2944-
require('./layout-modes/vertical')
2943+
require('isotope/js/layout-modes/masonry'),
2944+
require('isotope/js/layout-modes/fit-rows'),
2945+
require('isotope/js/layout-modes/vertical')
29452946
);
29462947
} else {
29472948
// browser global

β€Ždist/isotope.pkgd.min.jsβ€Ž

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žgulpfile.jsβ€Ž

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ function addBanner( str ) {
5656
var rjsOptimize = require('gulp-requirejs-optimize');
5757

5858
gulp.task( 'requirejs', function() {
59+
var definitionRE = /define\(\s*'isotope\/isotope'(.|\n)+\],/;
5960
var banner = getBanner();
6061
// HACK src is not needed
6162
// should refactor rjsOptimize to produce src
@@ -72,8 +73,14 @@ gulp.task( 'requirejs', function() {
7273
jquery: 'empty:'
7374
}
7475
}) )
75-
// remove named module
76-
.pipe( replace( "'isotope/isotope',", '' ) )
76+
// munge AMD definition
77+
.pipe( replace( definitionRE, function( definition ) {
78+
// remove named module
79+
return definition.replace( "'isotope/isotope',", '' )
80+
// use explicit file paths, './item' -> 'isotope/js/item'
81+
.replace( /'.\//g, "'isotope/js/" );
82+
}) )
83+
.pipe( replace( "define( 'isotope/", "define( 'isotope/js/" ) )
7784
// add banner
7885
.pipe( addBanner( banner ) )
7986
.pipe( rename('isotope.pkgd.js') )

β€Žjs/isotope.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Isotope v3.0.0
2+
* Isotope v3.0.1
33
*
44
* Licensed GPLv3 for open source use
55
* or Isotope Commercial License for commercial use

β€Žpackage.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "isotope-layout",
3-
"version": "3.0.0",
3+
"version": "3.0.1",
44
"description": "Filter and sort magical layouts",
55
"main": "js/isotope.js",
66
"dependencies": {

0 commit comments

Comments
Β (0)