Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Because the very purpose of an API is to hide implementation details behind a common interface.
-
retoor119011y@CoreFusionX You're wise as F.
@Lasoloz the current support from browsers is amazing. What did you trip into / what happened? -
Basing your code on implementation details behind an API is the clearest architectural fuckup you can do. The purpose of having an API is that nothing breaks if the implementation changes as long as the API is still fulfilled.
-
Lasoloz5071y@retoor I'm messing with the Mutation API. Of course Chrome implements it slightly differently than Firefox.
I've had issues with contenteditables as well: Firefox is handling the caret's client rectangle in a messed up way at soft wraps, while Chrome is setting the Range for the caret after the focusing event handler run -
Lasoloz5071y@electrineer well, I'm kinda basing my logic on implementation details. But sometimes there is no other way around it. The aforementioned Mutation API is like this. I can understand why the different browsers return a different list of mutations for the same operations, but I still have to process it based on my constraints and needs.
-
possum16361y@Lasoloz Thanks for the heads up, I‘m currently doing stuff with contenteditable and used/tested only chromium so far.
-
retoor119011y@Lasoloz dear lord, that resetting of caret. Been there done that. Fucking ranges. I quitted, wasn't fun anymore. Was for private project. I like to do things myself like writing a simple highlighter. After change, i highlight and set range. At least, wanted that
-
@Lasoloz Uhh naah man... no ....
The horrors suddenly flashed before my eyes now that u cleared the question up.
*Sits in the corner, shivering* -
Lasoloz5071y@retoor same, it's for a personal project. I'm just experimenting, and since I have the time, I'm considering two different solutions: one with the custom caret handling, the other one with the mutation API.
-
retoor119011y@Lasoloz for when you give up: https://user-images.githubusercontent.com/... is nice. Not sure what you want but you can also run vscode in browser with terminal and everything. Like gitpod
-
Lasoloz5071y@retoor thanks for asking :)
Sadly, I haven't worked on the project in the last few days. I'm hoping I can get something done next week. -
Lasoloz5071y@retoor but if you are interested, and if I manage to do something with the project, I can keep this thread updated
Related Rants
Why the fuck do the browsers need to implement the same API in a different way?
rant
web
webdev
api
browser