Skip to content

Commit ed5d1f8

Browse files
committed
simplify
1 parent 28981d0 commit ed5d1f8

File tree

1 file changed

+57
-166
lines changed

1 file changed

+57
-166
lines changed

text/0149-merge-bundler-plugins.md

Lines changed: 57 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77

88
# Stakeholders
99

10-
| Role | People |
11-
|------|--------|
12-
| Driver | @chargome / JavaScript SDK Team|
13-
| Approver | JavaScript SDK Team |
10+
| Role | People |
11+
| -------------------- | ----------------------------------------- |
12+
| Driver | @chargome / JavaScript SDK Team |
13+
| Approver | JavaScript SDK Team |
1414
| Informed (potential) | Docs Team, Other SDK Engineering Managers |
1515

1616
# Summary
1717

18-
This RFC proposes merging the [sentry-javascript-bundler-plugins](https://github.com/getsentry/sentry-javascript-bundler-plugins) repository into the [sentry-javascript](https://github.com/getsentry/sentry-javascript) monorepo. This consolidation will unify versioning (shipping majors together), reduce maintenance overhead, and improve the developer experience for both maintainers and users.
18+
This RFC proposes merging the [sentry-javascript-bundler-plugins](https://github.com/getsentry/sentry-javascript-bundler-plugins) repository into the [sentry-javascript](https://github.com/getsentry/sentry-javascript) monorepo. This consolidation will unify versioning, reduce maintenance overhead, and improve the developer experience for both maintainers and users.
1919

2020
# Motivation
2121

@@ -24,222 +24,113 @@ The bundler plugins (`@sentry/webpack-plugin`, `@sentry/vite-plugin`, `@sentry/r
2424
1. **Versioning complexity**: Independent release cycles make it difficult to ensure compatibility between SDK and plugins.
2525
2. **Testing limitations**: Cannot easily test plugins against the actual SDK code they'll be bundling.
2626
3. **Contributor friction**: Developers working on cross-boundary features need to context-switch between repositories.
27-
4. **User confusion**: Users often expect bundler plugins to live in the main SDK repository and file issues in the wrong place.
27+
4. **User confusion**: Users often file issues in the wrong repository.
2828
5. **Duplicate infrastructure**: Separate CI/CD pipelines, release processes, and tooling configurations.
29-
6. **Triaging overhead**: Issues split across repositories complicates tracking and prioritization.
30-
31-
By merging the repositories, we can:
32-
33-
- Align bundler plugin versions with SDK versions (only shipping majors together)
34-
- Test plugins with the actual SDK code they'll bundle
35-
- Simplify the release process to a single Craft configuration
36-
- Provide better tooling support (including LLM/AI context) for cross-boundary development
37-
- Consolidate issue triaging with labels
3829

3930
# Background
4031

41-
The bundler plugins were originally developed in a separate repository (during hackweek) to allow independent versioning and release cycles. The plugins are built on [unplugin](https://github.com/unjs/unplugin) and provide:
42-
43-
- Sourcemap upload to Sentry
44-
- Release creation and management
45-
- Automatic release name discovery
46-
- Release injection for automatic error association
47-
- React component display names for breadcrumbs and Session Replays
32+
The bundler plugins were originally developed in a separate repository to allow independent versioning. The plugins are built on [unplugin](https://github.com/unjs/unplugin) and provide sourcemap upload, release creation/management, release injection, and React component display names for breadcrumbs and Session Replays.
4833

4934
## Current State
5035

51-
### sentry-javascript-bundler-plugins
52-
53-
| Aspect | Details |
54-
|--------|---------|
55-
| License | MIT |
56-
| Current Version | v4.x |
57-
| Testing Framework | Jest |
58-
| Node.js Minimum | Node 16 |
59-
| Monorepo Tool | Nx |
60-
| Package Manager | Yarn |
61-
62-
63-
### Packages
64-
65-
- `@sentry/bundler-plugin-core` - Shared bundler-agnostic functionality
66-
- `@sentry/webpack-plugin` - Webpack 4 and 5 support
67-
- `@sentry/vite-plugin` - Vite support
68-
- `@sentry/rollup-plugin` - Rollup support
69-
- `@sentry/esbuild-plugin` - esbuild support
70-
71-
### sentry-javascript
72-
73-
| Aspect | Details |
74-
|--------|---------|
75-
| License | MIT |
76-
| Testing Framework | Vitest |
77-
| Node.js Minimum | Node 18+ |
78-
| Monorepo Tool | Nx/Lerna |
79-
| Package Manager | Yarn |
80-
81-
## License
82-
83-
Both repositories use the **MIT license**. There is no license conflict for this merge.
84-
85-
# Options Considered
86-
87-
## Option 1: Merge into sentry-javascript monorepo (Recommended)
88-
89-
Move all bundler plugin packages into the `sentry-javascript` repository as part of the existing monorepo structure.
90-
91-
### Approach
92-
93-
1. Copy packages into `sentry-javascript/packages/` directory
94-
2. Integrate with existing Nx build system
95-
3. Migrate tests from Jest to Vitest
96-
4. Unify versioning with SDK packages (majors released together)
97-
5. Update Craft configuration to publish bundler plugin packages
98-
99-
### Versioning Strategy
100-
101-
- **Major versions**: Released together with sentry-javascript major versions
102-
- **Minor/Patch versions**: Released together with sentry-javascript minor versions (streamlined for all packages in this repo)
103-
- Initial merge should coincide with **v11 major release** to accommodate breaking changes (Node 16 drop)
104-
105-
### Package Publishing
106-
107-
Continue publishing existing package names for backwards compatibility:
36+
| Aspect | sentry-javascript-bundler-plugins | sentry-javascript |
37+
| --------------- | --------------------------------- | ----------------- |
38+
| License | MIT | MIT |
39+
| Current Version | v4.x | v9.x |
40+
| Test Framework | Jest | Vitest |
41+
| Node.js Minimum | Node 16 | Node 18+ |
42+
| Monorepo Tool | Nx | Nx/Lerna |
10843

44+
**Packages to migrate:**
10945
- `@sentry/bundler-plugin-core`
11046
- `@sentry/webpack-plugin`
11147
- `@sentry/vite-plugin`
11248
- `@sentry/rollup-plugin`
11349
- `@sentry/esbuild-plugin`
11450

115-
### Future: Package Consolidation (Out of Scope)
116-
117-
In a future phase (not part of this RFC), consolidate all plugins into a single `@sentry/bundler-plugins` package with subpath exports:
51+
# Options Considered
11852

119-
```
120-
@sentry/bundler-plugins/webpack
121-
@sentry/bundler-plugins/vite
122-
@sentry/bundler-plugins/rollup
123-
@sentry/bundler-plugins/esbuild
124-
```
53+
## Option 1: Merge into sentry-javascript monorepo (Recommended)
12554

126-
This would require cross-publishing/aliasing to existing package names for backwards compatibility.
55+
Move all bundler plugin packages into the `sentry-javascript` repository. A two-phase approach (preparatory work in original repo, then final merge) reduces risk and allows changes to be tested in isolation.
12756

12857
## Option 2: Keep repositories separate
12958

13059
Maintain the current separate repository structure.
13160

13261
**Rejected because**: Does not address the core issues of versioning complexity, testing limitations, and contributor friction.
13362

134-
# Implementation Strategy
63+
# Implementation Plan
13564

13665
## Prerequisites
13766

138-
- [x] Verify license compatibility (both MIT ✅)
139-
- [ ] Gather Webpack 4 usage statistics to inform support decision
140-
- [ ] Decide on Sentry CLI v3 migration timing (bundler-plugins issue https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/825)
141-
142-
## Phase 1: Preparation
143-
144-
1. **Audit dependencies**: Review all bundler-plugin package dependencies for conflicts with sentry-javascript
145-
2. **Document public APIs**: Ensure all public APIs are documented and compatibility is maintained
146-
3. **Publish final standalone version**: Release final version from bundler-plugins repo with deprecation notice
67+
- [x] Verify license compatibility (both MIT)
68+
- [ ] Gather Webpack 4 usage statistics ([PR #857](https://github.com/getsentry/sentry-javascript-bundler-plugins/pull/857))
14769

148-
## Phase 2: Migration
70+
## Phase 1: Preparation (in sentry-javascript-bundler-plugins repo)
14971

150-
1. **Copy packages**: Move packages into `sentry-javascript/packages/` directory
151-
- Option A: Flat structure alongside other packages
152-
- Option B: Nested under `packages/bundler-plugins/` subdirectory (preferred?)
72+
On a dedicated branch (e.g., `merge-prep`):
15373

154-
2. **Integrate with sentry-javascript's monorepo setup**: Adapt package configurations to match target repo's build system
74+
1. **Update dependencies**:
75+
- Bump minimum Node.js to 18+
76+
- Migrate unplugin to v2 (drops Node 16 and Webpack 4 support)
77+
- Bump Sentry CLI to v3
78+
2. **Migrate tests from Jest to Vitest**
79+
3. **Audit dependencies** for conflicts with sentry-javascript
80+
4. **Publish final standalone version** with deprecation notice
15581

156-
3. **Migrate tests**: Convert Jest tests to Vitest
157-
- Update test configuration
158-
- Migrate Jest-specific APIs to Vitest equivalents
159-
- Ensure test coverage is maintained
82+
## Phase 2: Migration to sentry-javascript
16083

161-
4. **Update dependencies**:
162-
- Bump minimum Node.js version to 18+
163-
- Update unplugin to latest version
164-
- Remove Node 16 compatibility workarounds
84+
1. **Copy packages** into `sentry-javascript/packages/` (flat structure or nested under `packages/bundler-plugins/`)
85+
2. **Integrate with monorepo** build system and CI
86+
3. **Update `.craft.yml`** for new release targets
16587

166-
5. **Configure CI**: Add bundler plugin jobs to GitHub Actions
167-
- Build bundler plugins in parallel job (doesn't impact overall CI time)
168-
- Integration tests with actual SDK code
88+
## Phase 3: Release
16989

170-
## Phase 3: Publishing Configuration
90+
1. **Ship with sentry-javascript v11** to accommodate breaking changes
91+
2. **Communication**: Deprecation notice on old repo, update documentation
17192

172-
1. **Update `.craft.yml`** for new release targets
93+
## Phase 4: Post-Migration
17394

174-
2. **Version synchronization**: Configure packages to use SDK version numbers
95+
1. **Archive** `sentry-javascript-bundler-plugins` with README pointing to monorepo
17596

176-
3. **GitHub Actions**: Update release workflows to include bundler plugin packages
97+
# Breaking Changes
17798

178-
## Phase 4: Release
99+
Released with v11:
179100

180-
1. **Major version release**: First unified release as part of sentry-javascript v11
101+
1. **Node.js 16 dropped** - Minimum version increased to 18+
102+
2. **Webpack 4 dropped** (pending usage stats) - Required by unplugin v2; Webpack 5 was released 5+ years ago
103+
3. **Version number jump** - Plugins jump from v4.x to v11.x to align with SDK
181104

182-
2. **Communication**:
183-
- Deprecation notice on old repository
184-
- Migration guide for users (anything to do here?)
185-
- Update documentation
105+
# Versioning Strategy
186106

187-
## Phase 5: Post-Migration
107+
- **Major versions**: Released together with sentry-javascript majors
108+
- **Minor/Patch versions**: Released together with sentry-javascript (all packages share same version)
188109

189-
1. **Archive repository**: Archive `sentry-javascript-bundler-plugins` with README pointing to monorepo
190-
2. **Cleanup**: Remove any remaining references to old repository
110+
# Future Considerations (Out of Scope)
191111

192-
# Potential Breaking Changes
112+
Consolidate all plugins into a single `@sentry/bundler-plugins` package with subpath exports (e.g., `@sentry/bundler-plugins/webpack`). Would require aliasing to existing package names for backwards compatibility.
193113

194-
This migration will introduce the following breaking changes (to be released with v11):
195-
196-
1. **Node.js 16 support dropped**: Minimum Node.js version increased to 18+
197-
2. **Webpack 4 support dropped** (pending usage stats): Webpack 4 requires `NODE_OPTIONS=--openssl-legacy-provider` on Node 17+; Webpack 5 was released 5+ years ago
198-
3. **Version number jump**: Plugin packages will jump from v4.x to v11.x to align with SDK versioning
199-
200-
# Known Drawbacks
201-
202-
1. **Larger monorepo**: Increases repository size and potentially CI times (mitigated by parallel jobs)
203-
2. **Migration effort**: One-time cost to migrate packages, tests, and configuration
204-
3. **Version number jump**: Users may be confused by jump from v4.x to v11.x
205-
4. **Loss of independent releases**: Minor/patch releases tied to SDK schedule (unless Craft is configured otherwise)
206-
207-
# Pros and Cons Summary
114+
# Pros and Cons
208115

209116
## Pros
210117

211118
- Single source of truth for all JavaScript SDK tooling
212-
- Consistent versioning across SDK and build tools
213-
- Shared infrastructure (CI, linting, testing patterns)
214-
- Easier to ensure compatibility between SDK and plugins
215-
- Can test plugins with actual SDK code they'll bundle
119+
- Consistent versioning and shared infrastructure
120+
- Can test plugins with actual SDK code
216121
- Reduced cognitive load for contributors
217-
- Simpler dependency management
218-
- Better triaging with labels (users don't know about separate repo)
219-
- Shared context for LLMs when developing cross-boundary features
220-
- All plugin code has minimal impact on repo size
122+
- Better triaging (users don't know about separate repo)
221123

222124
## Cons
223125

224-
- Migration effort and potential breaking changes
225-
- Independent release cycles no longer possible without extra Craft work
126+
- One-time migration effort
127+
- Independent release cycles no longer possible without extra Craft configuration
226128
- Larger monorepo
227-
- Risk of disrupting existing users during transition
228-
- Increased complexity in the sentry-javascript repo
229-
230-
# Unresolved Questions
231-
232-
1. **Independent versioning**: Should we configure Craft to support independent minor/patch releases for bundler plugins, or tie everything to the SDK release schedule? Recommended: Same release cycle
233-
234-
2. **Webpack 4 support**: What are the current usage statistics? Should we drop support in v11, or maintain it with workarounds?
235-
236-
3. **Sentry CLI v3**: Should the Sentry CLI v3 migration (bundler-plugins issue bundler-plugins issue https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/825) happen before or after the merge?
237-
238-
5. **SDK re-exports**: Should we re-export plugins from SDK packages in the future? This ships dev dependencies as prod dependencies, which users have complained about.
129+
- Version jump from v4.x to v11.x may confuse users
239130

240131
# References
241132

242133
- [sentry-javascript-bundler-plugins repository](https://github.com/getsentry/sentry-javascript-bundler-plugins)
243134
- [sentry-javascript repository](https://github.com/getsentry/sentry-javascript)
244135
- [RFC 0086: Sentry Bundler Plugins API](https://github.com/getsentry/rfcs/blob/main/text/0086-sentry-bundler-plugins-api.md)
245-
- [unplugin](https://github.com/unjs/unplugin)
136+
- [unplugin](https://github.com/unjs/unplugin)

0 commit comments

Comments
 (0)