-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bundles studio-ui to reduce multiple round trips made by the browser to the vite dev server. The browser still makes network requests for things like localData and component files. One way to reduce perceived lag here is server side rendering studio. Another is the loading indicator we have planned. DOMContentLoaded is now 412ms instead of 5.09s. There should be a bigger improvement in CBD due to network requests taking longer there compared to local. 5.0MB transferred instead of 14.6MB (could be smaller probably but still yay!) Removes ts-morph/typescript dependencies from TypeGuards and by extension the ui bundle (they are big packages). Updates lodash imports to use smaller scoped imports. Adds vite plugins for bundle size, css in js, dts files, and svg imports. J=SLAP-2921 TEST=manual I can start up studio and see less requests in the network tab old network tab https://github.com/yext/studio/assets/23005393/022d6199-5fa6-47db-b84b-5e543c729ae3 new network tab ![image](https://github.com/yext/studio/assets/23005393/45c9d4d1-b25c-4d16-bb0a-fdbe5ca01d3c)
- Loading branch information
Showing
22 changed files
with
1,388 additions
and
774 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
stats.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = [ | ||
{ | ||
path: "lib/src/index.js", | ||
limit: "700 kB", | ||
gzip: false, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/studio-ui/src/components/FieldPicker/FieldDropdown.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { default as App } from "./App"; | ||
export { default as hotReloadStore } from "./store/hotReloadStore"; | ||
export { StudioHMRUpdateID } from "@yext/studio-plugin"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// vite.config.js | ||
import { resolve } from "path"; | ||
import { defineConfig, PluginOption } from "vite"; | ||
import svgr from "vite-plugin-svgr"; | ||
import { visualizer } from "rollup-plugin-visualizer"; | ||
import dts from "vite-plugin-dts"; | ||
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js"; | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
svgr(), | ||
dts(), | ||
cssInjectedByJsPlugin(), | ||
visualizer() as PluginOption, | ||
], | ||
build: { | ||
outDir: "lib", | ||
sourcemap: true, | ||
lib: { | ||
entry: resolve(__dirname, "src/index.ts"), | ||
formats: ["es"], | ||
fileName: "src/index", | ||
}, | ||
rollupOptions: { | ||
external: [ | ||
"virtual_yext-studio-git-data", | ||
"virtual_yext-studio", | ||
"@pathToUserProjectRoot/tailwind.config", | ||
"react", | ||
"react-dom", | ||
"react/jsx-runtime", | ||
], | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters