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 unique identifier to typeclass symbol names #56

Merged
merged 3 commits into from
Jul 6, 2018
Merged

Add unique identifier to typeclass symbol names #56

merged 3 commits into from
Jul 6, 2018

Conversation

Robdel12
Copy link
Contributor

@Robdel12 Robdel12 commented Jul 6, 2018

What is this?

This adds a unique tag to the typeclass symbol names because sometimes
build systems will mangle the class names.

What was happening was that Functor and Filterable were unique
within their own scopse, so the class name became “e”. That caused
funcadelic to look up the instance for Functor and getting
Filterable because they both had "@@funcadelic-0/e" as their
symbol name

This adds a unique tag to the typeclass symbol names because sometimes
build systems will mangle the class names.

What was happening was that `Functor` and `Filterable` were unique
within their own scopse, so the class name became “e”. That caused
funcadelic to look up the instance for `Functor` and getting
`Filterable` because they both had `"@@funcadelic-0/e"` as their
symbol name
@cowboyd cowboyd requested a review from taras July 6, 2018 16:58
@cowboyd
Copy link
Member

cowboyd commented Jul 6, 2018

I don't see any far reaching concerns, but then I didn't predict this predicament either? /cc @taras

Copy link
Member

@taras taras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redux uses a technique to check if names have been mangled to detect when non production build is used in production mode. We could use the same technique to check if names have been mangled.

We could use the same technique to check if we need to add these unique identifiers. What do you think?

If they are being altered then we add the uniqueTag to the typeclass
symbol name
@taras
Copy link
Member

taras commented Jul 6, 2018

@Robdel12 can we do the following?

let name = hasBeenMangled ? uniqueTag++ : Class.name;

@taras taras merged commit b287882 into thefrontside:master Jul 6, 2018
@Robdel12 Robdel12 deleted the rd/fix-react-native-symbol-name-mangling branch July 6, 2018 20:38
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

Successfully merging this pull request may close these issues.

3 participants