add module prefix to generated state names

Merged
BE
2y ago
+479-413

This PR prefixes all state names with their python module to prevent naming conflicts. Defining the same State class name multiple times in different modules is now possible. Consider this example:

myapp/pages/index.py

class State(rx.State):
  pass

myapp/pages/about.py

class State(rx.State):
  pass

Adjusted all tests except the actual State.get_name and State.get_full_name tests to use dynamic state names. This allows us to implement minified state names later.

Added get_state_name and get_full_state_name helpers to AppHarness for easy testing with parametrized app_names.

Validate state cls module names in init_subclass hook. They should not contain ___ (3x) as it's used as state name module separator.