You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`create()` signature changed to `create({ cwd, ...options })`. The old `create(cwd, options)`form still works but is deprecated and will be removed in the next major.
18
-
-`sv.pnpmBuildDependency()` is deprecated. Use `sv.file()` with `pnpm.onlyBuiltDependencies()` from `@sveltejs/sv-utils` instead. Still works for now.
19
-
-`workspace.file.prettierignore`, `.prettierrc`, `.eslintConfig`, `.vscodeSettings`, `.vscodeExtensions` are deprecated. Use the raw strings directly (e.g. `'.prettierignore'`). Still works for now.
17
+
-`create()` signature changed to `create({ cwd, ...options })`. The old `create(cwd, options)` is deprecated and will be removed in the next major release.
18
+
-`sv.pnpmBuildDependency()` is deprecated and will be removed in the next major release. Use `sv.file()` with `pnpm.onlyBuiltDependencies()` from `@sveltejs/sv-utils` instead.
19
+
-`workspace.file.prettierignore`, `.prettierrc`, `.eslintConfig`, `.vscodeSettings`, `.vscodeExtensions` are deprecated and will be removed in the next major release. Use the raw strings directly (e.g. `'.prettierignore'`).
20
20
- Add `workspace.file.findUp()` to locate files by walking up the directory tree.
21
-
- Make type exports explicit (no more `export type *`). Removed types that were never part of the intended public API: `PackageDefinition`, `Scripts`, `TestDefinition`.
22
-
- Remove `setup`, `createProject`, `startPreview`, `addPnpmBuildDependencies` from `sv/testing` exports.
23
21
- Add `api-surface.md` snapshots (auto-generated on build) to track the public API of `sv` and `@sveltejs/sv-utils`.
22
+
- Remove `setup`, `createProject`, `startPreview`, `addPnpmBuildDependencies` from `sv/testing` exports.
23
+
- Make type exports explicit (no more `export type *`). Removed types that were never part of the intended public API: `PackageDefinition`, `Scripts`, `TestDefinition`.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -153,16 +153,16 @@ To run svelte-migrate locally:
153
153
node ./packages/migrate/bin.js
154
154
```
155
155
156
-
## Deprecation pattern
156
+
## Deprecation
157
157
158
-
When removing public API from `sv`, **do not hard-remove** it. Instead, deprecate it and keep it working until the next major version.
158
+
Public APIs cannot be changed in a minor release since it is a breaking change. Instead, the old behaviour is marked as deprecated until the next major version, at which point they can be removed.
159
159
160
160
### How to deprecate
161
161
162
162
1.**Add `@deprecated` JSDoc** on the type/function - IDEs will show strikethrough:
163
163
164
164
```ts
165
-
/**@deprecated use `newThing()` instead */
165
+
/**@deprecated use `newThing()` instead.*/
166
166
```
167
167
168
168
2.**Emit a runtime warning** (for functions/methods) using `svDeprecated()` from `core/deprecated.ts`. Warns once per message:
@@ -175,7 +175,7 @@ When removing public API from `sv`, **do not hard-remove** it. Instead, deprecat
175
175
176
176
### Before a major release
177
177
178
-
Search for `svDeprecated` and `@deprecated` to find and remove all deprecated APIs:
178
+
Search for `svDeprecated` and `@deprecated` to find and remove all deprecated APIs.
0 commit comments