Skip to content

Backend integration guide: preloading dynamic entry points? #16598

@mindplay-dk

Description

@mindplay-dk

Documentation is

  • Missing
  • Outdated
  • Confusing
  • Not sure?

Explain in Detail

Following the backend integration guide, I've written a Composer package for vanilla PHP integration, and I hope you can clarify something from the example in the documentation here.

My question is regarding the example near the end of the page:

While the following should be included for the entry point `views/foo.js`:
```html
<link rel="stylesheet" href="assets/shared.a834bfc3.css" />
<script type="module" src="assets/foo.869aea0d.js"></script>
<!-- optional -->
<link rel="modulepreload" href="assets/shared.83069a53.js" />
```

The example manifest.json on this page shows views/foo.js being a dynamic entry:

"views/foo.js": {
"file": "assets/foo.869aea0d.js",
"src": "views/foo.js",
"isDynamicEntry": true,
"imports": ["_shared.83069a53.js"]
},

My question is, when or why would you be preloading a dynamic entry?

To the best of my understanding, a dynamic is loaded dynamically - which, as I understand it, would mean you're not emitting tags on a page, but rather loading the script with an await import statement somewhere in the main script?

Is there any real world use case for an entry with isDynamicEntry to be (pre) loaded on a page?

If this is an error, I might prefer for my package to throw an exception for this case.

Your Suggestion for Changes

The page may need some clarification per my question above. Not sure. 🙂

Reproduction

No response

Steps to reproduce

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions