michaelbushe / cytoscape-angular

Angular component for Ctyoscape graphs.
MIT License
16 stars 16 forks source link

Cytoscape is giving error for undefined value #3

Open kultigin opened 3 years ago

kultigin commented 3 years ago

I was trying cytoscpae-angular in StackBlitz. I injected the dependency which installed it's own dependencies, Cytoscape.js and primeng. Then I imported the CytoscapeAngularModule in the app.module.ts. I get this error

Unexpected value 'undefined' imported by the module 'CytoscapeAngularModule' When I was importing all the modules of the project also, all the primeng modules are referred as undefined.

I tried even an older version of primeng but didn't work. What is the fix and which versions of dependencies should be used? a list will be helpful in the home page.

michaelbushe commented 3 years ago

I'll try to reproduce and update the docs as needed. Thank you.

tabuckner commented 3 years ago

I wonder if it's because the library doesnt declare primeng as a dependency (even a peer dependency). I think that's required for angular libraries built like this one w/ the CLI, right?

michaelbushe commented 3 years ago

Yes, that sounds right. Did you try the most recent version where you can just copy the /example directory? Iā€™m hoping that simplifies things by moving it out of the multi-project.

On Tue, Jul 27, 2021 at 1:03 PM Taylor Buckner @.***> wrote:

I wonder if it's because the library doesnt declare primeng as a dependency (even a peer dependency). I think that's required for angular libraries built like this one w/ the CLI, right?

ā€” You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/michaelbushe/cytoscape-angular/issues/3#issuecomment-887759871, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABJB4RLEJRUATWZUHXSRNTTZ37HXANCNFSM45ALD2YA .

-- Mike Bushe @.*** +1-508-625-1235

kultigin commented 3 years ago

I have not yet actually we went back to using the javascript version. I will separately try this though not sure I understood. Do you want me to try manually putting the folders?

tabuckner commented 3 years ago

Yes, that sounds right. Did you try the most recent version where you can just copy the /example directory? Iā€™m hoping that simplifies things by moving it out of the multi-project. On Tue, Jul 27, 2021 at 1:03 PM Taylor Buckner @.> wrote: I wonder if it's because the library doesnt declare primeng as a dependency (even a peer dependency). I think that's required for angular libraries built like this one w/ the CLI, right? ā€” You are receiving this because you commented. Reply to this email directly, view it on GitHub <#3 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABJB4RLEJRUATWZUHXSRNTTZ37HXANCNFSM45ALD2YA . -- Mike Bushe @. +1-508-625-1235

I think the changes needed to align this project w/ best practices for Angular libraries is pretty simple. The benefits are far outweighed by the improvements in Developer Experience from my viewpoint.

Are there other issues w/ the project that are better suited to the seed project approach you're describing?

tabuckner commented 3 years ago

(also clearly I'm interested in helping out šŸ˜… )

michaelbushe commented 3 years ago

Both would be best.
A PR to align with best practices is very welcome. Thank you! Yet, that still wouldn't give the best dev experience for most users (I suspect).

I think the audience - like many of my audiences in science - is not the expert Angular developer that knows all the best practices, how multi-module projects work, etc. I expect much of the audience for this library to be junior to middle Angular developers who just want to get productive as quickly as possible.

In, the earlier versions (pre-June, I guess) I asked the developer to copy the demo project that is part of a multi-project module. Because of the way Angular is set up, that wasn't easy, and harder when downstream dependencies changed (I'm look at you, primeng imports).

Now, in the latest version (0.8.12+), I expect this repo to make it dirt simple to create a new Angular project for cytoscape, even for new Angular developers. Dirt simple is reflected in the first lines of the README: "To use, copy ./example-project and start coding."

Does this make sense?