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

<script type=hoistmap> #54

Open
DrSensor opened this issue Jan 17, 2023 · 1 comment
Open

<script type=hoistmap> #54

DrSensor opened this issue Jan 17, 2023 · 1 comment
Labels
optimization Because speed, memory consumption, and bundle size are important priority: high Although it's not part of the milestone, it's urgent and must be resolved

Comments

@DrSensor
Copy link
Owner

DrSensor commented Jan 17, 2023

Name is inspired from rollup hoistTransitiveImports + importmap

The purpose is to avoid waterfall when linked modules are not bundled. As a result that unbundled module still contain import statement which cause binding to be delayed, waiting for all network request from import statement to finish.

There's 2 way to register hoistmap:

  1. Inline (preferred)
  2. Remotely via src="" attribute

hoistmap format always be in json and must be inside <render-scope>

{
  "worker:imports": [],
  "shared:worker:imports": [],
  "imports": [
    "./a.js",
    ["./b.json", { "type": "json" }],
    ["./c.js", { "worker": true }],
    ["./d.js", { "worker": "shared" }]
  ],
  "fetchs": []
}

Most of the time hoistmap are not needed when the service provider support Smart Early Hints

@DrSensor DrSensor added optimization Because speed, memory consumption, and bundle size are important priority: high Although it's not part of the milestone, it's urgent and must be resolved labels Jan 17, 2023
@DrSensor
Copy link
Owner Author

food for though: instead of hoistmap, for internal module, cache and use data+object url

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization Because speed, memory consumption, and bundle size are important priority: high Although it's not part of the milestone, it's urgent and must be resolved
Projects
None yet
Development

No branches or pull requests

1 participant