Skip to content

New build system: re-add commit hashes in compare_size #5327

@mgol

Description

@mgol

Description

The new code for comparing size from #5318 removed commit hashes from being recorded. I found them useful in the past to be able to quickly verify whether particular size data is up to date; I'd like to have them back.

Now, since we've changed the size cache format anyway, we can think about the best one here. Right now, it's:

{
  "main": {
    "dist/jquery.min.js": {
      "raw": 78901,
      "gz": 27648
    },
    "dist/jquery.slim.min.js": {
      "raw": 56222,
      "gz": 19605
    },
    "dist-module/jquery.module.min.js": {
      "raw": 78947,
      "gz": 27669
    },
    "dist-module/jquery.slim.module.min.js": {
      "raw": 56268,
      "gz": 19626
    }
  },
  /* ... */
}

The old format had something like the following at the top:

{
  "": {
    "version": 0.4,
    "tips": {
      "main": "2bdecf8b7bd10864e5337a4e24e39476c78cf23a",
      /* ... */
    }
  },
  /* ... */
}

That made commit hashes show up far away from the data which also makes it harder to do manual cleanups. How about something like:

{
  "main": {
    "meta": {
      "commit": "2bdecf8b7bd10864e5337a4e24e39476c78cf23a"
    },
    "data": {
      "dist/jquery.min.js": {
        "raw": 78901,
        "gz": 27648
      },
      "dist/jquery.slim.min.js": {
        "raw": 56222,
        "gz": 19605
      },
      "dist-module/jquery.module.min.js": {
        "raw": 78947,
        "gz": 27669
      },
      "dist-module/jquery.slim.module.min.js": {
        "raw": 56268,
        "gz": 19626
      }
    }
  },
  /* ... */
}

?

Link to test case

N/A

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions