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

Bundle the plugin as a single js and css file for distribution #326

Open
planemad opened this issue Oct 14, 2018 · 0 comments
Open

Bundle the plugin as a single js and css file for distribution #326

planemad opened this issue Oct 14, 2018 · 0 comments

Comments

@planemad
Copy link

planemad commented Oct 14, 2018

Super useful plugin ❤️ Using the plugin currently requires including 3 CSS files and 5 JS files.

Since all the 8 files are required for the plugin to work correctly, bundling them as a single CSS and JS file will make it easier to distribute and spread adoption along with having it as an npm module #325.

@planemad planemad changed the title Single js and css Bundle the plugin as a single js and css file for distribution Oct 14, 2018
santhoshtr added a commit that referenced this issue May 14, 2021
Changes
=======

Introduce rollup based bundler to create single js, css files.
This allows easy usage and no need to include every source code files
explicitly. Fixes issue #326

Add language-data as dependency to the library
Instead of using scripts to clone the language-data repo and then create
our javascript files from it, directly use language-data as dev-dependency.
The final bundle will include language-data. So it is not an external
dependency for bundle.

Approach
========

To avoid any breakage in consumers, no change in jquery plugins were
introduced. No method signature change too. All plugin definitions
moved to src/index.js. index.js also import the language-data
and alias that to $.uls.data.

So, jquery.uls.data.js and jquery.uls.data.utils.js files were deleted.
The scripts to generate this files was also deleted.

All other changes in jquery.uls.*.js is just indendation change
because of the removal of IIFE. The resuling bundle will have IIFE.
IIFE block has to be removed to expose the classes for exporting
as modules.

Examples were updated to refer javascript, css and styles from dist
folder.

Future steps
============

Introduction of build step allows

* To modernize the codebase to new versions of javascript
* To drop jquery dependency and optionally keep the jquery plugins
* Remove grunt based CI system
Abijeet pushed a commit that referenced this issue Jul 17, 2021
Changes
=======

Introduce rollup based bundler to create single js, css files.
This allows easy usage and no need to include every source code files
explicitly. Fixes issue #326

Add language-data as dependency to the library
Instead of using scripts to clone the language-data repo and then create
our javascript files from it, directly use language-data as dev-dependency.
The final bundle will include language-data. So it is not an external
dependency for bundle.

Approach
========

To avoid any breakage in consumers, no change in jquery plugins were
introduced. No method signature change too. All plugin definitions
moved to src/index.js. index.js also import the language-data
and alias that to $.uls.data.

So, jquery.uls.data.js and jquery.uls.data.utils.js files were deleted.
The scripts to generate this files was also deleted.

All other changes in jquery.uls.*.js is just indendation change
because of the removal of IIFE. The resuling bundle will have IIFE.
IIFE block has to be removed to expose the classes for exporting
as modules.

Examples were updated to refer javascript, css and styles from dist
folder.

Future steps
============

Introduction of build step allows

* To modernize the codebase to new versions of javascript
* To drop jquery dependency and optionally keep the jquery plugins
* Remove grunt based CI system
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant