Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: islands css not showing up (#3965)

Myles Scolnickf1922057e08f
diff --git a/frontend/islands/vite.config.mts b/frontend/islands/vite.config.mts
index b63257b23a..96461d9252 100644
--- a/frontend/islands/vite.config.mts
+++ b/frontend/islands/vite.config.mts
@@ -29,11 +29,6 @@ const ReactCompilerConfig = {
export default defineConfig({
resolve: {
dedupe: ["react", "react-dom", "@emotion/react", "@emotion/cache"],
- conditions: [
- "module",
- "browser",
- process.env.NODE_ENV === "production" ? "production" : "development",
- ],
},
worker: {
format: "es",
@@ -73,13 +68,21 @@ export default defineConfig({
],
build: {
emptyOutDir: true,
- outDir: "dist",
- assetsDir: ".",
+ lib: {
+ entry: path.resolve(__dirname, "../src/core/islands/main.ts"),
+ formats: ["es"],
+ },
rollupOptions: {
- input: path.resolve(__dirname, "../src/core/islands/main.ts"),
output: {
- entryFileNames: "main.js",
- assetFileNames: "style.css",
+ // Remove hash from entry file name, so it's easier to import
+ entryFileNames: "[name].js",
+ // Ensure CSS is output as style.css instead of frontend.css
+ assetFileNames: (assetInfo) => {
+ if (assetInfo.names.includes("frontend.css")) {
+ return "style.css";
+ }
+ return assetInfo.names[0];
+ },
},
},
},
diff --git a/frontend/src/plugins/impl/multiselectFilterFn.tsx b/frontend/src/plugins/impl/multiselectFilterFn.tsx
index 32868558f7..c5c493e59a 100644
--- a/frontend/src/plugins/impl/multiselectFilterFn.tsx
+++ b/frontend/src/plugins/impl/multiselectFilterFn.tsx
@@ -1,4 +1,18 @@
/* Copyright 2024 Marimo. All rights reserved. */
+
+/**
+ * We override the default filter function which focuses on sorting by relevance with a fuzzy-match,
+ * instead of filtering out.
+ * The default filter function is `command-score`.
+ *
+ * Our filter function only matches if all words in the value are present in the option.
+ * This is more strict than the default, but more lenient than an exact match.
+ *
+ * Examples:
+ * - "foo bar" matches "foo bar"
+ * - "bar foo" matches "foo bar"
+ * - "foob" does not matches "foo bar"
+ */
export function multiselectFilterFn(option: string, value: string): number {
const words = value.split(/\s+/);
const match = words.every((word) =>
diff --git a/frontend/vite.config.mts b/frontend/vite.config.mts
index 66acae5498..a885616d9f 100644
--- a/frontend/vite.config.mts
+++ b/frontend/vite.config.mts
@@ -247,11 +247,6 @@ export default defineConfig({
},
resolve: {
dedupe: ["react", "react-dom", "@emotion/react", "@emotion/cache"],
- conditions: [
- "module",
- "browser",
- process.env.NODE_ENV === "production" ? "production" : "development",
- ],
},
worker: {
format: "es",