E2B icon indicating copy to clipboard operation
E2B copied to clipboard

Templates SDK JS - Use classes instead of interface

Open mishushakov opened this issue 4 months ago • 2 comments

Change

In JavaScript specifically this is implemented using interfaces unlike classes in Python. I've found some issues with the interfaces-based approach - you're able to pass empty TemplateBase to Template.build when you are not supposed to and also there was also much duplication in types.ts.

It's also probably not safe at all when using pure JS without TypeScript as you won't see compiler errors.

it was working until this point, because we had other methods on the TemplateFinal interface, but it's now empty so it doesn't match anything anymore.

mishushakov avatar Sep 05 '25 11:09 mishushakov

⚠️ No Changeset found

Latest commit: acccb35e2bd86daae7e61b7fe684e71c55342e8b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Sep 05 '25 11:09 changeset-bot[bot]

it doesn't have to because base image will always be specified

mishushakov avatar Sep 05 '25 13:09 mishushakov