Skip to main content

is_entry_point

Function is_entry_point 

Source
pub fn is_entry_point(path: impl AsRef<Path>) -> Option<bool>
Expand description

Whether this file is a document in its own right, rather than a component meant to be used by one. None means the question could not be answered, because the file would not read or parse.

The test is the one the spec already sets: “the application entry point is a component whose root is <screen>”. Anything else is a fragment expecting a parent.

A checker needs the distinction. A component’s {{ prop }} bindings are supplied by whoever uses it, so loading one on its own reports every prop as an undefined variable: failures that say nothing about whether the file is correct. Going by the root rather than by who imports what also catches a component that nothing currently uses.