Skip to content

Conversation

@timmywil
Copy link
Member

@timmywil timmywil commented Sep 20, 2023

Fixes gh-5327

Summary

  • [BREAKING] changes the format of .sizecache.json. Delete your local .sizecache.json before running comparisons.
{
  "branch": {
    "meta": {
      "commit": "87de182dada4df850a64f3f062fe656b7d589ed9"
    },
    "files": {
      "dist/jquery.min.js": {
        "raw": 79053,
        "gz": 27701
      }
    }
  }
}
  • The commit SHA is now saved for branches and printed with comparisons in gray.
  • every run is now saved as " last run". The leading space is intentional to avoid any possible collisions.
  • compare_size was removed the banner for comparisons, but @mgol made me realize all the exclusions can make a noticeable difference in the size so should be included. However, the short SHA varies by commit and we'd like to be able to compare exactly across commits. Also, .dirty is removed for comparisons because we'd like to be able to compare local changes (i.e. dirty git directory") to all branches and last runs that were clean.
  • Added a version number check that will automatically rewrite the cache on version mismatch.

I can make another PR if preferred, but I tacked on another change here to add the factory files that were just added to the main branch to the dist eslint.

Checklist

Copy link
Member

@mgol mgol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One remark

@timmywil
Copy link
Member Author

timmywil commented Sep 20, 2023

Rather than making us manually delete the cache if the format changes, I've added a version number check, which will automatically rewrite the cache on version mismatch. The version number is now saved in the "meta" of the last run.

Copy link
Member

@mgol mgol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One suggestion. LGTM overall, though.

// Always save the last run
// Save version under last run
sizeCache[ " last run" ] = {
meta: { version: VERSION },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] It's a bit weird that the version of the whole schema is under the last run key instead of in a global meta section. You may consider moving that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered it, but last run always gets saved and this is just a little smaller, saving another object. Practically, I think the difference is minimal.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this was just a suggestion, I don't insist. 🙂

@mgol mgol added this to the 4.0.0 milestone Sep 20, 2023
@mgol mgol added the Build label Sep 20, 2023
@timmywil timmywil closed this in 09972bc Sep 20, 2023
@timmywil timmywil deleted the compare branch September 20, 2023 19:44
mgol referenced this pull request Sep 20, 2023
Updated tasks include:

- lint
- npmcopy
- build, minify, and process for distribution.
- new custom build command using yargs
- compare size of minified/gzip built files
- pretest scripts, including qunit-fixture, babel transpilation, and npmcopy
- node smoke tests
- promises aplus tests
- new watch task using `rollup.watch` directly

Also:

- upgraded husky and added the new lint command
- updated lint config to use new "flat" config format. See https://eslint.org/docs/latest/use/configure/configuration-files-new
- Temporarily disabled one lint rule until flat config is supported by eslint-plugin-import. See import-js/eslint-plugin-import#2556
- committed package-lock.json
- updated all test scripts to use the new build
- added an express test server that uses middleware-mockserver (this can be used to run tests without karma)
- build-all-variants is now build:all

Close gh-5318
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

New build system: re-add commit hashes in compare_size

2 participants