Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add to NPM #8

Closed
brianbest opened this issue Apr 20, 2017 · 28 comments
Closed

Add to NPM #8

brianbest opened this issue Apr 20, 2017 · 28 comments

Comments

@brianbest
Copy link

Hey @danzen can you add Zim to npmjs registry?

@danzen
Copy link
Owner

danzen commented May 1, 2017

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

@brianbest
Copy link
Author

brianbest commented May 1, 2017 via email

@danzen
Copy link
Owner

danzen commented May 26, 2017

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

@neo
Copy link

neo commented Nov 19, 2017

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

@danzen
Copy link
Owner

danzen commented Nov 30, 2017

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

@danzen
Copy link
Owner

danzen commented Dec 8, 2017

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

@danzen danzen closed this as completed Dec 8, 2017
@danzen danzen reopened this Dec 8, 2017
@danzen
Copy link
Owner

danzen commented May 2, 2018

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!

@neo
Copy link

neo commented May 2, 2018

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

@josiahbryan
Copy link

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

@josiahbryan
Copy link

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

@danzen
Copy link
Owner

danzen commented Feb 5, 2019

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

@wutschkef42
Copy link

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

@danzen
Copy link
Owner

danzen commented Feb 9, 2019

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...

@neo
Copy link

neo commented Feb 11, 2019

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

@neo
Copy link

neo commented Feb 11, 2019

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.

@danzen
Copy link
Owner

danzen commented Feb 11, 2019

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.

@neo
Copy link

neo commented Feb 11, 2019

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

@danzen
Copy link
Owner

danzen commented Feb 12, 2019

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....

@danzen
Copy link
Owner

danzen commented Feb 15, 2019

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?

@danzen
Copy link
Owner

danzen commented Mar 13, 2019

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.

@danzen
Copy link
Owner

danzen commented Mar 16, 2019

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

@ajerni
Copy link

ajerni commented Aug 17, 2019

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

@danzen
Copy link
Owner

danzen commented Aug 18, 2019

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!

@ajerni
Copy link

ajerni commented Aug 18, 2019

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

@danzen
Copy link
Owner

danzen commented Aug 18, 2019

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

@danzen danzen closed this as completed Jan 21, 2020
@iyobo
Copy link

iyobo commented May 14, 2020

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.

@danzen
Copy link
Owner

danzen commented May 15, 2020

@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.

@danzen danzen reopened this May 15, 2020
@danzen danzen closed this as completed Sep 28, 2020
@danzen
Copy link
Owner

danzen commented Aug 18, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants