Commit b628def
authored
Dont use require() for imports in TS files (#1665)
<!-- ELLIPSIS_HIDDEN -->
> [!IMPORTANT]
> Replace `require()` with `import` for `ThrowIfVersionMismatch` in
TypeScript files and update comments for upgrade guidance.
>
> - **Imports**:
> - Replace `require()` with `import` for `ThrowIfVersionMismatch` in
`index.ts.j2`, `react/baml_client/index.ts`, and
`typescript/baml_client/index.ts`.
> - **Error Handling**:
> - Remove error handling for `require()` failures, as `import` will
handle this.
> - **Comments**:
> - Add comments in all files to guide users on upgrading
`@boundaryml/baml` if import fails.
>
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup>
for 295be65. It will automatically
update as commits are pushed.</sup>
<!-- ELLIPSIS_HIDDEN -->1 parent f503cdc commit b628def
3 files changed
Lines changed: 54 additions & 87 deletions
File tree
- engine/language_client_codegen/src/typescript/templates
- integ-tests
- react/baml_client
- typescript/baml_client
Lines changed: 18 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
3 | 17 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 18 | + | |
10 | 19 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 20 | + | |
32 | 21 | | |
33 | 22 | | |
34 | 23 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments