Skip to content

Commit

Permalink
Checkpoint towards using package-bundler
Browse files Browse the repository at this point in the history
This would give us two things: publishing as ESM in addition to CJS, and
the ability to have some symbols come from "deep imports" that aren't
loaded automatically. It replaces some hacks like runtime requires in
src/plugin/index.ts, and adds things like "you don't need to load
express unless you actually import from the standalone directory".

A directory with an index.ts in it is an entry point. The main rule is:
you can import arbitrarily within your own entry point, but you can't do
a "deep" import of a specific file or directory inside another entry
point. Note that this means that any code that needs to be accessible
from multiple entry points but not externally importable should be in an
entry point whose name contains "internal" so that folks understand they
shouldn't rely on its existence.

This is coming close to working. Some issues I'm running into include:
  • Loading branch information
glasser committed Jun 10, 2022
1 parent 12cd9d6 commit 2f02d88
Show file tree
Hide file tree
Showing 49 changed files with 886 additions and 389 deletions.
6 changes: 5 additions & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{
"buildCommand": "compile",
"buildCommand": "bundle",
"installCommand": "install-with-npm-8.5",
"packages": [
"packages/usage-reporting-protobuf",
"packages/server"
],
"publishDirectory": {
"@apollo/server": "packages/server/bundled",
"@apollo-usage-reporting-protobuf": "packages/usage-reporting-protobuf"
},
"sandboxes": ["apollo-server-typescript-3opde","apollo-server"],
"node": "16"
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Ignore the compiled output.
dist/
bundled/

# TypeScript incremental compilation cache
*.tsbuildinfo
Expand Down
Loading

0 comments on commit 2f02d88

Please sign in to comment.