Deduplicate component resolution probes
This commit is contained in:
@@ -522,8 +522,10 @@ header free-functions are `inline`. The wasm backend exposes only declarations
|
|||||||
the caller after a repeated parent invocation. Resolved component paths are
|
the caller after a repeated parent invocation. Resolved component paths are
|
||||||
canonical absolute paths: equivalent spellings containing `.` or `..` must
|
canonical absolute paths: equivalent spellings containing `.` or `..` must
|
||||||
share one source, compile, artifact, and module-cache identity. The compiler
|
share one source, compile, artifact, and module-cache identity. The compiler
|
||||||
independently enforces the same canonical identity, and persisted failures
|
independently enforces the same canonical identity. Within one resolution,
|
||||||
are reused only when their recorded source path matches the current request.
|
identical entry/site bases and identical raw/`.uce` candidate spellings are
|
||||||
|
probed only once while first-match order is preserved. Persisted failures are
|
||||||
|
reused only when their recorded source path matches the current request.
|
||||||
`scripts/test_nested_component_props.sh` passes a large prop tree through an
|
`scripts/test_nested_component_props.sh` passes a large prop tree through an
|
||||||
outer component, invokes 300 nested components, and verifies both inner and
|
outer component, invokes 300 nested components, and verifies both inner and
|
||||||
caller props are restored. Its warm-request ceiling guards the request-scope
|
caller props are restored. Its warm-request ceiling guards the request-scope
|
||||||
|
|||||||
+8
-3
@@ -2244,17 +2244,22 @@ private:
|
|||||||
if(current_dir != "" && current_dir != entry_dir)
|
if(current_dir != "" && current_dir != entry_dir)
|
||||||
bases.push_back(current_dir + "/");
|
bases.push_back(current_dir + "/");
|
||||||
}
|
}
|
||||||
bases.push_back(worker.cfg.site_root + "/");
|
String site_base = worker.cfg.site_root + "/";
|
||||||
|
if(std::find(bases.begin(), bases.end(), site_base) == bases.end())
|
||||||
|
bases.push_back(site_base);
|
||||||
|
String normalized_file_name = normalize_component_path(file_name);
|
||||||
|
|
||||||
for(auto& base : bases)
|
for(auto& base : bases)
|
||||||
{
|
{
|
||||||
std::vector<String> candidates;
|
std::vector<String> candidates;
|
||||||
candidates.push_back(base + file_name);
|
candidates.push_back(base + file_name);
|
||||||
candidates.push_back(base + normalize_component_path(file_name));
|
if(normalized_file_name != file_name)
|
||||||
|
candidates.push_back(base + normalized_file_name);
|
||||||
if(file_name.rfind("components/", 0) != 0 && base != "")
|
if(file_name.rfind("components/", 0) != 0 && base != "")
|
||||||
{
|
{
|
||||||
candidates.push_back(base + "components/" + file_name);
|
candidates.push_back(base + "components/" + file_name);
|
||||||
candidates.push_back(base + "components/" + normalize_component_path(file_name));
|
if(normalized_file_name != file_name)
|
||||||
|
candidates.push_back(base + "components/" + normalized_file_name);
|
||||||
}
|
}
|
||||||
for(auto& candidate : candidates)
|
for(auto& candidate : candidates)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user