Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
String.prototype.trim
is a relatively new addition to JavaScript. IE8 doesn't support it, is that a concern?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that's David's call. I look at the Ramda implementation and it seems insane to go to those lengths to support a browser like IE8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I'm for writing ES5 and documenting that fact; a user has the option of a shim if desired for the use case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My position on this matter may seem quirky, but I think it's justified.
So, when we remove the Ramda dependency I'll be absolutely fine with making this change. Until then, though, I see no harm in taking advantage of the "insane" measures
R.trim
takes to support old browsers. :)If we decide to add
S.trimLeft
andS.trimRight
at some point, I'll reassess my position.† I even have a branch locally on which I attempted to remove Ramda. It's certainly possible, but a few things need to happen first. For example, sanctuary-def needs to expose its
show
function to save us from duplicating the definition ofR.toString
a second time.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My position is that we ought to rip the plaster off as soon as possible. This change is a breaking change, the longer we leave it the more disruptive it is for our users when we do pull the plug. I believe we should be front leading these sorts of updates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the other way around to me. In a year, say, the number of people whose browsers don't provide
String#trim
will be lower than it is today, presumably.I don't feel strongly about this change, though, so if others are in favour I don't mind merging it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually that's a very good point. I hadn't thought of it like that. Maybe we should hold off then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's probably true, but I think the number of organisations / apps that want to support ES3-only browsers changes much less smoothly and more unpredictably