mizzao / meteor-sharejs

Meteor smart package for transparently adding ShareJS editors to an app
MIT License
225 stars 53 forks source link

Ace editor leaks `define` #48

Closed wh0 closed 8 years ago

wh0 commented 9 years ago

I'm using sharejs with another library, xregexp. xregexp tries to define itself if a define function exists, but it logs some errors, because it passes some arguments that sharejs's define doesn't expect.

Anyway, why is ace.js being added with bare: true, and what changes would it take to make sharejs work without the bare flag?

DavidSichau commented 8 years ago

@wh0 Could you point me to the definition of the bare flag?

With the noconflict version of ace we have the problem that we need also require js.

mitar commented 8 years ago

Bare flag is defined Meteor docs.

wh0 commented 8 years ago

Thanks @mitar

bare: http://docs.meteor.com/#/full/pack_addFiles

DavidSichau commented 8 years ago

Thanks for the hint.

However the change of the bare flag does not change anything. The define method of ace is still defined in the global scope.

I will try to switch to the npm package, add load ace as module. This might help to solve this issue.

DavidSichau commented 8 years ago

The problem is still that ace is only written to be used with require js, which is nor compatible to the module system. Therefore the currently only way is to load it to the global namespace. Which leaks also the define.