core
core copied to clipboard
Determine Sitelet value to run at compile-time
As described at https://github.com/intellifactory/websharper/issues/861#issuecomment-349645264, currently Sitelet runtime is relying on reflection at runtime startup to find the Sitelet definition(s) to run. This is wasted time that could be determined by storing it in WebSharper metadata quicker, and also can lead to unexpected behavior, because only first static method with a Website attribute is used from each assembly then search stops.
Alternatives:
- Only always run a single Sitelet definition, do not
Sumimplicitly. Checks during compile-time to catch all violations of this: MultipleWebsitedefinitions in a single project should give an error. A project defining one hides all definitions from its referenced libraries. A project not defining a Website, but having multiple references (not depending on each other) that do, then report it as an error. - Continue to
Sumall available Website definitions (needs fix for #861), now determined from merged metadata. The user is trusted to disambiguate paths handled, but to make some deterministic shadowing possible, the order ofSumis always so that referenced assemblies come after those that are referencing them.