-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Jerel Miller <[email protected]>
- Loading branch information
1 parent
bbe61c2
commit 3a62d82
Showing
27 changed files
with
182 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@apollo/client': minor | ||
--- | ||
|
||
Changes how development-only code is bundled in the library to more reliably enable consuming bundlers to reduce production bundle sizes while keeping compatibility with non-node environments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Compare Build Output | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- release-* | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
comparebuildoutput: | ||
name: Compare Build Output | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
# Fetch entire git history so we have the parent commit to compare against | ||
fetch-depth: 0 | ||
- name: Setup Node.js 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
- name: Install dependencies (with cache) | ||
uses: bahmutov/npm-install@v1 | ||
|
||
- name: Run comparison script | ||
id: attw | ||
run: ./config/compare-build-output-to.sh $(git merge-base HEAD origin/${{ github.base_ref }}) > $GITHUB_STEP_SUMMARY | ||
env: | ||
RUNNER_TEMP: ${{ runner.temp }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ on: | |
branches: | ||
- main | ||
- release-* | ||
- pr/* | ||
jobs: | ||
size: | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
upstream=$1 | ||
comparison="${RUNNER_TEMP:-/tmp}/comparison_checkout" | ||
root=$(git rev-parse --show-toplevel) | ||
|
||
temp=$(mktemp --tmpdir="${RUNNER_TEMP:-/tmp}") | ||
trap 'rm -f "$temp"' EXIT | ||
|
||
patterndiff(){ | ||
cd dist || { echo "dist folder not found"; exit 1; } | ||
count=0 | ||
while IFS= read -r -d '' file | ||
do | ||
if ! filediff="$(diff <(tr "'" '"' < "$comparison/dist/$file") <(tr "'" '"' < "$root/dist/$file") -w)"; then | ||
(( count++ )) | ||
echo "$file" | ||
if [[ "$file" == *.min.* ]]; then | ||
echo "> Minified file differs." | ||
else | ||
echo "$filediff" | ||
fi | ||
fi | ||
done >"$temp" < <(find . -name "$1" -print0) | ||
|
||
output="$(cat <"$temp")" | ||
|
||
cat <<EOF | ||
## differences in $1 files | ||
<details> | ||
<summary> | ||
### $count files with differences | ||
</summary> | ||
\`\`\`diff | ||
$output | ||
\`\`\` | ||
</details> | ||
EOF | ||
|
||
cd .. | ||
} | ||
|
||
[ -z "$upstream" ] && { echo "need upstream argument"; exit 1; } | ||
|
||
git worktree add --force --detach --checkout "$comparison" "$upstream" || { cd "$comparison" && git checkout "$upstream"; } || exit 1 | ||
|
||
cd "$comparison" || { echo "checkout failed"; exit 1; } | ||
cp -r "$root/node_modules" . | ||
npm i >&2 | ||
git status >&2 | ||
npm run build >&2 | ||
cd "$root" || exit 1 | ||
git status >&2 | ||
npm run build >&2 | ||
|
||
set +e | ||
|
||
patterndiff "*.js" | ||
patterndiff "*.cjs" | ||
patterndiff "*.d.ts" | ||
|
||
cat <<EOF | ||
## differences in other files | ||
<details> | ||
<summary> | ||
### $(diff -qr "$comparison/dist" "dist" -x "*.map" -x "*.native.*" -x "*.js" -x "*.cjs" -x "*.d.ts" -w | wc -l) files with differences | ||
</summary> | ||
\`\`\`diff | ||
$(diff -r "$comparison/dist" "dist" -x "*.map" -x "*.native.*" -x "*.js" -x "*.cjs" -x "*.d.ts" -w) | ||
\`\`\` | ||
</details> | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import { __DEV__ } from "../../utilities/globals"; | ||
import { Trie } from "@wry/trie"; | ||
import { | ||
canUseWeakMap, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
/* Core */ | ||
|
||
import { __DEV__ } from '../utilities/globals'; | ||
|
||
export { | ||
ApolloClient, | ||
ApolloClientOptions, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.