55from optional_django .serializers import JSONEncoder
66from optional_django .safestring import mark_safe
77from optional_django import six
8- from service_host . service import Service
9- from service_host .exceptions import ServiceError
8+ from js_host . function import Function
9+ from js_host .exceptions import JSFunctionError
1010from .exceptions import ComponentSourceFileNotFound , ComponentWasNotBundled
1111from .conf import settings
1212from .bundle import bundle_component
1313from .templates import MOUNT_JS
1414from .exceptions import ReactRenderingError
1515
16- service = Service (settings .SERVICE_NAME )
16+ function = Function (settings .FUNCTION_NAME )
1717
1818
1919class RenderedComponent (object ):
@@ -118,16 +118,14 @@ def render_component(
118118 serialized_props = None
119119
120120 try :
121- res = service .call (
121+ markup = function .call (
122122 path = path_to_source ,
123123 serializedProps = serialized_props ,
124124 toStaticMarkup = to_static_markup
125125 )
126- except ServiceError as e :
126+ except JSFunctionError as e :
127127 raise six .reraise (ReactRenderingError , ReactRenderingError (* e .args ), sys .exc_info ()[2 ])
128128
129- markup = res .text
130-
131129 return RenderedComponent (
132130 markup , path_to_source , props , serialized_props , watch_source , bundled_component , to_static_markup
133131 )
0 commit comments