Closed jahorton closed 10 months ago
My feeling on this now hasn't really changed. I think there needs to be a demonstrated benefit over and above refactoring and nicer code. Is there a performance benefit? Is the code significantly smaller for distribution?
The cost of introducing 3rd party dependencies, especially for deployed code, is very significant and we don't always choose well.
We decided to not go ahead with this.
I know we put "not planned" here, but it may be worth noting that our current approach causes "side-effects" when we treat KeymanWeb as a node package / import, which isn't ideal. It may be worth revisiting on the basis of cleaning up the pattern and avoiding side-effects if and when we consider distributing KMW via NPM.
In particular, our addition of instance methods to String.prototype
and of a static method onto String
are "side effects" from the Node package perspective.
In particular, our addition of instance methods to
String.prototype
and of a static method ontoString
are "side effects" from the Node package perspective.
Yes we should refactor that. NPM publishing may be a good time to consider this -- whether we keep using kmwstring refactored away from monkeypatching or utfstring or something else.
We are in a much better place to make that assessment than we were back in v13
The notes above are in reference to this comment made on the same PR:
We stuck with kmwstring.ts for 13.0 since it's a known factor, but it'd be worth investigating a transition for future versions.