Feature: Support lazy loading for content files

This issue has been tracked since 2023-01-25.

Which scope/s are relevant/related to the feature request?

content

Information

Currently, content files are loaded eagerly into the main JS bundle. The initial JS bundle size increases as you add more markdown content files. These files should be lazy-loaded to decrease the initial JavaScript bundle size.

Currently, the injectContentFiles() produces a static list of content + frontmatter attributes. Need to figure out a way to produce the frontmatter attributes for this list and still lazy load the content.

https://github.com/analogjs/analog/blob/main/packages/content/src/lib/get-raw-files.ts#L1

Changing how these files are loaded will most likely be a breaking change to the types.

Describe any alternatives/workarounds you're currently using

Workaround is to put the markdown content files as routes instead of in the /src/content folder. With #233 the routes will be lazy loaded but some flexibility in display is lost

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No
More Details About Repo
Owner Name analogjs
Repo Name analog
Full Name analogjs/analog
Language TypeScript
Created Date 2022-07-06
Updated Date 2023-03-28
Star Count 885
Watcher Count 18
Fork Count 67
Issue Count 33

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date