question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Namespaced prefixes — next step for resolving name clashes

See original GitHub issue

So #92 was somewhat resolved with this PR #120

The next step is to eventually publish a version of fantasy-land npm package with namespaced prefixed names.

There are some questions to discuss though:

  • When do we release the new version? Should we wait until majority of libs migrate to the new approach, or should we release it right away so two versions will coexist allowing everyone to choose on which versions to depend in each particular case?
  • How the prefixed names should look like?

Maybe there more questions, these two is what came to my mind.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:20 (19 by maintainers)

github_iconTop GitHub Comments

3reactions
rpominovcommented, Jun 7, 2016

I think this is the best way to do it, create normal methods in your API like with “old” FL, and then do something like:

Type.prototype[FL.map] = Type.prototype.map
Type.prototype[FL.ap] = Type.prototype.ap
...

We could even provide a helper that does this automatically:

import {makeFantasyLandCompatible} from 'fantasy-land/compat-helper'

makeFantasyLandCompatible(Type)
3reactions
Avaqcommented, Aug 12, 2016

I wonder if there is a way to have both without sacrificing anything? – @SimonRichardson

In Fluture I did this thing where I create keys for both 'map' and FL.map on my type, so when FL adds namespaces, my API won’t change, and FL dispatchers will still work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - How do I resolve a namespace conflict? - Stack Overflow
The best way is to name your tests project tests. ppumpkin , and set its default namespace to be ppumpkin . Then when...
Read more >
2.9 — Naming collisions and an introduction to namespaces
Use explicit namespace prefixes to access identifiers defined in a namespace. When an identifier includes a namespace prefix, the identifier is ...
Read more >
Namespaces · Issue #163 · graphql/graphql-spec - GitHub
This code violates the semantics of inline fragments and union types - they normally represent 2 mutually exclusive fields, still I use them ......
Read more >
Resolve conflicts with XML namespaces - TechRepublic
XML namespaces exist to help identify and resolve conflicts between elements that have the same name but mean different things.
Read more >
Appendix B: Namespaces Algorithms
Namespace declaration attributes and prefixes are normalized as part of the normalizeDocument method of the Document interface as if the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found