atom-archive / xray

An experimental next-generation Electron-based text editor
MIT License
8.48k stars 237 forks source link

Suggestion: Don't use overloaded Point and Range terms in API #102

Open lee-dohm opened 6 years ago

lee-dohm commented 6 years ago

One thing that we ran into problems with the original API were the Point and Range classes. Since the browser APIs contain classes named the same, we ran into naming collisions causing issues for those attempting to use the Atom API. I figured I would record this piece of tribal knowledge here so that we can avoid it in Xray.

Suggestions

Alternatives for Point:

Alternatives for Range:

Nufflee commented 6 years ago

I like Position and Span as they're pretty frequently used in such libraries/APIs.

nathansobo commented 6 years ago

It might not be as much of an issue in Xray because I think those are DOM globals and we don't intend to make editor APIs available on the main thread. That said, I appreciate you sharing these kinds of thoughts.