Skip to content

Commit

Permalink
Merge pull request #67 from mendix/isolate-webpack
Browse files Browse the repository at this point in the history
[WC-1720] fix: isolate webpack runtime to prevent conflicts with other bundles
  • Loading branch information
r0b1n authored May 4, 2023
2 parents b2eb4b3 + e322e00 commit 8bb9c87
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "LabelSelect",
"version": "4.5.9",
"version": "4.6.0",
"description": "With this widget you can easily create/assign/remove objects (for example labels) to/from an object.",
"license": "Apache-2",
"author": "",
Expand Down
8 changes: 3 additions & 5 deletions src/LabelSelect/widget/LabelSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ define([
], function(declare, _WidgetBase, _TemplatedMixin, dom, domClass, domStyle, domConstruct, dojoArray, lang, widgetTemplate, _jQuery) {
"use strict";

window.jQuery = window.$ = _jQuery;

require(["./lib/jquery-migrate", "jquery-ui", "jquery-ui/ui/widgets/autocomplete", "jquery-ui/ui/widgets/menu", "jquery-ui/ui/widgets/selectable", "./lib/tag-it",]);

return declare("LabelSelect.widget.LabelSelect", [_WidgetBase, _TemplatedMixin], {
Expand Down Expand Up @@ -138,19 +136,19 @@ define([
value = tagObj.get(this._tagAttribute);
color = (this._colorAttribute) ? dom.escapeString(tagObj.get(this._colorAttribute)) : null;

$("#" + this.id + "_ListBox").tagit("createTag", value, additionalClass, duringInitialization, color);
_jQuery("#" + this.id + "_ListBox").tagit("createTag", value, additionalClass, duringInitialization, color);
}, this);

this._executeCallback(callback, "_renderCurrentTags");
},

_startTagger: function(options) {
if (options) {
$("#" + this.id + "_ListBox").tagit(options);
_jQuery("#" + this.id + "_ListBox").tagit(options);
} else {
//fallback
console.warn("No options found, running defaults");
$("#" + this.id + "_ListBox").tagit();
_jQuery("#" + this.id + "_ListBox").tagit();
}
},

Expand Down
2 changes: 1 addition & 1 deletion src/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="LabelSelect" version="4.5.9" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="LabelSelect" version="4.6.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="LabelSelect/LabelSelect.xml"/>
</widgetFiles>
Expand Down
9 changes: 7 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ module.exports = {
filename: `${widgetName}/widget/[name].js`,
chunkFilename: `${widgetName}/widget/${widgetName}[id].js`,
libraryTarget: "amd",
publicPath: "/widgets/"
publicPath: "/widgets/",
jsonpFunction: "label_selector_jsonp"
},
devtool: false,
mode: "production",
Expand All @@ -26,6 +27,10 @@ module.exports = {
new webpack.LoaderOptionsPlugin({ debug: true }),
new CleanWebpackPlugin({ cleanOnceBeforeBuildPatterns: "dist/tmp" }),
new CopyWebpackPlugin([ {context: "src", from: "**/*.{xml,css,html,png,gif}", debug: true} ], { copyUnmodified: true }),
new ZipPlugin({ path: `../../${widgetVersion}`, filename: widgetName, extension: "mpk" })
new ZipPlugin({ path: `../../${widgetVersion}`, filename: widgetName, extension: "mpk" }),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
]
};

0 comments on commit 8bb9c87

Please sign in to comment.