alloc / alloc/saus

Add `preload` function to be called in module scope

Open
#63 0 comments 0 reactions 0 assignees View on GitHub
roadmap runtime
Dominant language
TypeScript
Stars
38
Forks
1
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.