Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

fix(image): exclude devDeps from non-dev image #1085

Merged
merged 1 commit into from
Aug 16, 2023
Merged

Conversation

PixnBits
Copy link
Contributor

Description

move devDeps if-env, node-fetch, and proxy-agent from deps list

Motivation and Context

proxy-agent was found in the non-dev image when it shouldn't be there, so a search through the dependencies was started
all NODE_ENV==='development' was set to false and subsequent code simplification performed
using the dependencies list, using $ grep -rl $dependency src showed that there were a few not used:

  • abort-controller
  • create-shared-react-context
  • if-env
  • node-fetch
  • prop-types
  • proxy-agent
  • reselect
  • url-polyfill

Of these, some were found to be used by the bundler as dependencies that the one-app runtime provides to modules (webpack/webpack.common.js, webpack/app/webpack.client.js). This left if-env, node-fetch, and proxy-agent; the latter two are used by the development CDN. if-env is used in a package.json script which is similarly only used during development (note that the Dockerfile does not use package.json scripts, e.g. $ npm start as the CMD or ENTRYPOINT, so as to avoid unnecessary additional process(es))

How Has This Been Tested?

commit hook, awaiting PR checks

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (adding or updating documentation)
  • Dependency update
  • Security update

Checklist:

  • My change requires a change to the documentation and I have updated the documentation accordingly.
  • These changes should be applied to a maintenance branch.
  • This change requires cross browser checks.
  • Performance tests should be ran against the server prior to merging.
  • This change impacts caching for client browsers.
  • This change impacts HTTP headers.
  • This change adds additional environment variable requirements for One App users.
  • I have added the Apache 2.0 license header to any new files created.

What is the Impact to Developers Using One App?

smaller images are faster to transfer and easier to store (use less bits on disk)

move devDeps if-env, node-fetch, and proxy-agent from deps list
@github-actions
Copy link
Contributor

Size Change: 0 B

Total Size: 689 kB

ℹ️ View Unchanged
Filename Size
./build/app/app.js 164 kB
./build/app/app~vendors.js 389 kB
./build/app/runtime.js 7.07 kB
./build/app/service-worker-client.js 7.26 kB
./build/app/vendors.js 122 kB

compressed-size-action

@PixnBits PixnBits mentioned this pull request Aug 14, 2023
14 tasks
@Matthew-Mallimo Matthew-Mallimo requested a review from a team August 14, 2023 18:23
@@ -184,11 +182,13 @@
"lodash.set": "^4.3.2",
"markdown-table": "^3.0.2",
"mkdirp": "^2.1.5",
"node-fetch": "^2.6.7",
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe node-fetch can be removed entirely as cross-fetch is also used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had that thought too, but I think that might be a bigger scope (so different PR) due to usage being in the dev CDN which is in Node.js so being specific might be useful? Not 100% sure either way

@PixnBits PixnBits merged commit 4d68dba into main Aug 16, 2023
8 checks passed
@PixnBits PixnBits deleted the fix/move-dev-deps branch August 16, 2023 04:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants