dao-xyz / borsh-ts

⚡️fast TypeScript implementation of Borsh serialization format
Apache License 2.0
37 stars 2 forks source link

Support for dynamic imports #20

Open marcus-pousette opened 1 year ago

marcus-pousette commented 1 year ago

Currently this would fail

s.ts

class Super {}

a.ts


import { Super } from './s.ts'

@variant("a") class A extends Super {}


> b.ts
```typescript
import { Super } from './s.ts'
@variant("b")
class B extends Super {}

Then in another file

index.ts

const { A }  = await import("./a.js")
const { B }  = await import("./b.js")

When doing dynamic import Super will only be extended by either A or B, not both.