Recent commit totally breaks global configuration / renders the plug-in unusable.
m-andrew-albright opened this issue · 6 comments
This is the commit: 3efe2f3
My application recently updated your package to the latest version (master) and all of our <aurelia-froala>
elements missing. They were not initializing or showing up anywhere. In debugging, I found that the global configuration of the plug-in was not being executed in my main.js while bootstrapping aurelia.
.plugin('froala/aurelia-froala-editor', config => {
// THIS BREAKPOINT WAS NOT BEING HIT:
debugger;
config.addDefaltOptions({
toolbarButtons: ['undo','redo','|','bold','italic','underline','strikethrough','outdent','indent','clearFormatting','insertTable','html'],
toolbarButtonsXS: ['undo','redo','-','bold','italic','underline'],
initOnClick: false,
fontFamily: {
'Open Sans,sans-serif': 'Open Sans',
},
fontFamilySelection: true,
});
})
I noticed that src/index.js changed substantially, from
import "font-awesome/./css/font-awesome.min.css!";
import $ from "jquery";
import * as froala from "froala-editor/./js/froala_editor.min";
import "froala-editor/css/froala_editor.min.css!";
import "froala-editor/css/froala_style.min.css!";
export function configure(aurelia, config) {
aurelia.globalResources('./aurelia-froala');
let c = {
setLicense: license => {
$.FroalaEditor.DEFAULTS.key = license;
},
addPlugin: name => Promise.all(
[System.import(`froala-editor/js/plugins/${name}.min`, __moduleName).then(m=> m()),
System.import(`froala-editor/css/plugins/${name}.css!`, __moduleName).catch(e => {})]),
global: callback => {
callback($.FroalaEditor);
},
addDefaltOptions: options => {
$.FroalaEditor.DEFAULTS = $.extend($.FroalaEditor.DEFAULTS, options);
},
addLanguage: (language, additionalTranslations) => {
return System
.import(`froala-editor/js/languages/${language}`, __moduleName)
.then(() => additionalTranslations && Object.assign($.FE.LANGUAGE[language].translation, additionalTranslations))
}
};
froala.default();
config(c);
}
to now this:
export function configure(aurelia, config) {
aurelia.globalResources('./froala-editor');
}
I had to downgrade to 2.3.4-5 for my application to continue functioning.
That is right. Last release has changed the component name to froala-editor
and we also removed those defaults in order to make it Webpack compatible. Neither of Font Awesome, Jquery or Froala should be imported by the component, but by the main application.
How do I set up my global configuration now? The config in main.js is not
being initialized at all. Does that look different now as well?
On Tue, Nov 1, 2016 at 8:19 AM, Stefan Neculai notifications@github.com
wrote:
That is right. Last release has changed the component name to
froala-editor and we also removed those defaults in order to make it
Webpack compatible. Neither of Font Awesome, Jquery or Froala should be
imported by the component, but by the main application.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#29 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEuJrfe3eZSsegYI2vALaQ9DKIZv7qNlks5q5zxUgaJpZM4KmEOQ
.
For now there is no way to setup a global config. I am sorry if it creates any troubles to your integration, but having this to work with Webpack as well is critical.
I don't understand how webpack compatibility has anything to do with the global configuration; most plug-ins allow a global configuration and are totally agnostic to the package management / module loading infrastructure you are using.
I'm not saying you're wrong; I just don't follow because many other packages don't have this limitation.
This is the first version for this that works with both Webpack and JSPM. There is definitely room for improvement and all contributions are welcomed.
Thanks for the responses; I may spend some personal time on this. For now
I will continue to use the previous version.
On Wed, Nov 2, 2016 at 10:29 AM, Stefan Neculai notifications@github.com
wrote:
This is the first version for this that works with both Webpack and JSPM.
There is definitely room for improvement and all contributions are welcomed.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#29 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEuJrUzmbPidMKq_mrD7OLAhr-V0mFJZks5q6KxJgaJpZM4KmEOQ
.