awsp / handsontable-meteor

Handsontable in MeteorJS
MIT License
14 stars 5 forks source link

working with meteor 1.3 and new npm module system #23

Open dcsan opened 8 years ago

dcsan commented 8 years ago

I upgraded to meteor 1.3 and this package stopped working, I guess since they have their own way to work with npm packages now.

https://github.com/handsontable/handsontable/issues/2076

I noticed you bundled a few other files in your package, and that there's something odd about the original package https://github.com/handsontable/handsontable/issues/2076

I started some discussion here: https://forums.meteor.com/t/meteor-1-3-early-beta-now-available/14723/113?u=dcsan

awsp commented 8 years ago

Thanks for reporting! Yea, definitely need to work on this package as I believe meteor will be adapting ES2015 syntax for files importing. Haven't got a chance to try out the 1.3 beta yet. Will come back soon after trying the beta. Tho we still have some time from now to the release RC. :-)

dcsan commented 8 years ago

so i'm guessing that meteor can't import because there is no 'main' field in the original HOT repo's package.json. Possibly adding a definition there may fix things, but i'm not sure what to define as the 'entry point'.

dcsan commented 8 years ago

I notice your package imports a number of things https://github.com/awsp/handsontable-meteor/blob/master/package.js#L14-L26

so its not using the npm module for HOT? benjamin from MDG replied about that packaging here https://forums.meteor.com/t/meteor-1-3-early-beta-now-available/14723/124

but I don't know where the HOT module comes from, I can't see it in npm https://www.npmjs.com/browse/keyword/handsontable

npm install handsontable/handsontable apparently just pulls it directly from the github repo? I didn't know about that feature of npm

more discussion https://github.com/handsontable/handsontable/issues/2076#issuecomment-169796287

awsp commented 8 years ago

As far as I am concerned, there is no NPM version of Handsontable. (If I am not mistaken) HOT is loaded from a Brower version of Handsontable with modification to its source since HOT exposes itself to the window object. That obviously make Meteor complains about Handsontable not found. This package simply modify HOT so it is available to Meteor global scope only.

For Meteor 1.3 where all the export default and import for modules loading take place, I will have to find a way to do that since Handsontable is technically not a NPM module. Tho it is still not sure how meteor will implement for bower package, (if it is the case in webpack, we could have a chance using css loader and import into ES6 script, but it still remains unknown. )

Ideas welcome!

joaopiopedreira commented 8 years ago

Hi @awsp ,

Just updated my app to meteor 1.3 beta12 and got the errors mentioned above.

Any ideas on when you'll have a workaround for this? My app is in prod with your package (on meteor 1.2.1) but I can't wait to try meteor 1.3.

Many thanks for your help.

awsp commented 8 years ago

Okay, seems recently there is a npm version of Handsontable published. Will add it to this package soon. :D Thanks for reporting!

awsp commented 8 years ago

It looks like for meteor 1.3, you don't really need a package to use Handsontable since you could natively import it to your meteor application.

I have created a demo https://github.com/awsp/handsontable-meteor-1.3-react

Note: I am still figuring out the way to import those assets like css or so in Meteor 1.3.

Hope it helps!

hyperh commented 8 years ago

@awsp Thanks for your demo, but I'm still having trouble getting it to work in Meteor 1.3.2. I get the error:

install.js:78 Uncaught Error: Cannot find module 'moment'

I opened an issue here: awsp/handsontable-meteor-1.3-react#1

awsp commented 8 years ago

Could you try meteor npm install moment --save and see if it works?

Sent from my iPhone

On Apr 16, 2016, at 1:56 AM, hyperh notifications@github.com wrote:

@awsp Thanks for your demo, but I'm still having trouble getting it to work. I get the error:

install.js:78 Uncaught Error: Cannot find module 'moment' ― You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub

hyperh commented 8 years ago

@awsp The issue can be fixed like this. https://github.com/handsontable/handsontable/issues/3407#issuecomment-210876728