Skip to content

Commit 43d8bc6

Browse files
authored
Restore deprecated exports of @khanacademy/perseus (#2180)
The removal of these functions was causing problems for people who wanted to use a dev build of Perseus in webapp, because webapp is still importing them. We need to update webapp to import these functions from perseus-core instead, and then we can remove them from perseus. Issue: none ## Test plan: `yarn test` Author: benchristel Reviewers: jeremywiebe Required Reviewers: Approved By: jeremywiebe Checks: ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x) Pull Request URL: #2180
1 parent 97e07c8 commit 43d8bc6

File tree

3 files changed

+44
-5
lines changed

3 files changed

+44
-5
lines changed

.changeset/great-cameras-play.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@khanacademy/perseus": patch
3+
---
4+
5+
Restores the following deprecated exports to `@khanacademy/perseus`:
6+
`parsePerseusItem`, `parseAndMigratePerseusItem`,
7+
`parseAndMigratePerseusArticle`, `isSuccess`, `isFailure`, `Result`, `Success`,
8+
`Failure`.

.changeset/poor-masks-return.md

-5
This file was deleted.

packages/perseus/src/index.ts

+36
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,28 @@ export {
108108
getAnswerFromUserInput,
109109
getImagesWithoutAltData,
110110
} from "./util/extract-perseus-data";
111+
export {
112+
/**
113+
* @deprecated - import this function from perseus-core instead
114+
*/
115+
parsePerseusItem,
116+
/**
117+
* @deprecated - import this function from perseus-core instead
118+
*/
119+
parseAndMigratePerseusItem,
120+
/**
121+
* @deprecated - import this function from perseus-core instead
122+
*/
123+
parseAndMigratePerseusArticle,
124+
/**
125+
* @deprecated - import this function from perseus-core instead
126+
*/
127+
isSuccess,
128+
/**
129+
* @deprecated - import this function from perseus-core instead
130+
*/
131+
isFailure,
132+
} from "@khanacademy/perseus-core";
111133

112134
export {
113135
generateTestPerseusItem,
@@ -181,6 +203,20 @@ export type {
181203
SharedRendererProps,
182204
} from "./types";
183205
export type {ParsedValue} from "./util";
206+
export type {
207+
/**
208+
* @deprecated - import this function from perseus-core instead
209+
*/
210+
Result,
211+
/**
212+
* @deprecated - import this function from perseus-core instead
213+
*/
214+
Success,
215+
/**
216+
* @deprecated - import this function from perseus-core instead
217+
*/
218+
Failure,
219+
} from "@khanacademy/perseus-core";
184220
export type {Coord} from "./interactive2/types";
185221
export type {
186222
RendererPromptJSON,

0 commit comments

Comments
 (0)