Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 6, 2022

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Apr 5, 2022

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 lobsterkatie and lforst April 5, 2022 11:58
@Lms24 Lms24 changed the title adjust prepack.ts to distinguish between packages with/-out bundles ref(build) Add central build directory to packages without CDN bundles (Part 1) Apr 5, 2022
@Lms24 Lms24 force-pushed the lms-build-dir-packages-no-bundles branch from ccc6d4c to 25ff8a6 Compare April 5, 2022 12:45
@AbhiPrasad AbhiPrasad added this to the Pre 7.0.0 Work milestone Apr 6, 2022
explain ignoring of package specific prepack in `.eslintrc.js`
@Lms24 Lms24 force-pushed the lms-build-dir-packages-no-bundles branch from cbc50d2 to 0a56148 Compare April 6, 2022 08:20
@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2022

size-limit report 📦

Path Size
@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% 🔺)

@Lms24 Lms24 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
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

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!

@Lms24
Copy link
Member Author

Lms24 commented Apr 6, 2022

Thanks for the review, I added the suggestions

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@AbhiPrasad AbhiPrasad enabled auto-merge (squash) April 6, 2022 15:24
@AbhiPrasad AbhiPrasad merged commit 329e033 into master Apr 6, 2022
@AbhiPrasad AbhiPrasad deleted the lms-build-dir-packages-no-bundles branch April 6, 2022 15:44
Sign up for free to 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.

None yet

2 participants