MeteorPackaging / discussions

Ask for Meteor integration help, or discuss Meteor 3rd party library packaging
5 stars 1 forks source link

Review needed for PruneCluster #46

Open mordka opened 8 years ago

mordka commented 8 years ago

Hi, I've volunteered to create PruneCluster official wrapper. It was all right until the latest Meteor 1.2 release. Due to the lack of support for not recognizable assets in api.addFiles my package wrapper started to break.

PackageAPI#addAssets (change required to package.js file): In packages, files added with api.addFiles that have no recognizable extension are no longer added as static assets. You must now use api.addAssets to add a static asset. Package authors must make this change to their package.js files before they can publish from Meteor 1.2, but existing published packages will continue to work. The hidden isAsset: true flag to api.addFiles is now deprecated and throws an error suggesting that you should use addAssets instead.

So I fixed this by removing unneeded assets (such as minified js) from api.addFiles and it's ok now. However, I'd like to get some expert advice whether the package is production ready to avoid any future incidents . Here is the old package.js I still need to remove the lines 23 and 24 But is the rest all right? How about {bare: true}? Won't it cause any problems in the future?

splendido commented 8 years ago

Hello @mordka, to my best knowledge, {bare: true} simply asks to load the file without wrapping its content in a closure and that's not the suggested solution unless there are no other way to access variables defined therein. Btw, I've heard nothing about the bare options possibly being deprecated in a near future. ...but officially no one never heard anything about it! ;-)

Are there any chances you can use some tricks instead of using the bare option? ...for example lets have a look at the jspdf-core-wrapper and how it uses the meteor-pre.js and meteor-post.js files. Also, since it seems you get the meteor files pulled into the official repo, you might have a chance to get the code modified to make exports easier. You might want to read Packaging Existing Libraries on Meteorpedia.