Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Example/expoUsePushy/TestConsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ export default function TestConsole({visible, onClose}) {
},
},
{
name: 'getLocalHashInfo',
invoke: () => {
setText(`getLocalHashInfo\n${Hash}`);
},
},
{
name: 'setUuid',
Expand Down
4 changes: 0 additions & 4 deletions Example/harmony_use_pushy/TestConsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ export default function TestConsole({visible, onClose}) {
},
},
{
name: 'getLocalHashInfo',
invoke: () => {
setText(`getLocalHashInfo\n${Hash}`);
},
},
{
name: 'setUuid',
Expand Down
1 change: 0 additions & 1 deletion Example/testHotUpdate/e2e/local-merge.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ describe('Local Update Merge E2E', () => {

await openTestConsole();
await runCommand('setLocalHashInfo');
await runCommand('getLocalHashInfo');
await runCommand('setUuid');
await runCommand('downloadFullUpdate');
await runCommand('setNeedUpdateFull');
Expand Down
4 changes: 0 additions & 4 deletions Example/testHotUpdate/src/TestConsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ export default function TestConsole({visible, onClose}) {
},
},
{
name: 'getLocalHashInfo',
invoke: () => {
setText(convertCommands('getLocalHashInfo', LOCAL_UPDATE_HASHES.full));
},
},
{
name: 'setUuid',
Expand Down
2 changes: 0 additions & 2 deletions src/__tests__/core.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ describe('core info parsing', () => {
buildTime: '2023-01-01',
uuid: 'existing-uuid',
setLocalHashInfo: mock(() => {}),
getLocalHashInfo: mock(() => Promise.resolve('{}')),
setUuid: mock(() => {}),
},
},
Expand Down Expand Up @@ -84,7 +83,6 @@ describe('core info parsing', () => {
buildTime: '2023-01-01',
uuid: 'existing-uuid',
setLocalHashInfo: mockSetLocalHashInfo,
getLocalHashInfo: mock(() => Promise.resolve('{}')),
setUuid: mock(() => {}),
},
},
Expand Down
10 changes: 0 additions & 10 deletions src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export const defaultContext = {
downloadUpdate: asyncNoop,
downloadAndInstallApk: asyncNoop,
restartApp: asyncNoop,
getCurrentVersionInfo: () => Promise.resolve({}),
parseTestQrCode: () => false,
currentHash: '',
packageVersion: '',
Expand All @@ -30,12 +29,6 @@ export const UpdateContext = createContext<{
dismissError: () => void;
downloadUpdate: () => Promise<boolean | void>;
downloadAndInstallApk: (url: string) => Promise<void>;
// @deprecated use currentVersionInfo instead
getCurrentVersionInfo: () => Promise<{
name?: string;
description?: string;
metaInfo?: string;
}>;
currentVersionInfo: {
name?: string;
description?: string;
Expand All @@ -61,6 +54,3 @@ export const useUpdate = __DEV__ ? () => {

return context;
} : () => useContext(UpdateContext);

/** @deprecated Please use `useUpdate` instead */
export const usePushy = useUpdate;
12 changes: 0 additions & 12 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,6 @@ export const buildTime: string = PushyConstants.buildTime;
let uuid = PushyConstants.uuid;


async function getLocalHashInfo(hash: string) {
return JSON.parse(await PushyModule.getLocalHashInfo(hash));
}

// @deprecated use currentVersionInfo instead
export async function getCurrentVersionInfo(): Promise<{
name?: string;
description?: string;
metaInfo?: string;
}> {
return currentVersion ? (await getLocalHashInfo(currentVersion)) || {} : {};
}

export const pushyNativeEventEmitter = new NativeEventEmitter(PushyModule);

Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { Pushy, Cresc } from './client';
export { UpdateContext, usePushy, useUpdate } from './context';
export { PushyProvider, UpdateProvider } from './provider';
export { UpdateContext, useUpdate } from './context';
export { UpdateProvider } from './provider';
Comment on lines +2 to +3
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Public export removal needs migration follow-through.

This removes root-level usePushy/PushyProvider, which is a breaking API change. Example/expoUsePushy/App.tsx still imports these from react-native-update (Line 9), so that path will now fail. Please update downstream examples/docs in this PR and include a migration note (or ensure this ships as a major-version change).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/index.ts` around lines 2 - 3, You removed the root-level exports
usePushy/PushyProvider which breaks existing imports (e.g.,
Example/expoUsePushy/App.tsx); restore compatibility by either updating
downstream examples to import the new symbols (useUpdate and UpdateProvider) or
reintroduce legacy exports in the public surface: add exports that map the old
names to the new ones (e.g., export { UpdateProvider as PushyProvider } and
export { useUpdate as usePushy } from the same module) and add a brief migration
note in the changelog documenting the rename and recommending switching to
useUpdate/UpdateProvider.

export { PushyModule, UpdateModule } from './core';
5 changes: 0 additions & 5 deletions src/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { Pushy, Cresc, sharedState } from './client';
import {
currentVersion,
packageVersion,
getCurrentVersionInfo,
currentVersionInfo,
} from './core';
import {
Expand Down Expand Up @@ -411,7 +410,6 @@ export const UpdateProvider = ({
currentHash: currentVersion,
progress,
downloadAndInstallApk,
getCurrentVersionInfo,
currentVersionInfo,
parseTestQrCode,
restartApp,
Expand All @@ -420,6 +418,3 @@ export const UpdateProvider = ({
</UpdateContext.Provider>
);
};

/** @deprecated Please use `UpdateProvider` instead */
export const PushyProvider = UpdateProvider;
Loading