Charts icon indicating copy to clipboard operation
Charts copied to clipboard

Library name conflict with Apple Charts

Open remlostime opened this issue 2 years ago • 41 comments

ℹ Please fill out this template when filing an issue. All lines beginning with an ℹ symbol instruct you with what info we expect. You can delete those lines once you've filled in the info.

Per our *CONTRIBUTING guidelines, we use GitHub for bugs and feature requests, not general support. Other issues should be opened on Stack Overflow with the tag ios-charts.

Please remove this line and everything above it before submitting.

What did you do?

There's apple Charts now. If we import Charts , when does the Xcode know it's apple one or third party one?

What did you expect to happen?

ℹ Please replace this with what you expected to happen.

What happened instead?

ℹ Please replace this with of what happened instead.

Charts Environment

Charts version/Branch/Commit Number: Xcode version: Swift version: Platform(s) running Charts: macOS version running Xcode:

Demo Project

ℹ Please link to or upload a project we can download that reproduces the issue.

remlostime avatar Jun 15 '22 21:06 remlostime

Following for status updates. Personally what I did is fork the repo and then rename the library so that it didn't conflict with the native implementation.

waterskier2007 avatar Jun 28 '22 14:06 waterskier2007

ok.. this sucks, @jjatie @danielgindi @pmairoldi thoughts? What would be the appropriate name now?

liuxuan30 avatar Jul 07 '22 09:07 liuxuan30

This is a major oversight on Apple's side. Some of their engineers are probably aware that this library exists.

Now we need some ideas regarding the naming.

Also one question- does this happen also when not adding the Swift Charts framework to the project?

danielgindi avatar Jul 07 '22 13:07 danielgindi

Also one question- does this happen also when not adding the Swift Charts framework to the project?

It does not occur if you do not use the Swift Charts framework

waterskier2007 avatar Jul 07 '22 13:07 waterskier2007

Perhaps a name such as UIKitCharts (just off the top of my head) or something else to indicate that the implementation is in UIKit?

waterskier2007 avatar Jul 07 '22 13:07 waterskier2007

I doubt someone would use both at the same time. This seems to be implemented in swift 5.7 so maybe this could work https://github.com/apple/swift-evolution/blob/main/proposals/0339-module-aliasing-for-disambiguation.md

pmairoldi avatar Jul 07 '22 14:07 pmairoldi

I doubt someone would use both at the same time. This seems to be implemented in swift 5.7 so maybe this could work https://github.com/apple/swift-evolution/blob/main/proposals/0339-module-aliasing-for-disambiguation.md

I disagree. We have a large app we support that has some "legacy" views using UIKit that have charts in them but we would also like to start adding Swift Charts to our SwiftUI views once iOS 16 rolls out. I imagine that use case could be common.

waterskier2007 avatar Jul 07 '22 15:07 waterskier2007

Could wrapping these old views or new views in a framework and then importing that into your app solve this issue or would the libraires still clash?

pmairoldi avatar Jul 07 '22 17:07 pmairoldi

Could wrapping these old views or new views in a framework and then importing that into your app solve this issue or would the libraires still clash?

they wouldn't clash, this is what @waterskier2007 should do in the short term; make a new framework and put your new SwiftUI views in that framework

alanzeino avatar Jul 07 '22 20:07 alanzeino

Could wrapping these old views or new views in a framework and then importing that into your app solve this issue or would the libraires still clash?

they wouldn't clash, this is what @waterskier2007 should do in the short term; make a new framework and put your new SwiftUI views in that framework

I've already solved the issue as mentioned above in one of my comments.

waterskier2007 avatar Jul 07 '22 20:07 waterskier2007

I doubt someone would use both at the same time. This seems to be implemented in swift 5.7 so maybe this could work https://github.com/apple/swift-evolution/blob/main/proposals/0339-module-aliasing-for-disambiguation.md

I disagree. We have a large app we support that has some "legacy" views using UIKit that have charts in them but we would also like to start adding Swift Charts to our SwiftUI views once iOS 16 rolls out. I imagine that use case could be common.

moduleAliases is something we could look further, smell like a possible solution, why it doesn't work for your case? (Not yet looking deep into it)

UPDATE: oops, I take a quick look, it seems only applys for SPM, and has some pre conditions...

liuxuan30 avatar Jul 08 '22 03:07 liuxuan30

This is a major oversight on Apple's side. Some of their engineers are probably aware that this library exists.

Now we need some ideas regarding the naming.

Also one question- does this happen also when not adding the Swift Charts framework to the project?

@danielgindi what odds you think if we send a request to apple to change name? I would say little

If we are the side to rename the library, a few options, ChartKit, swift ChartKit, iOS ChartKit, might a fit.. My current company named internal a lot of libraries following the UIKit AppKit fashion.

liuxuan30 avatar Jul 14 '22 09:07 liuxuan30

This change could be an option. I just picked ChartKit since it seemed to make sense but it could be anything.

https://github.com/danielgindi/Charts/compare/master...waterskier2007:Charts:master

waterskier2007 avatar Jul 20 '22 15:07 waterskier2007

We just need a good suggestion that will be acceptable for everyone and easy enough to migrate :) We will need to rename though, no running away from it.

danielgindi avatar Jul 20 '22 19:07 danielgindi

My branch above has been working for for me in a project leveraging both this library and the new Swift Charts library

waterskier2007 avatar Jul 20 '22 19:07 waterskier2007

then... a vote? Or you could make the call @danielgindi

liuxuan30 avatar Jul 25 '22 06:07 liuxuan30

then... a vote? Or you could make the call @danielgindi

I think we need some ideas before we vote :) ChartKit sounds more like an Apple kit (I would expect their library to be named ChartKit..., not ours!) Any good ideas here?

danielgindi avatar Jul 25 '22 16:07 danielgindi

  • ChartsKit
  • ChartsUI

Those seem like the two most viable options and since there was objection to ChartKit sounding too Apple-ish, why not just ChartsUI?

waterskier2007 avatar Jul 26 '22 15:07 waterskier2007

then... a vote? Or you could make the call @danielgindi

I think we need some ideas before we vote :) ChartKit sounds more like an Apple kit (I would expect their library to be named ChartKit..., not ours!) Any good ideas here?

I have filed a radar to request a rename, but no update yet.. and likely will not have in the near future

liuxuan30 avatar Aug 01 '22 03:08 liuxuan30

I'm thinking UICharts

danielgindi avatar Aug 01 '22 04:08 danielgindi

Do we know maybe when this rename can happen? (I am using lib via cocoapods)

PiotrSzmyt avatar Aug 02 '22 07:08 PiotrSzmyt

@danielgindi would you like me to update my PR to include the podspec change or are you wanting to rename directories and source files as well?

waterskier2007 avatar Aug 03 '22 17:08 waterskier2007

@danielgindi would you like me to update my PR to include the podspec change or are you wanting to rename directories and source files as well?

Every PR should contain a very specific change. Otherwise it's impossible to properly review.

I guess I'm waiting for a bit more participants here. If there are no other good ideas then we'll rename to UICharts very soon and bump a major version.

danielgindi avatar Aug 03 '22 21:08 danielgindi

Absolutely. What I meant to ask was if you wanted to perform any other changes such as source file names or directories that were specifically related to the name change.

waterskier2007 avatar Aug 04 '22 16:08 waterskier2007

@danielgindi what are your thoughts now that Xcode 14 & the new SDKs are live?

waterskier2007 avatar Sep 13 '22 13:09 waterskier2007

Same problem here. Need to import both Charts modules for compatibility. Any updates? How soon should we expect the renaming?

superz515 avatar Sep 14 '22 15:09 superz515

How about "ICharts"? "I" stands for "iOS". Although it still sounds Apple-ish.. Or maybe "OpenCharts"?

superz515 avatar Sep 14 '22 15:09 superz515

I get that it’s sucks that it doesn’t “just work” but can’t you just put this library in your own framework target and expose your own namespace. It seems like most people who have this problem are trying to migrate to swift ui charts in the future but don’t want to do it all at once.

pmairoldi avatar Sep 14 '22 15:09 pmairoldi

I get that it’s sucks that it doesn’t “just work” but can’t you just put this library in your own framework target and expose your own namespace. It seems like most people who have this problem are trying to migrate to swift ui charts in the future but don’t want to do it all at once.

That's completely doable but that seems like a pretty big backtrack from the prior conversation. There are certainly many apps that will utilize both UIKit and SwiftUI for the foreseeable future, especially given that Swift Charts can only be fully adopted if the minimum deployment is iOS 16.

waterskier2007 avatar Sep 14 '22 16:09 waterskier2007

I am not saying we are not gonna rename. It’s just for now I don’t have the time to do it. Just proposing alternatives to people ending up on this thread.

pmairoldi avatar Sep 14 '22 16:09 pmairoldi