Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Support lazy loading for content files #234

Closed
2 tasks
brandonroberts opened this issue Jan 25, 2023 · 0 comments
Closed
2 tasks

Feature: Support lazy loading for content files #234

brandonroberts opened this issue Jan 25, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@brandonroberts
Copy link
Member

brandonroberts commented Jan 25, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant