core icon indicating copy to clipboard operation
core copied to clipboard

Determine Sitelet value to run at compile-time

Open Jand42 opened this issue 7 years ago • 0 comments

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:

  1. Only always run a single Sitelet definition, do not Sum implicitly. Checks during compile-time to catch all violations of this: Multiple Website definitions 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.
  2. Continue to Sum all 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 of Sum is always so that referenced assemblies come after those that are referencing them.

Jand42 avatar Dec 06 '17 14:12 Jand42