Skip to content

Commit

Permalink
mod: remove unused code (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
hetao92 authored Sep 12, 2023
1 parent b7d9b10 commit 43bf28b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions app/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ declare module '*.gif';
declare module '*.bmp';
declare module '*.tiff';
declare module '*.less';

interface Window {
gConfig: {
maxBytes: number
databaseName: string;
};
__ngqlRunner__: any;
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<script>var global = typeof global !== 'undefined' ? global : window;</script>
<script>
<% if (initProps.NODE_ENV === 'development') { %>
window.gConfig = { maxBytes: <%= JSON.stringify(initProps.maxBytes) %>, databaseName: "NebulaGraph" }
window.gConfig = { databaseName: "NebulaGraph" }
<% } else { %>
window.gConfig = { maxBytes: {{.maxBytes}}, databaseName: "NebulaGraph" }
window.gConfig = { databaseName: "NebulaGraph" }
<% } %>
</script>
<style>
Expand Down
3 changes: 1 addition & 2 deletions server/api/studio/pkg/middleware/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func AssetsMiddlewareWithCtx(svcCtx *svc.ServiceContext, embedAssets fs.FS) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if filepath.Ext(r.URL.Path) == "" {
tpl, err := template.ParseFS(embedAssets, "assets/index.html")
_, err := template.ParseFS(embedAssets, "assets/index.html")
withErrorMessage := utils.ErrMsgWithLogger(r.Context())
if err != nil {
svcCtx.ResponseHandler.Handle(w, r, nil, withErrorMessage(ecode.ErrInternalServer, err))
Expand All @@ -24,7 +24,6 @@ func AssetsMiddlewareWithCtx(svcCtx *svc.ServiceContext, embedAssets fs.FS) http

w.Header().Set("Content-Type", "text/html")
w.WriteHeader(http.StatusOK)
tpl.Execute(w, map[string]any{"maxBytes": svcCtx.Config.MaxBytes})
return
}

Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default defineConfig({
plugins: [
react(),
// topLevelAwait(),
htmlPlugin({ maxBytes: appConfig.MaxBytes }),
htmlPlugin(),
// legacy({
// targets: ['chrome >= 87', 'safari >= 14', 'firefox >= 78'],
// polyfills: ['es.promise.finally', 'es/map', 'es/set', 'es/array'],
Expand Down

0 comments on commit 43bf28b

Please sign in to comment.