Skip to content

Comments

feat: try to implement PluginContext.load#2690

Closed
underfin wants to merge 1 commit intomainfrom
load-move-typing
Closed

feat: try to implement PluginContext.load#2690
underfin wants to merge 1 commit intomainfrom
load-move-typing

Conversation

@underfin
Copy link
Contributor

Description

@netlify
Copy link

netlify bot commented Nov 11, 2024

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 9fc7c57
🔍 Latest deploy log https://app.netlify.com/sites/rolldown-rs/deploys/6731c9ab4318b90008c0e984

github-merge-queue bot pushed a commit that referenced this pull request Nov 12, 2024
<!-- Thank you for contributing! -->

### Description

Support `PluginContext.load`, ref
https://rollupjs.org/plugin-development/#this-load. close
#2355.

The pr using msg channel to hand extra modules need to load. Here need
to use one channel to avoid
#2687 (comment).

> Here has a another way to do it. Using `load_via_plugins`, like
`resolve_id_via_plugins`, but it need to a lot of change the relation
crate dependencies and meet a cycle dependencies problem at moving
`create_ecma_view`, it is difficult to resolve. try here at
#2690.

The pr implements it as much as possible, but it also has a problem,
consider some cases at here.
- `ModuleTables` has not the module `A`, here only fetch it.
- `ModuleTables` has module `A` and already fetched, here return already
fetched result, using `PluginContext#modules`.
- `ModuleTables` has module `A` but it is not fetched finished, here may
lost result because here can't ensure the fetch time before the module
task is finished. The case maybe happend because it is run at parallel.
We could re-fetch it at the case, but it call the module-related hook
again, It could be put as low priority to resolve.

<!-- Please insert your description here and provide especially info
about the "what" this PR is solving -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant