Giter Site home page Giter Site logo

Add to NPM about zimjs HOT 28 CLOSED

brianbest avatar brianbest commented on May 29, 2024 2
Add to NPM

from zimjs.

Comments (28)

danzen avatar danzen commented on May 29, 2024 3

ZIM is on NPM. Was able to get it running using Browserify. Here are the steps:

Using ZIM with NPM and Browserify
http://browserify.org/

Assuming NodeJS installed with NPM.
https://nodejs.org/

Open Node command prompt and get Browserify:
npm install -g browserify
Marvel at the 139 packages used to make Browserify - arrrg.

Get ZIM (which gets CreateJS too)
npm install -g zimjs

Change to the node_modules/zimjs/ directory and:
browserify code.js -o bundle.js

run code.html in browser

from zimjs.

neo avatar neo commented on May 29, 2024 1

so we would either need to do a fork of createjs and fix it on their side first, or wait until they fix their npm implementation.

from zimjs.

danzen avatar danzen commented on May 29, 2024 1

We have now updated our npm to be more robust. https://www.npmjs.com/package/zimjs. There is now a repo of templates for Vue, Svelte, React and Angular here https://github.com/yoanhg421/zimjs-templates

from zimjs.

danzen avatar danzen commented on May 29, 2024

Sure... it will be zimjs - just created an organization...

from zimjs.

brianbest avatar brianbest commented on May 29, 2024

from zimjs.

danzen avatar danzen commented on May 29, 2024

Just started the package... continuing to work through details.

from zimjs.

neo avatar neo commented on May 29, 2024

@danzen let me know if you need help with this 😬

from zimjs.

danzen avatar danzen commented on May 29, 2024

Sure @neo I will message you on the FB...

from zimjs.

danzen avatar danzen commented on May 29, 2024

Okay - we have a plan for the new year... for ZIM HEP (7).

from zimjs.

danzen avatar danzen commented on May 29, 2024

Hi @brianbest, @neo has been working on this a little - would you like to take a look master...neo:master and offer any suggestions. He says there is still work to do and points to an issue that CreateJS is not set up either - CreateJS 2 apparently will be. We are trying to make it so that ZIM can still function the way it does now with script tags to the libraries - or be brought in with includes, etc. Any recommendations or even a confirmation that it works... would be great! Thanks and hope all is well!

from zimjs.

neo avatar neo commented on May 29, 2024

another solution would be we wait for createjs to support npm first as zim depends on createjs anyway

from zimjs.

josiahbryan avatar josiahbryan commented on May 29, 2024

Any progress on this? Can I npm install zimjs yet?

from zimjs.

josiahbryan avatar josiahbryan commented on May 29, 2024

createjs is on npm ... https://www.npmjs.com/package/createjs

from zimjs.

danzen avatar danzen commented on May 29, 2024

Thanks @josiahbryan - will see what we can do for version 10 due out in a beta hopefully this week.

from zimjs.

wutschkef42 avatar wutschkef42 commented on May 29, 2024

@danzen Hi Dan, I also really need zim on npm.. It would be great if you could make that happen for version 10 :)

from zimjs.

danzen avatar danzen commented on May 29, 2024

Well... got stalled again - I just don't understand this stuff. It seems like the CreateJS version on NPM just lets you download all the CDN files - and is not in a module format. So, when I try and do a test page, it does not know how to import CreateJS. So should we be trying to do the same - just let NPM give you the latest ZIM file - not in module format? And you would still use script tags on your main file to bring in CreateJS and ZIMjs? If anyone has any advice that would be great. I have a message out to @neo but I know he is busy with a very active job...

from zimjs.

neo avatar neo commented on May 29, 2024

This is hard if not impossible as I don't think the dependency createjs is done the right way on npm.

from zimjs.

danzen avatar danzen commented on May 29, 2024

Perhaps someone can confirm that the CreateJS npm is not giving us what we need - from the looks of it... that was my conclusion but I could be wrong. If I could get a confirmation... then perhaps working through that on their github would help.

from zimjs.

neo avatar neo commented on May 29, 2024

the line before this mentions that it "can not yet be used with RequireJS, CommonJS, etc."
and I think this issue also kinda describe the problem, not 100% sure if that's the problem tho: CreateJS/Combined#12

from zimjs.

danzen avatar danzen commented on May 29, 2024

Is it worth it to anyone to have a ZIM npm that just gives you the CDN version? I don't think so, I mean, I would rather not have to update another location just for that... so the advice would be to work with CreateJS to get them in proper format - and NEO, is that what you started to do by forking CreateJS, etc. did you feel you got it into a format that actually worked? When I tried to run the code you put together, I don't think I got it working....

from zimjs.

danzen avatar danzen commented on May 29, 2024

Had an idea... we like to run our CreateJS anyway because we have some current things in there not on their CDN - so... why don't we adjust CreateJS so it can be read like a module and ZIM so it can be read like a module and include them both in the same NPM as they have to work together anyway. Does that sound like a good plan?

from zimjs.

danzen avatar danzen commented on May 29, 2024

Okay.. ZIMjs is on NPM as a test. npm install zimjs It makes its dependency @danzen/createjs and both are running as modules but each is just running a test function. I am now planning on putting all of ZIM and all of Createjs in place of the zim and createjs test objects. When I tried, I could not run from node because there is no window and no console, etc. So my question is... once it gets browersfied, or whatever will it all work? I have some global functions like zog() and zid() - since they are not stored on the zim object I suspect they will not work? Is there a work around? I also use them in hundreds of places inside ZIM as global functions. Thoughts? I guess the answer is reprogram them - now that we use ZIM without the namespace, the same system would still let them be global.

from zimjs.

ajerni avatar ajerni commented on May 29, 2024

Can we use ZIM as a React component now? For example wit Gatsby.js etc.

from zimjs.

danzen avatar danzen commented on May 29, 2024

Hi @ajerni - I am not sure - please try it if you have a moment and let us know. We had a some people using ZIM with React and they got it working. If you want, you are welcome to come in to https://zimjs.com/slack and ask the folks. We would love to have you there!

from zimjs.

ajerni avatar ajerni commented on May 29, 2024

Here is what I try to do: https://github.com/ajerni/gatsby-zim

from zimjs.

danzen avatar danzen commented on May 29, 2024

Excellent presentation... will have a look - it would be cool to get ZIM working with PWA.

from zimjs.

iyobo avatar iyobo commented on May 29, 2024

I still don't think zim is a clean npm module at the moment given the need for some of those manual build steps.
I would suggest perhaps putting all necessary build steps into a postinstall script to make the zim install process seamless and just work like most mature npm modules.

from zimjs.

danzen avatar danzen commented on May 29, 2024

@iyobo - that would be great - just not sure what is supposed to happen. For those that work with node it is probably a simple thing so you are welcome to let us know what to do. Let us know if we can help in any way. If you want to work "off-line" with us... we have a Slack channel at https://zimjs.com/slack and a #technology topic that we can add you to. Cheers.

from zimjs.

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.