Open yimingjfe opened 20 hours ago
The compilation.entries.entries is exists. You can use it directly.
Then webpack.util.runtime.getEntryRuntime
is not exported in webpack also, maybe you need implement by yourself.
And other api or attributes will be implemented in the future.
I am supporting module graph api here: https://github.com/web-infra-dev/rspack/pull/8470
The compilation.entries.entries is exists. You can use it directly. Then
webpack.util.runtime.getEntryRuntime
is not exported in webpack also, maybe you need implement by youself. And other api or attributes we will add in the future.
Yeah, you are right, compilation.entries.entries
already exists, I'll update the description.
For getEntryRuntime
, in webpack, it is possible to get it by compiler.webpack.util.runtime.getEntryRuntime
.
I would like to know where the hooks listed above are used in the RSC build. Do we have corresponding links to check?
What problem does this feature solve?
In Modern.js, we want to support RSC building base on Rspack. When using webpack, the solution can work normally, but with Rspack, there are some APIs that are not exported now, so it's difficult to support RSC in the Modern.js repository.
The following APIs are currently used for support RSC, but are not seen exported in Rspack:
Server-side building:
Add modules to the compilation
compilation.addInclude
webpack.util.runtime.getEntryRuntime
compilation.moduleGraph.getExportsInfo
exportsInfo.setUsedInUnknownWay
compilation.hooks.needAdditionalPass
Add custom dependencies
compilation.dependencyFactories
compilation.dependencyTemplates
module.addDependency
NullDependency
Get ModuleId
compilation.hooks.afterOptimizeModuleIds
chunkGraph.getModuleId
Client-side building:
Add client reference chunks
AsyncDependenciesBlock
block.addDependency
Module
module.blocks
module.addBlock
Get moduleInfo
module.nameForCondition
chunkGraph.getModuleId
chunkGraph.getModuleChunksIterable
moduleGraph.getOutgoingConnections
Here there are some APIs that may have alternatives , and some are difficult to have real alternatives.
I want to discuss what the recommended solution is from the perspective of Rspack, such as the
addDependency
API, in the webpack ecosystem, there are many webpack plugins that depend on it.What does the proposed API of configuration look like?
It is best to be consistent with webpack.