Skip to content

knockout-sortable - prioritise global dependencies if available - #737

Merged
RubaXa merged 1 commit into
SortableJS:masterfrom
petemill:patch-1
Jan 18, 2016
Merged

RubaXa merged 1 commit into
SortableJS:masterfrom
petemill:patch-1

Conversation

@petemill

Copy link
Copy Markdown
Contributor

This PR changes the dependency resolution logic of knockout-sortable.js to first look for knockout / Sortable global references, before trying require and AMD. This allows the script to be used in a require / AMD environment but still allowing knockout (and/or Sortable) to be referenced globally.

Use Case

It can be advantageous, even when in a browserify / requireJS / AMD environment, to include separate scripts to a public CDN for popular libraries, like knockout in order to take advantage of cross-site caching of these libraries. In this case, large dependencies like knockout do not need to increase the size of a generated JS build (in the case of browserify) or cause additional http requests (in the case of AMD / requireJS).

@RubaXa RubaXa added the ko label Jan 18, 2016
@RubaXa

RubaXa commented Jan 18, 2016

Copy link
Copy Markdown
Collaborator

@srosengren Code Review?

@srosengren

Copy link
Copy Markdown
Contributor

I like the idea since I've had this usecase myself in some projects.

Code looks good.

Merge.

@RubaXa

RubaXa commented Jan 18, 2016

Copy link
Copy Markdown
Collaborator

👌

RubaXa added a commit that referenced this pull request Jan 18, 2016
knockout-sortable - prioritise global dependencies if available
@RubaXa
RubaXa merged commit 6963281 into SortableJS:master Jan 18, 2016
@petemill
petemill deleted the patch-1 branch February 3, 2016 19:57
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.

3 participants