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

feat: rsc plugin #5824

Draft
wants to merge 53 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
73f315d
feat: client entry plugin
JiangWeixian Feb 26, 2024
23ce18c
feat: set directives in build_info
JiangWeixian Mar 1, 2024
5fd1e5a
feat: client ref manifest plugin
JiangWeixian Mar 6, 2024
a4272b0
fix: support css
JiangWeixian Mar 12, 2024
e924cbe
chore: re impl based on 0.5.7
JiangWeixian Mar 20, 2024
6b720c6
perf: skip imported entry visited
JiangWeixian Mar 21, 2024
610387e
perf: uniq client imports from main entry
JiangWeixian Mar 21, 2024
dd403b9
chore: revert template code
JiangWeixian Mar 21, 2024
d520483
ref: re impl in 0.5.9
JiangWeixian Mar 30, 2024
14ccb6b
fix: keep imports in order
JiangWeixian Apr 10, 2024
3cc57c4
fix: client directives
JiangWeixian Apr 10, 2024
27b9a5f
chore: re impl in 0.6.2
JiangWeixian Apr 18, 2024
485526a
chore: output ref manifest to server dir
JiangWeixian Apr 18, 2024
d3dbd85
feat: ssr module mapping
JiangWeixian Apr 20, 2024
6cc3c70
feat: routes
JiangWeixian Apr 22, 2024
a8690c2
fix: generate client boundary ref only
JiangWeixian Apr 23, 2024
14c7d65
fix: remove debug code
JiangWeixian Apr 25, 2024
7993f74
fix: shared data muteable
JiangWeixian May 9, 2024
7759e3a
chore: rebase 0.7.0
JiangWeixian Jun 3, 2024
9eb9e83
fix: lint
JiangWeixian Jun 3, 2024
ba4b499
ref: remove server ref plugin
JiangWeixian May 16, 2024
630c7e9
feat: rsc proxy loader
JiangWeixian May 17, 2024
4595c69
feat: rsc client entry loader
JiangWeixian May 17, 2024
5f06e86
feat: rsc proxy and manifest plugin
JiangWeixian May 22, 2024
c500ce2
chore: resolve entry options
JiangWeixian Jun 4, 2024
537fd2a
fix: hmr
JiangWeixian Jun 5, 2024
b28d520
chore: rename module_proxy
JiangWeixian Jun 5, 2024
87ae02d
feat: rsc flag
JiangWeixian Jun 5, 2024
5ab0cf7
docs: add ref
JiangWeixian Jun 5, 2024
58e22a7
chore: use visitor from rsc plugin
JiangWeixian Jun 5, 2024
f5442b6
fix: css parse error recovery
JiangWeixian Jun 6, 2024
2445b87
chore: rm debug code
JiangWeixian Jun 12, 2024
a31cff3
fix: css id with query
JiangWeixian Jun 13, 2024
b809782
ref: use add_include
JiangWeixian Jun 20, 2024
66d65f9
feat: use server (#1)
JiangWeixian Jun 24, 2024
d0b63e3
chore: rebase
JiangWeixian Jun 30, 2024
6c27f11
fix: compat with css.type undefined
JiangWeixian Jul 1, 2024
a9cf9c3
chore: docs code
JiangWeixian Jul 2, 2024
5ce4638
fix: hmr happy
JiangWeixian Jul 2, 2024
3b7d215
chore: check hash prevent file change
JiangWeixian Jul 11, 2024
1d19852
fix: indentify visited module by entry
JiangWeixian Jul 12, 2024
8da35c7
chore: use or_insert_with
JiangWeixian Jul 15, 2024
f759ddd
perf: use rwlock and check asset version
JiangWeixian Jul 24, 2024
2ce322b
perf: use asset version
JiangWeixian Jul 24, 2024
9bfd6ba
chore: remove debug code
JiangWeixian Jul 25, 2024
179ab30
chore: rebase 1.0.0-beta-4
JiangWeixian Aug 12, 2024
1d22571
chore: rebase at 0814
JiangWeixian Aug 14, 2024
976a682
fix: name for condition
JiangWeixian Aug 14, 2024
94ed332
chore: use make
JiangWeixian Aug 15, 2024
025a42e
fix: resourcequery
JiangWeixian Sep 11, 2024
0250c76
chore: rebase 1.0.3
JiangWeixian Sep 12, 2024
019ae7b
fix: compat with mf
JiangWeixian Sep 24, 2024
f602093
chore: rebase 1.1.x
JiangWeixian Jan 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: use or_insert_with
  • Loading branch information
JiangWeixian committed Jan 7, 2025
commit 8da35c7a18a8c44ef1615e838e479403e3845e4f
Original file line number Diff line number Diff line change
@@ -118,10 +118,9 @@ impl RSCClientReferenceManifest {
shared_ssr_module_mapping: &HashMap<String, HashMap<String, ServerRef>>,
ssr_module_mapping: &mut HashMap<String, HashMap<String, ServerRef>>,
) {
if ssr_module_mapping.get(module_id).is_none() {
ssr_module_mapping.insert(module_id.to_string(), HashMap::default());
}
let module_mapping = ssr_module_mapping.get_mut(module_id).unwrap();
let module_mapping = ssr_module_mapping
.entry(module_id.into())
.or_insert_with(HashMap::default);
let shared_module_mapping = shared_ssr_module_mapping.get(ssr_module_id);
match shared_module_mapping {
Some(smm) => {
28 changes: 11 additions & 17 deletions crates/rspack_plugin_rsc/src/utils/sever_reference.rs
Original file line number Diff line number Diff line change
@@ -25,23 +25,17 @@ impl RSCServerReferenceManifest {
chunks: &Vec<&String>,
ssr_module_mapping: &mut HashMap<String, HashMap<String, ServerRef>>,
) {
if ssr_module_mapping.get(id).is_none() {
ssr_module_mapping.insert(id.to_string(), HashMap::default());
}
let module_mapping = ssr_module_mapping.get_mut(id);
match module_mapping {
Some(mm) => {
mm.insert(
name.to_string(),
ServerRef {
id: id.to_string(),
name: name.to_string(),
chunks: chunks.iter().map(|&chunk| chunk.to_string()).collect(),
},
);
}
None => (),
}
let module_mapping = ssr_module_mapping
.entry(id.into())
.or_insert_with(HashMap::default);
module_mapping.insert(
name.into(),
ServerRef {
id: id.to_string(),
name: name.to_string(),
chunks: chunks.iter().map(|&chunk| chunk.to_string()).collect(),
},
);
}
fn add_server_import_ref(
&self,