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 believe
Object.values
might be better suited here?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.
@tiaanduplessis ye I agree - browser support for
Object.entries
andObject.values
appears to be the same, so we might as well use.values
:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries
An aside - do you know what the best practice is for using "new" Javascript specs in modules?
I generally iterate over
Object.keys
to avoid adding polyfills, at the expense of having to manually fetch values out of the object.Is it up to the library to provide support for older browsers, or is it up to the user to add polyfills where necessary?
I imagine the responsible thing is to indicate which polyfills are necessary for older browsers when newer features are used in a module.
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.
@larrybotha I'm not quite sure what is the current best practice for Svelte related modules, but I'd probably go with the user needing to add polyfilling where required and then indicating newer features used in the module README for full transparency.
The reason being that using core-js via babel will allow the user the flexibility to configure exactly what they want via browserlist and since Svelte does not compile down to older versions of JS out of the box the extra configuration will need to be added in any case to handle modern syntax and polyfiliing of popular browser APIs like Promises.
What do you think?
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.
@tiaanduplessis ye, sounds good to me!