Skip to content

feat: deprecate extend methods #2299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 13, 2025
6 changes: 6 additions & 0 deletions .changeset/empty-pears-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"jazz-example-music-player": minor
"jazz-tools": minor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are only deprecating, this one can be a patch.

---

Deprecated `Group.extend` and `Group.revokeExtend` (use `Group.addMember` and `Group.removeMember` respectively)
4 changes: 2 additions & 2 deletions examples/music-player/src/4_actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export async function addTrackToPlaylist(
* visible to the Playlist user
*/
const trackGroup = track._owner;
trackGroup.extend(playlist._owner);
trackGroup.addMember(playlist._owner);

playlist.tracks?.push(track);
return;
Expand All @@ -129,7 +129,7 @@ export async function removeTrackFromPlaylist(

if (track._owner._type === "Group" && playlist._owner._type === "Group") {
const trackGroup = track._owner;
await trackGroup.revokeExtend(playlist._owner);
await trackGroup.removeMember(playlist._owner);

const index =
playlist.tracks?.findIndex(
Expand Down
8 changes: 4 additions & 4 deletions homepage/homepage/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ html.dark {
display: none;
}
.twoslash .twoslash-hover:hover .twoslash-popup-container,
.twoslash .twoslash-error-hover:hover .twoslash-popup-container,
.twoslash .twoslash-query-presisted .twoslash-popup-container,
.twoslash .twoslash-query-line .twoslash-popup-container {
.twoslash .twoslash-error-hover:hover .twoslash-popup-container,
.twoslash .twoslash-query-presisted .twoslash-popup-container,
.twoslash .twoslash-query-line .twoslash-popup-container {
display: inline-flex;
}
}
43 changes: 23 additions & 20 deletions homepage/homepage/components/docs/DocsNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,31 @@ import React from "react";

export function DocNav() {
const framework = useFramework();
const items = (docNavigationItems as DocNavigationSection[]).map((headerItem) => {
return {
...headerItem,
items: headerItem.items
.filter(
(item) => !("framework" in item) || item.framework === framework,
)
.map((item) => {
if (!item.href?.startsWith("/docs")) return item;
const items = (docNavigationItems as DocNavigationSection[]).map(
(headerItem) => {
return {
...headerItem,
items: headerItem.items
.filter(
(item) => !("framework" in item) || item.framework === framework,
)
.map((item) => {
if (!item.href?.startsWith("/docs")) return item;

const frameworkDone = (item.done as any)[framework] ?? 0;
let done = typeof item.done === "number" ? item.done : frameworkDone;
let href = item.href.replace("/docs", `/docs/${framework}`);
const frameworkDone = (item.done as any)[framework] ?? 0;
let done =
typeof item.done === "number" ? item.done : frameworkDone;
let href = item.href.replace("/docs", `/docs/${framework}`);

return {
...item,
href,
done,
};
}),
};
});
return {
...item,
href,
done,
};
}),
};
},
);

return (
<SideNav>
Expand Down
2 changes: 1 addition & 1 deletion homepage/homepage/content/docs/docNavigationItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export const docNavigationItems = [
done: 10,
},
{
name: "Group inheritance",
name: "Groups as members",
href: "/docs/groups/inheritance",
done: 100,
},
Expand Down
2 changes: 1 addition & 1 deletion homepage/homepage/content/docs/docNavigationItemsTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export type DocNavigationSection = {
items: DocNavigationItem[];
collapse?: boolean;
prefix?: string;
};
};
Loading
Loading