blueimp / Gallery

blueimp Gallery is a touch-enabled, responsive and customizable image & video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers. It features swipe, mouse and keyboard navigation, transition effects, slideshow functionality, fullscreen support and on-demand content loading.
https://blueimp.github.io/Gallery/
Other
3.75k stars 983 forks source link

Add Rollup #227

Closed cocoastorm closed 6 years ago

cocoastorm commented 6 years ago

Adds Rollup to build JS files.

It is configured to bundle the javascript files in umd format. Additionally, jQuery has been added as a peer dependency but it isn't required and is configured with Rollup as an external module, as to not include it with the bundle.

Some Context: I was having some trouble testing my front end application with Jest, due to this line

TypeError: Cannot read property 'helper' of undefined

I wasn't sure why, but I suspect it's to do with Jest being in a Node.js environment. In any case, I thought it would be useful to have this automated with a module bundler (Rollup).

Changes:

A concern I have are the optional script files, one can include to expand functionality, I wasn't sure how to bundle these with rollup and they are included by default when building the bundle(s). But as they are rewritten with es5, they won't really work natively in browsers that don't support es5 yet...

If you have any suggestions for any changes feel free to tell me!

Thanks!

blueimp commented 6 years ago

Thanks for your contribution @khoanguyen96 !

Merging all those changes would likely break someones workflow, as they might rely on the AMD module loader being there, or even the source files being at the current location.

That being said, the world has moved on and writing in future versions of ECMAScript and transpiling and bundling it for production usage is the norm and Rollup a good bundler.

I would however prefer if this could be kept and maintained in a separate repository. So if you are willing to maintain your fork, I'd add a link to the README of this repo pointing to your fork instead.

Federico39 commented 6 years ago

Dear Sebastian

Thanks for taking the time to write me. Very sorry, I have to give up, am unable to follow the instructions. May in future find someone who can do the prep work for me. Am also prepared to pay for the work, I like your work and would never show it without reference to you.

Very happy to live seventy nine year in August. Kind regards Federico.

On Mon, Jan 15, 2018 at 11:00 AM, Sebastian Tschan <notifications@github.com

wrote:

Thanks for your contribution @khoanguyen96 https://github.com/khoanguyen96 !

Merging all those changes would likely break someones workflow, as they might rely on the AMD module loader being there, or even the source files being at the current location.

That being said, the world has moved on and writing in future versions of ECMAScript and transpiling and bundling it for production usage is the norm and Rollup a good bundler.

I would however prefer if this could be kept and maintained in a separate repository. So if you are willing to maintain your fork, I'd add a link to the README of this repo pointing to your fork instead.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/blueimp/Gallery/pull/227#issuecomment-357635313, or mute the thread https://github.com/notifications/unsubscribe-auth/AHzGdSyAhBn4eGMGmU5dyAppV9JQbfGiks5tKyG5gaJpZM4RU4T- .

-- saludos andaluces Federico

cocoastorm commented 6 years ago

Hey @blueimp!

I totally agree with how merging this would definitely break someone's workflow. I wouldn't want that to have this merged and ruin someone's day due to missing source files and whatnot.

I'm definitely okay with keeping this maintained as a separate source repository! I've included a few disclaimers in the README about it becoming a forked version.

Let me know if there are any changes/suggestions you have for me!

Cheers! Khoa

blueimp commented 6 years ago

Thanks Khoa, I've added the link to your fork here: https://github.com/blueimp/Gallery#notable-forks