Skip to content

Conversation

Beak-man
Copy link
Member

@Beak-man Beak-man commented Jul 10, 2025

Description of the Change

Substituted development dependency grunt-zip for grunt-contrib-compress.

The latter is more actively maintained, has more robust binary data handling and better cross-platform compatibility.
https://github.com/twolfson/grunt-zip
https://github.com/gruntjs/grunt-contrib-compress

Note that grunt-contrib-compress uses a different library for compressing (archiver) compared to grunt-zip, which uses jszip, which in its turn is also used as one of the few external dependencies within the engine itself. A review of jszip's functionality within Web WorldWind is in order to consider its substitution.

Why Should This Be In Core?

At some point, grunt-zip began producing a corrupt bundle release artifact. See #900

Benefits

Artifact .zip bundling now works OK.

Potential Drawbacks

None found.

Applicable Issues

Fixes #900

@Beak-man Beak-man self-assigned this Jul 10, 2025
@Beak-man Beak-man requested review from Copilot and markpet49 and removed request for Copilot July 10, 2025 19:28
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

The PR replaces the grunt-zip plugin with grunt-contrib-compress to fix corrupt bundle artifacts and improve cross-platform compatibility.

  • Swaps out grunt-zip for grunt-contrib-compress in devDependencies
  • Renames and reconfigures the Grunt “zip” task to “compress” with updated options and file patterns
  • Updates task loading and default task sequence to use the new “compress” plugin

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
package.json Removed grunt-zip and added grunt-contrib-compress dependency
Gruntfile.js Renamed zip task to compress, added options.archive, mode, level, and files blocks; updated task loading and default sequence
Comments suppressed due to low confidence (1)

Gruntfile.js:137

  • [nitpick] The indentation for this cwd property is misaligned compared to other entries; aligning it with the surrounding properties will improve readability.
                        cwd: 'build/dist',

files: [
{
expand: true,
src: ['images/**']
Copy link
Preview

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

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

[nitpick] For consistency with the dist task and to ensure a predictable folder structure inside the archive, consider adding cwd: 'images' and changing src to ['**'] under the images files block.

Suggested change
src: ['images/**']
cwd: 'images',
src: ['**']

Copilot uses AI. Check for mistakes.

options: {
archive: 'build/dist/images.zip',
mode: 'zip',
level: 9
Copy link
Preview

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

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

[nitpick] Using the maximum compression level (9) can slow down build times; consider using a lower level or the default setting if ultra-high compression isn’t required.

Suggested change
level: 9
level: 6

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

WebWorldWind-Distribution-0.11.0.zip appears to contain several corrupted files.
1 participant