alloc / alloc/saus

Add `preload` function to be called in module scope

Aperta
#63 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
roadmap runtime
Lingua principale
TypeScript
Stelle
38
Fork
1
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

The goal is to allow APIs like `React.lazy` to be transformed into SSR friendly code. The transformation itself would be done by a Saus plugin. The `preload` function mentioned in this issue's title will come in handy for injecting `` tags for the rewritten dynamic imports.

```ts
// Before
const Foo = React.lazy(() => import('./Foo'))

// After (SSR only)
import { preload } from 'saus/preload'
import Foo from './Foo'
preload('/src/Foo')
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.