Пример #1
0
        public JsValue ExportDefault(BaristaContext context, BaristaModuleRecord referencingModule)
        {
            var buffer   = SerializedScriptService.GetSerializedScript(ResourceName, context, mapWindowToGlobal: true);
            var fnScript = context.ParseSerializedScript(buffer, () => EmbeddedResourceHelper.LoadResource(ResourceName), "[uuid]");

            return(fnScript.Call <JsObject>());
        }
Пример #2
0
        public JsValue ExportDefault(BaristaContext context, BaristaModuleRecord referencingModule)
        {
            var buffer   = SerializedScriptService.GetSerializedScript(ResourceName, context);
            var fnScript = context.ParseSerializedScript(buffer, () => EmbeddedResourceHelper.LoadResource(ResourceName), "[react-dom-server]");
            var jsReact  = fnScript.Call <JsObject>();

            return(jsReact);
        }
Пример #3
0
        /// <summary>
        /// returns a byte array consisting of a runtime-independent typescript compiler.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public static byte[] GetSerializedTypeScriptCompiler(BaristaContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            return(SerializedScriptService.GetSerializedScript(ResourceName, context));
        }