Comments (17)
Yes, I need to test Packery with Require JS
from packery.
Ok, please let us know about the outcome...
from packery.
Part of the problem here is that the eventie
and eventEmitter
dependencies both include shim code that uses define
to define the module when requirejs is loading it, and doesn't set a global window.EventEmitter
.
However, Packery code depends on these libraries via eg window.EventEmitter
. .. But that doesn't get set when loading the deps via requirejs. And RequireJS' shim config doesn't provide a way of forcing that to be set. That is, the shim config is completely ignored if the file, when loaded, uses define(factory)
. Argh.
@desandro Are you completely against using RequireJS for packery, if you can generate a build (w/ almond) that doesn't require clients to use RequireJS? Alternatively, could you wrap the 4 modules of packery in a UMD wrapper? https://github.com/umdjs/umd/blob/master/amdWeb.js
Right now I think the only option for RequireJS users to make this work is to intentionally pollute the global scope or include Packery deps outside of AMD. Or, what I'll likely do, copy and paste packery code into an amd-comatible module. But then I won't be able to incorporate new changes very easily.
I will buy an org license if @metafizzy can advise us to success here :)
from packery.
Are you completely against using RequireJS for packery
Nope. I have been working on adding AMD support to all the dependencies and working up. This is a work in progress.
from packery.
Thanks for the response and the project itself, @desandro. Glad to hear support is coming! My project is here and defines an AMD module that gets access to Packery through assumed global scope. I'll watch this thread and update as I can to load via AMD. https://github.com/gobengo/streamhub-packery
Would you like any help? Perhaps in migrating any deps that you don't author?
Or should I just check back in a certain ETA?
from packery.
Just keep watching this tracker.
from packery.
Brilliant to hear that AMD support is on the way for such a great library @desandro, thanks!
Have you got any sort of update on how far away it might be? Watching this thread with eager anticipation ;)
from packery.
Any news about this ?
from packery.
Hi, we payed the licence and really need to support AMD through RequireJS. Is there an ETA for this fix?
from packery.
Any update on this?
from packery.
++
from packery.
+1 - would be so nifty to have
from packery.
+1
from packery.
I'm looking for feedback on how to best set up RequireJS dependencies in my components. Help me out! See https://github.com/desandro/requirejs-bower-homework
from packery.
Support for RequireJS has been added in v1.1.0. See http://packery.metafizzy.co/appendix.html#requirejs
I realize it's a bit of a pain to install with Bower and set up config, but it's for the best!
Try it out and report back if you have any trouble.
from packery.
Good news! 😸 packery.pkgd.js is now being built with RequireJS. This means you can require packery.pkgd.js
and not have to worry about getting all the dependencies. Proper docs at packery.metafizzy.co/appendix.html#requirejs
Currently, the RequireJS optimizer outputs packery.pkgd.js
with a named module masonry/masonry
. This means you need to actually require two modules in order to use Masonry.
requirejs( [
// require the file
'path/to/packery.pkgd.js',
// require the named module
'packery/js/packery'
// two parameters, packeryPkg is undefined
// Packery is the working module
], function( packeryPkg, Packery ) {
new Packery('#container');
});
One solution is to remove the naming of packery/js/packery
Please chime in if you have a preference either way.
from packery.
Sweet! I'll try it this weekend, thank you.
from packery.
Related Issues (20)
- Some elements are not being placed in 2 columns everytime
- Bug while open packery galery on Ipad
- How do i sort by tabindex?
- Custom Drop Zone : How to define a different drop zone. HOT 1
- Saving the order in the database HOT 1
- How to prevent grid size from expanding when dragging an item outside of its current dimensions? HOT 3
- Packery results in significant cumulative shift score HOT 3
- access gaps array with jQuery init HOT 1
- Activation of the packery without changing the positions of the layouts HOT 2
- laravel mix/webpack ERROR Module not found: Error: Can't resolve 'jquery' HOT 2
- Let user leave gaps between tiles and disable stacking stamped items (packery 2 or 1)
- How can I fix the size of the canvas?
- Packery and Livewire with pagination
- rowHeight set to tallest item
- React with Packery some strange issues
- Appended and Prepended with ImagesLoaded
- packery draggabilly: prevent from dropping over a .stamp.non-drop item. HOT 2
- dragItemPositioned no longer triggering HOT 1
- Draggable with custom (user inputted) elements HOT 1
- Feature request: Rotate items
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packery.