Code Monkey home page Code Monkey logo

Comments (19)

ccpandhare avatar ccpandhare commented on July 20, 2024

Yes, It should work!

from image-sequencer.

ccpandhare avatar ccpandhare commented on July 20, 2024

There's a small problem here:
https://runkit.com/embed/epjvm3wepv8c

TypeError: ImageSequencer is not a function

from image-sequencer.

ccpandhare avatar ccpandhare commented on July 20, 2024

Is this still waiting for npmjs to update?

from image-sequencer.

jywarren avatar jywarren commented on July 20, 2024

from image-sequencer.

ccpandhare avatar ccpandhare commented on July 20, 2024

I realized we have the same issue as in fisheyegl/#17
We are requiring in ./dist/image-sequencer.js which returns an empty object {}. That is why the RunKit isn't working.

While testing we usually do require('./src/ImageSequencer.js') and not require('./dist/ImageSequencer.js'). The latter returns an empty object, the former returns the intended Image Sequencer function.

from image-sequencer.

ccpandhare avatar ccpandhare commented on July 20, 2024

Is there a workaround for this such that browserify produces a file which can be both used in Browser as well as required in Node?

from image-sequencer.

jywarren avatar jywarren commented on July 20, 2024

from image-sequencer.

ccpandhare avatar ccpandhare commented on July 20, 2024

I already am instantiating according to the presence of window. That's why :

  • ./src/ImageSequencer.js can be required in Node.js
  • ./dist/image-sequencer.js can be run in Browser

Maybe this has to do with the way Browserify handles everything, I am not sure...

from image-sequencer.

ccpandhare avatar ccpandhare commented on July 20, 2024

What would happen if we changed package.json to:

...
main: "src/ImageSequencer.js"
...

?

Whoever is using npm will be require()-ing Image Sequencer, so it should work for everyone...
Is ./dist/image-sequencer.js supposed to be served by npm, or by a CDN?

from image-sequencer.

jywarren avatar jywarren commented on July 20, 2024

from image-sequencer.

ccpandhare avatar ccpandhare commented on July 20, 2024

Yes I have tried it! It works!

npm i git+https://github.com/ccpandhare/image-sequencer.git#npm

from image-sequencer.

jywarren avatar jywarren commented on July 20, 2024

from image-sequencer.

ccpandhare avatar ccpandhare commented on July 20, 2024

I have merged the PR ( #84 ).
I don't have publish privileges, So I can't bump the version, so I request you to publish the new version!
It must work this time :-)

from image-sequencer.

jywarren avatar jywarren commented on July 20, 2024

OK, i published but then noticed #84 failed tests? Can you figure that out?

https://www.npmjs.com/package/image-sequencer

Thanks!

from image-sequencer.

ccpandhare avatar ccpandhare commented on July 20, 2024

I checked TravisCI. #84 had passed. The build didn't fail, I think the "cross" is shown on the commit in #84 because I merged it in before the TravisCI build completed.

from image-sequencer.

jywarren avatar jywarren commented on July 20, 2024

from image-sequencer.

ccpandhare avatar ccpandhare commented on July 20, 2024

https://runkit.com/embed/hvtvir55gm5v

It works now!

from image-sequencer.

ccpandhare avatar ccpandhare commented on July 20, 2024

Closing this issue.

from image-sequencer.

jywarren avatar jywarren commented on July 20, 2024

Great, can you add this to the README too?

from image-sequencer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.