Addepar / Addepar/ember-table

Consider using built-in Array.sort instead of custom mergeSort

Open
#745 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.7k
Forks
351
Avg merge
1d 22h
Merged PRs (30d)
1

Description

Ember Table uses a custom mergeSort implementation in order to provide a stable sort. It does so because at the time the code was written, built-in Array.prototype.sort was not stable.

As of late 2018 all major browser engines have a stable sort and it is also part of the Ecmascript spec: https://github.com/tc39/ecma262/pull/1340.

Perhaps it's time to consider removing our custom mergeSort.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating Ember Table's custom mergeSort implementation and the code paths that call it. Review the existing sorting behavior and relevant tests before deciding whether the built-in Array.prototype.sort can replace it; done means the custom implementation is removed without losing stable sorting.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.