Follow-up to issue: SSR: Add a way to configure externalDependencies for the server bundle only
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- build-system
调研方向
Start from the application-builder option definitions where externalDependencies is declared (schema and option resolution under packages/angular/build), then locate where the server and browser esbuild configurations diverge. Note the report that dev builds and prod builds are configured differently — both paths must apply the new option. Done looks like a server-only externalization option that is accepted, applied only to the server bundle (e.g. graphql external on server, bundled in browser), and verified with an SSR build; API naming needs maintainer sign-off first.
由索引模型根据 Issue 内容生成。
描述
Command
build
Description
As title says, I'd like to follow-up on the unfortunately closed issue https://github.com/angular/angular-cli/issues/26487, requesting to configure externalDependencies independently for server and browser bundle.
Reading the mentioned issue, it has been closed because no particular value has been seen in being able to configure externalDependencies independently. However I'd like to point to a realistic and important case where such an option will be crucial.
Right now, we're still on using Webpack, which allows configuring externalDependencies explicitly for the server bundle, and that's the reason why it's not blocking us yet. But there's plans to eventually migrate to application-builder, however still a lot of obstacles ned to be solved, as like the mentioned lack of being able to define externalDependencies for server bundle only.
Our case is, we're using DataDog dd-trace for monitoring our server app infrastructure. dd-trace is being injected on runtime and requires all node packages doing downstream requests being external as otherwise it cannot properly trace them. See https://docs.datadoghq.com/tracing/trace_collection/dd_libraries/nodejs/#bundling
In our particular scenario, this applies to graphql package. We had to externalize it, as otherwise we wouldn't get logs for all requests towards our GraphQL API on server-side. But on the client-side using the browser-bundle we do not want graphql package being external, as there's absolutely no reason in it.
So, our particular needs can be properly served by using Webpack builder but with the current options for application-builder this isn't possible.
As a workaround I tried to implement a custom Esbuild plugin, which should reset the external dependencies just for the browser build. But due to the Angular build architecture this only works for a prod build but not for a development build. So I eventually dropped this idea, which anyway doesn't seem clean.
Hence I'd highly appreciate if you could change your mind in considering separate externalDependencies configurations for server and browser build.
Describe the solution you'd like
Being able to configure externalDependencies separately for server and browser build.
Describe alternatives you've considered
No response
- 主要语言
- TypeScript
- 星标
- 27k
- 派生
- 11.8k
- 平均合并
- 1 天 2 分钟
- 30 天内合并 PR
- 168
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
angular/angular-cli 的其他 Issue
-
area: @angular/build gemini-triaged
难度 2/5 1-3 小时 新手友好度 74/100
angular/angular-cli#33955 ·
维护者通常 1 天内回复
-
area: @angular/cli gemini-triaged
难度 2/5 1-3 小时 新手友好度 72/100
angular/angular-cli#33055 · 1 条评论 · 3 个 reaction ·
维护者通常 1 天内回复
-
dev-server: es2016 prebundle target for zone.js apps lowers private fields and breaks dependencies未关闭area: @angular/build
难度 4/5 3-5 天 新手友好度 48/100
angular/angular-cli#34280 ·
维护者通常 1 天内回复
-
Vite dev server: proxy config normalization reorders glob keys, drops string `context` and misses URLs with a query string可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭area: @angular/build
难度 4/5 3-5 天 新手友好度 65/100
angular/angular-cli#34257 ·
维护者通常 1 天内回复
-
Add CSP nonce to <link rel="stylesheet"> tags when ngCspNonce is set可能已有人在做 @alan-agius4 于 3 天前认领。 未关闭area: @angular/build
难度 2/5 1-3 小时 新手友好度 35/100
angular/angular-cli#34255 ·
维护者通常 1 天内回复
查看 angular/angular-cli 的全部 Issue
相似的 Issue
-
[bug] diagnostics.dumpBody:Buffer 形态请求(透传 lane)跳过 dumps/ 落盘,仅留 raw/-unknown-可能已有人在做 @ranxianglei 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
ranxianglei/billion-context#2421 · 2 条评论 ·
维护者通常 1 天内回复
-
pending triage
难度 2/5 1-3 小时 新手友好度 76/100
nuxt/test-utils#1842 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
MoonshotAI/kimi-code#4146 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
farbenmeer/tapi#531 ·
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复