Skip to content

Set / Map / List: Deprecate these modules #336

@jmsmyth

Description

@jmsmyth

Context

Set and Map are well supported in browsers now. We should consider suggesting that users move over to these rather than hx.Map and hx.Set.

List is a more interesting one as there isn't a similar thing in ES6. The most useful part of list is the ability to remove items. One option would be to add a util method for removing an item from arrays and then deprecate hx.List in favour of this.

Using ES6 Maps and Sets will most likely give better performance than hexagon's and will allow us to decrease the size of hexagon slightly in the next major release.

This will obviously have some consequences - people will need to refactor their code, etc, so we might need to discuss a bit if we should mark this for the next major version (or the one after?).

Possible Fix

Add warnings when hx.Map and hx.Set (and hx.List?) are created by the user suggesting they use the built in javascript alternatives.

For now we should leave hexagon using hx.Map / hx.Set / hx.List internally until actually removed in the next major version, since changing to use ES6 features internally is probably enough to warrant a major version bump at the moment. Any uses of these classes internally should not show warnings in the console, so some kind of wrapper will be needed to get the warnings to show just when created by users.

Update the documentation to explain how to migrate from hx.Map / hx.Set to Map / Set.

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions