Skip to content

Put all npm dependencies in dependencies#4001

Merged
sndrs merged 1 commit intomainfrom
no-dev-deps
Feb 15, 2022
Merged

Put all npm dependencies in dependencies#4001
sndrs merged 1 commit intomainfrom
no-dev-deps

Conversation

@sndrs
Copy link
Member

@sndrs sndrs commented Feb 15, 2022

What does this change?

collapses each project's npm dependencies into the dependencies field

Why?

  • these are application not libraries, the distinction doesn't affect us or our users
  • as evidenced by the types of packages in dependencies and devDependencies of each package, it confuses us
  • it makes it hard to know what is installed where, because the alpha sorting is spread across 10s of lines in 2 groups

Prep work for #3998

Copy link
Contributor

@jamesgorrie jamesgorrie left a comment

Choose a reason for hiding this comment

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

Given we don't use yarn install --production anywhere, as I can see, we weren't getting any benefit anywho.

Copy link
Contributor

@oliverlloyd oliverlloyd left a comment

Choose a reason for hiding this comment

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

Simpler

@github-actions
Copy link

Size Change: 0 B

Total Size: 1.3 MB

ℹ️ View Unchanged
Filename Size
dotcom-rendering/dist/1214.js 2.65 kB
dotcom-rendering/dist/1214.legacy.js 2.71 kB
dotcom-rendering/dist/1376.js 1.9 kB
dotcom-rendering/dist/1376.legacy.js 2.01 kB
dotcom-rendering/dist/1624.js 2.64 kB
dotcom-rendering/dist/1624.legacy.js 2.71 kB
dotcom-rendering/dist/1924.js 4.64 kB
dotcom-rendering/dist/1924.legacy.js 4.71 kB
dotcom-rendering/dist/2.js 3.95 kB
dotcom-rendering/dist/2.legacy.js 4.06 kB
dotcom-rendering/dist/2058.js 5.39 kB
dotcom-rendering/dist/2058.legacy.js 5.54 kB
dotcom-rendering/dist/2393.js 3.41 kB
dotcom-rendering/dist/2393.legacy.js 3.55 kB
dotcom-rendering/dist/2748.js 9.11 kB
dotcom-rendering/dist/2748.legacy.js 9.59 kB
dotcom-rendering/dist/281.legacy.js 3.42 kB
dotcom-rendering/dist/2879.js 9.01 kB
dotcom-rendering/dist/2879.legacy.js 9.56 kB
dotcom-rendering/dist/2947.js 2.58 kB
dotcom-rendering/dist/2947.legacy.js 2.66 kB
dotcom-rendering/dist/3213.js 13.5 kB
dotcom-rendering/dist/3213.legacy.js 13.8 kB
dotcom-rendering/dist/3215.js 5 kB
dotcom-rendering/dist/3215.legacy.js 5.12 kB
dotcom-rendering/dist/3397.js 240 B
dotcom-rendering/dist/3397.legacy.js 251 B
dotcom-rendering/dist/4005.js 30.9 kB
dotcom-rendering/dist/4025.js 3.98 kB
dotcom-rendering/dist/4025.legacy.js 4.31 kB
dotcom-rendering/dist/4211.js 2 kB
dotcom-rendering/dist/4211.legacy.js 2.11 kB
dotcom-rendering/dist/4576.js 235 B
dotcom-rendering/dist/4576.legacy.js 247 B
dotcom-rendering/dist/4813.js 5.29 kB
dotcom-rendering/dist/4813.legacy.js 5.39 kB
dotcom-rendering/dist/4850.js 235 B
dotcom-rendering/dist/4850.legacy.js 246 B
dotcom-rendering/dist/4889.js 4.55 kB
dotcom-rendering/dist/4889.legacy.js 4.56 kB
dotcom-rendering/dist/4999.js 18.4 kB
dotcom-rendering/dist/4999.legacy.js 19 kB
dotcom-rendering/dist/5096.js 4.67 kB
dotcom-rendering/dist/5096.legacy.js 4.74 kB
dotcom-rendering/dist/5217.js 233 B
dotcom-rendering/dist/5217.legacy.js 245 B
dotcom-rendering/dist/5356.js 5.11 kB
dotcom-rendering/dist/5356.legacy.js 5.25 kB
dotcom-rendering/dist/5484.legacy.js 7.89 kB
dotcom-rendering/dist/5585.js 6.47 kB
dotcom-rendering/dist/5585.legacy.js 6.72 kB
dotcom-rendering/dist/6046.js 6.45 kB
dotcom-rendering/dist/6046.legacy.js 6.83 kB
dotcom-rendering/dist/6348.js 5.12 kB
dotcom-rendering/dist/6348.legacy.js 5.29 kB
dotcom-rendering/dist/6400.js 21.5 kB
dotcom-rendering/dist/6400.legacy.js 21.5 kB
dotcom-rendering/dist/6684.js 241 B
dotcom-rendering/dist/6684.legacy.js 252 B
dotcom-rendering/dist/6854.legacy.js 28.9 kB
dotcom-rendering/dist/6965.js 3.19 kB
dotcom-rendering/dist/6965.legacy.js 3.25 kB
dotcom-rendering/dist/6992.js 2.02 kB
dotcom-rendering/dist/6992.legacy.js 2.12 kB
dotcom-rendering/dist/7051.js 7.36 kB
dotcom-rendering/dist/7051.legacy.js 7.5 kB
dotcom-rendering/dist/7800.js 11 kB
dotcom-rendering/dist/8080.js 1.81 kB
dotcom-rendering/dist/8080.legacy.js 1.9 kB
dotcom-rendering/dist/8129.legacy.js 11.5 kB
dotcom-rendering/dist/8280.js 3.29 kB
dotcom-rendering/dist/8294.js 232 B
dotcom-rendering/dist/8294.legacy.js 244 B
dotcom-rendering/dist/8748.js 232 B
dotcom-rendering/dist/8748.legacy.js 243 B
dotcom-rendering/dist/8838.js 3.02 kB
dotcom-rendering/dist/8880.legacy.js 3.06 kB
dotcom-rendering/dist/9327.js 1.85 kB
dotcom-rendering/dist/9327.legacy.js 1.95 kB
dotcom-rendering/dist/9641.js 6.44 kB
dotcom-rendering/dist/9641.legacy.js 6.7 kB
dotcom-rendering/dist/9754.js 5.21 kB
dotcom-rendering/dist/9776.js 6.37 kB
dotcom-rendering/dist/9776.legacy.js 6.63 kB
dotcom-rendering/dist/9817.js 11.5 kB
dotcom-rendering/dist/9817.legacy.js 11.7 kB
dotcom-rendering/dist/9884.js 17.4 kB
dotcom-rendering/dist/9884.legacy.js 17.7 kB
dotcom-rendering/dist/atomIframe.js 1.87 kB
dotcom-rendering/dist/atomIframe.legacy.js 2.14 kB
dotcom-rendering/dist/bootCmp.js 7.31 kB
dotcom-rendering/dist/bootCmp.legacy.js 10.9 kB
dotcom-rendering/dist/braze-web-sdk-core.js 36.1 kB
dotcom-rendering/dist/braze-web-sdk-core.legacy.js 36.1 kB
dotcom-rendering/dist/cmp.js 7.43 kB
dotcom-rendering/dist/coreVitals.js 4.03 kB
dotcom-rendering/dist/coreVitals.legacy.js 4.33 kB
dotcom-rendering/dist/dynamicImport.js 3 kB
dotcom-rendering/dist/dynamicImport.legacy.js 3.29 kB
dotcom-rendering/dist/embedIframe.js 1.88 kB
dotcom-rendering/dist/embedIframe.legacy.js 2.14 kB
dotcom-rendering/dist/frontend.server.js 352 kB
dotcom-rendering/dist/ga.js 3.88 kB
dotcom-rendering/dist/ga.legacy.js 4.14 kB
dotcom-rendering/dist/guardian-braze-components-banner.js 11.9 kB
dotcom-rendering/dist/guardian-braze-components-banner.legacy.js 12 kB
dotcom-rendering/dist/guardian-braze-components-end-of-article.js 8.11 kB
dotcom-rendering/dist/guardian-braze-components-end-of-article.legacy.js 8.18 kB
dotcom-rendering/dist/initDiscussion.js 7.89 kB
dotcom-rendering/dist/initDiscussion.legacy.js 8.14 kB
dotcom-rendering/dist/InteractiveBlockComponent.js 3.03 kB
dotcom-rendering/dist/InteractiveBlockComponent.legacy.js 3.18 kB
dotcom-rendering/dist/islands.js 8.06 kB
dotcom-rendering/dist/islands.legacy.js 8.79 kB
dotcom-rendering/dist/newsletterEmbedIframe.js 2.03 kB
dotcom-rendering/dist/newsletterEmbedIframe.legacy.js 2.29 kB
dotcom-rendering/dist/ophan.js 7.18 kB
dotcom-rendering/dist/ophan.legacy.js 7.38 kB
dotcom-rendering/dist/react.js 73.4 kB
dotcom-rendering/dist/react.legacy.js 79.9 kB
dotcom-rendering/dist/readerRevenueDevUtils.js 892 B
dotcom-rendering/dist/readerRevenueDevUtils.legacy.js 952 B
dotcom-rendering/dist/relativeTime.js 2.41 kB
dotcom-rendering/dist/relativeTime.legacy.js 2.68 kB
dotcom-rendering/dist/sentry.js 677 B
dotcom-rendering/dist/sentry.legacy.js 689 B
dotcom-rendering/dist/sentryLoader.js 4.75 kB
dotcom-rendering/dist/sentryLoader.legacy.js 7.71 kB
dotcom-rendering/dist/shimport.js 2.75 kB
dotcom-rendering/dist/shimport.legacy.js 2.76 kB
dotcom-rendering/dist/SignInGateMain.js 3.56 kB
dotcom-rendering/dist/SignInGateMain.legacy.js 3.69 kB
dotcom-rendering/dist/YoutubeBlockComponent.js 2.9 kB
dotcom-rendering/dist/YoutubeBlockComponent.legacy.js 3.03 kB

compressed-size-action

@sndrs
Copy link
Member Author

sndrs commented Feb 15, 2022

Given we don't use yarn install --production anywhere, as I can see, we weren't getting any benefit anywho.

if we should be doing that, we're not going to get all and only prod deps right now anyway. might as well make that explicit (and then fix it that's wrong)

@sndrs sndrs merged commit 7aeafcf into main Feb 15, 2022
@sndrs sndrs deleted the no-dev-deps branch February 15, 2022 18:02
@arelra
Copy link
Member

arelra commented Feb 17, 2022

Just adding to:

Given we don't use yarn install --production anywhere

Yarn and npm docs mention:

Yarn will not install any package listed in devDependencies if the NODE_ENV environment variable is set to production. Use this flag to instruct Yarn to ignore NODE_ENV and take its production-or-not status from this flag instead.

So if NODE_ENV=production for the install step that's also a route to only get prod deps.

I can see that it is not set for the makefile install step but I'm not sure of the setup on TeamCity.

imo separating deps is worth it to:

  • make it easier to determine what is used in prod vs being lost in the noise of devDeps
  • reduce our prod build footprint by a couple of neutron stars

tjmw added a commit that referenced this pull request Feb 22, 2022
This happened previously in #4001 but the change was subsequently lost.
A couple of dependencies have been added in the meantime which is why
there are a couple of straggling lines (@types/twitter-for-web for
example).
mxdvl added a commit that referenced this pull request Feb 24, 2022
Since #4001 we collapsed dependencies.

This helps us rely on our friendly robots to ensure we don’t start
populating this field by mistake in package.json.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants