SynBioDex / SBOLCanvas

Apache License 2.0
11 stars 6 forks source link

Updating angular #259

Closed cjmyers closed 1 month ago

cjmyers commented 11 months ago

Hi Chris,

Typescript is just Javascript with strong typing. It gets transformed into Javascript before the browser can run it, so Javascript libraries are inherently supported. The only downside is that if it doesn't come with a .d.ts​ file declaring types for the existing methods/objects then you lose out on the type safety while programming (Something we dealt with originally). It looks like Suhyun has already added mxgraph.d.ts​ as part of that branch. As an analogy imagine declaring a method in Java as taking Object​ and being able to call any method on that object and only getting errors at runtime. Not great, but can still be workable.

At some point when angular upgraded it stopped liking using require​ to load external libraries which is what we used to load mxgraph. It looks like Suhyun replaced a fair bit of them with the new way of loading the library but missed 2 in design-menu.component.ts​ and style-info.ts​. That's leading to the errors you're seeing.

TLDR; Updating is fine, you just need to remove the old require's in design-menu.component.ts​ and style-info.ts​ and update them to the new import. Example of that in graph-base.ts

Logan