Skip to content

Conversation

@dileepapeiris
Copy link

Description

Fixes #20858

Improves the Backend Integration Guide by clarifying the manifest.json structure and addressing confusion about which chunk types can have specific fields.


Key Improvements

  • Clarified chunk type distinctions:
    Added explicit documentation explaining that only JS chunks can have imports, dynamicImports, css, and assets fields, while CSS files and asset chunks only have file, src, and optionally isEntry / name fields.

  • Enhanced processing instructions:
    Updated step-by-step instructions to emphasize that CSS files and assets in the manifest do not have imports, preventing incorrect recursive processing.

  • Improved pseudo-implementation documentation:
    Added notes to the importedChunks function example clarifying that it only processes JS chunks and that CSS dependencies are accessed via the css field.

  • Added “Common Questions” section:
    New FAQ section addresses:

    • Whether CSS files can have imports in the manifest (they cannot)
    • How CSS dependencies are correctly represented (in JS chunk’s css array)
    • Guidelines for implementing manifest parsers

Additional Context

The documentation now makes it clear that the hypothetical scenario in #20858 (CSS chunks with imports and nested css fields) is invalid because CSS files are OutputAsset types that don’t support these fields.
This should prevent confusion for developers implementing custom backend integrations.

The changes are documentation-only with no code modifications.
The manifest generation code in manifest.ts already correctly enforces these constraints; the documentation simply lacked explicit clarification about these edge cases.

Expanded documentation to specify the differences between JS chunks, CSS files, and asset chunks in the manifest. Added details about which fields are present for each chunk type and clarified how CSS imports are represented.
Added a note explaining that only JS chunks have an 'imports' field in the manifest, and clarified recursive import handling in code comments for better developer understanding.
Added notes explaining that the function only processes JS chunks due to the presence of the `imports` field, and clarified how CSS dependencies are accessed via the `css` field of JS chunks.
Added a 'Common Questions' section to clarify that CSS files in the manifest cannot have 'imports' or nested CSS fields, with an example of an invalid manifest entry.
Added a section explaining how CSS dependencies are represented in the manifest. CSS file paths are listed in the chunk's `css` array, not in the `imports` array, with example JSON provided for clarity.
Provides detailed instructions for manifest parsers on how to process the `imports` and `css` fields, and clarifies the structure of CSS and asset entries. This helps developers correctly interpret manifest files during backend integration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backend Integration Guide Seems To be Missing Some Scenarios

1 participant