Skip to content

ref(build): Add central build directory to packages without CDN bundles (Part 1) - #4854

Merged
AbhiPrasad merged 10 commits into
masterfrom
lms-build-dir-packages-no-bundles
Apr 6, 2022
Merged

ref(build): Add central build directory to packages without CDN bundles (Part 1)#4854
AbhiPrasad merged 10 commits into
masterfrom
lms-build-dir-packages-no-bundles

Conversation

@Lms24

@Lms24Lms24 commented Apr 5, 2022

Copy link
Copy Markdown
Member

Background

This PR is the continuation of our ongoing effort of introducing a central build directory in all* our packages. In the last PR (#4838), the build directory was added to packages with CDN bundles.

*some packages will not be adjusted, as their build process differs significantly from our other packages (e.g. Ember, Angular soon).

Changes

This PR is part 1 of adding the build directory to packages without CDN bundles. It is split into two parts to make reviewing easier. It covers the following packages:

  • Core
  • Gatsby
  • Hub
  • Minimal

Additionally, it adjusts prepack.ts to handle both kinds of packages (with/without CDN bundles) via a CL argument. For the Gatsby SDK, additional actions have to be performed which are only relevant for this package. Therefore, prepack.ts now supports calling a package-specific prepack.ts file located in <package>/scripts/prepack.ts.

While the tarball structure is identical to the structure in #4838 (except for temporary CDN bundles), the build directory structure is simplified due to the fact that there are no CDN bundles or legacy NPM packages to be added to it. Therefore we can reduce one hierarchy level, resulting in the following structure:

<sdk>/
├─ build/
│ ├─ cjs/ // dist until v7
│ │ ├─ CJS modules (+maps)
│ ├─ esm/
│ │ ├─ ES6 modules (+maps)
│ ├─ types/
│ │ ├─ *.d.ts files (+maps)
│ ├─ package.json
│ ├─ LICENSE
│ ├─ README.md
├─ ...

@Lms24
Lms24 requested review from lforst and lobsterkatieApril 5, 2022 11:58
@Lms24Lms24 changed the title adjust prepack.ts to distinguish between packages with/-out bundlesref(build) Add central build directory to packages without CDN bundles (Part 1)Apr 5, 2022
@Lms24
Lms24force-pushed the lms-build-dir-packages-no-bundles branch from ccc6d4c to 25ff8a6CompareApril 5, 2022 12:45
Comment threadscripts/prepack.ts Outdated
Comment threadpackages/gatsby/.eslintrc.js
@AbhiPrasadAbhiPrasad added this to the Pre 7.0.0 Work milestone Apr 6, 2022
explain ignoring of package specific prepack in `.eslintrc.js`
@Lms24
Lms24force-pushed the lms-build-dir-packages-no-bundles branch from cbc50d2 to 0a56148CompareApril 6, 2022 08:20
@github-actions

github-actionsBot commented Apr 6, 2022

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
@sentry/browser - ES5 CDN Bundle (gzipped + minified)20.24 KB (+0.14% 🔺)
@sentry/browser - ES5 CDN Bundle (minified)65.17 KB (-0.14% 🔽)
@sentry/browser - ES6 CDN Bundle (gzipped + minified)18.89 KB (+0.03% 🔺)
@sentry/browser - ES6 CDN Bundle (minified)58.15 KB (-0.21% 🔽)
@sentry/browser - Webpack (gzipped + minified)23.25 KB (+0.1% 🔺)
@sentry/browser - Webpack (minified)82.13 KB (-0.06% 🔽)
@sentry/react - Webpack (gzipped + minified)23.29 KB (+0.1% 🔺)
@sentry/nextjs Client - Webpack (gzipped + minified)48.06 KB (+0.08% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified)26.17 KB (+0.09% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified)24.52 KB (+0.08% 🔺)

@Lms24Lms24 changed the title ref(build) Add central build directory to packages without CDN bundles (Part 1)ref(build): Add central build directory to packages without CDN bundles (Part 1)Apr 6, 2022
Comment threadscripts/prepack.ts Outdated

@AbhiPrasadAbhiPrasad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

some small nits but I think we are good!

Comment threadscripts/prepack.ts Outdated
Comment threadscripts/prepack.ts
@Lms24

Lms24 commented Apr 6, 2022

Copy link
Copy Markdown
MemberAuthor

Thanks for the review, I added the suggestions

Comment threadscripts/prepack.ts Outdated
@AbhiPrasad
AbhiPrasad enabled auto-merge (squash) April 6, 2022 15:24
@AbhiPrasad
AbhiPrasad merged commit 329e033 into masterApr 6, 2022
@AbhiPrasad
AbhiPrasad deleted the lms-build-dir-packages-no-bundles branch April 6, 2022 15:44
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@Lms24@AbhiPrasad