Skip to content

Commit ccac986

Browse files
committed
Revert back to Gemini 2.0 Flash
1 parent bdf8c0e commit ccac986

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/widget-playground/page-client.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ async function compileWidgetSource(source: string): Promise<Result<string, strin
4444
__STACK_WIDGET_RESOLVE(widget);
4545
`,
4646
}, {
47+
format: 'iife',
4748
externalPackages: {
4849
'react': 'module.exports = React;',
4950
'react/jsx-runtime': 'module.exports = jsxRuntime;',
@@ -803,7 +804,7 @@ const widgets: Widget<any, any>[] = [
803804
isSingleColumnMode={isSingleColumnMode ? "auto" : false}
804805
gridRef={widgetGridRef}
805806
allowVariableHeight={false}
806-
isStatic={true}
807+
isStatic={false}
807808
/>
808809
</div>
809810
);
@@ -994,15 +995,15 @@ function SingleWidget(props: {
994995
(widgetInstance) => {
995996
return WidgetInstanceGrid.fromSingleWidgetInstance(widgetInstance);
996997
},
997-
(widgetInstance, grid) => grid.getInstanceById(widgetInstance.id) ?? throwErr(`Widget instance ${widgetInstance.id} not found in grid`, { widgetInstance }),
998+
(widgetInstance, grid) => grid.getInstanceById(widgetInstance.id) ?? /* widget deleted, let's reset to last known state */ widgetInstance,
998999
);
9991000

10001001
return (
10011002
<SwappableWidgetInstanceGrid
10021003
gridRef={widgetGridRef}
10031004
isSingleColumnMode={true}
10041005
allowVariableHeight={true}
1005-
isStatic={false}
1006+
isStatic={true}
10061007
/>
10071008
);
10081009
}
@@ -1219,6 +1220,14 @@ function SwappableWidgetInstanceGrid(props: { gridRef: RefState<WidgetInstanceGr
12191220
event.over.rect.width,
12201221
event.over.rect.height,
12211222
]]);
1223+
console.log("newHoverElementSwap", [
1224+
event.over.rect.left - event.active.rect.current.initial.left,
1225+
event.over.rect.top - event.active.rect.current.initial.top,
1226+
event.active.rect.current.initial.width,
1227+
event.active.rect.current.initial.height,
1228+
event.over.rect.width,
1229+
event.over.rect.height,
1230+
]);
12221231
} else {
12231232
setHoverElementSwap(null);
12241233
}
@@ -1233,6 +1242,7 @@ function SwappableWidgetInstanceGrid(props: { gridRef: RefState<WidgetInstanceGr
12331242
{props.gridRef.current.elements().map(({ instance, x, y, width, height }) => {
12341243
const isHoverSwap = !!hoverElementSwap && !!instance && (hoverElementSwap[0] === instance.id);
12351244

1245+
12361246
if (isSingleColumnMode && !instance) {
12371247
if (hasAlreadyRenderedEmpty) return null;
12381248
hasAlreadyRenderedEmpty = true;

docs/src/app/api/chat/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export async function POST(request: Request) {
8888

8989
try {
9090
const result = streamText({
91-
model: google('gemini-2.5-pro'),
91+
model: google('gemini-2.0-flash'),
9292
system: systemPrompt,
9393
messages,
9494
maxTokens: 1500,

docs/src/components/chat/ai-chat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export function AIChatDrawer() {
211211
response: response,
212212
metadata: {
213213
sessionId: sessionId,
214-
model: 'gemini-2.5-pro',
214+
model: 'gemini-2.0-flash',
215215
}
216216
};
217217

packages/stack-shared/src/utils/esbuild.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export async function initializeEsbuild() {
1414
}
1515

1616
export async function bundleJavaScript(sourceFiles: Record<string, string> & { '/entry.js': string }, options: {
17+
format?: 'iife' | 'esm' | 'cjs',
1718
externalPackages?: Record<string, string>,
1819
} = {}): Promise<Result<string, string>> {
1920
await initializeEsbuild();
@@ -35,7 +36,7 @@ export async function bundleJavaScript(sourceFiles: Record<string, string> & { '
3536
entryPoints: ['/entry.js'],
3637
bundle: true,
3738
write: false,
38-
format: 'iife',
39+
format: options.format ?? 'iife',
3940
platform: 'browser',
4041
target: 'es2015',
4142
jsx: 'automatic',

0 commit comments

Comments
 (0)