alloc / alloc/saus

Add `preload` function to be called in module scope

Offen
#63 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
roadmap runtime
Vorherrschende Sprache
TypeScript
Sterne
38
Forks
1
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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')
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.