Fix bokeh slider by adding in side effects to package json
diff --git a/e2e/specs/st_bokeh_chart.spec.js b/e2e/specs/st_bokeh_chart.spec.js
deleted file mode 100644
index 915fc411e91e..000000000000
--- a/e2e/specs/st_bokeh_chart.spec.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-describe("st.bokeh_chart", () => {
-  before(() => {
-    cy.loadApp("http://localhost:3000/");
-  });
-
-  beforeEach(() => {
-    return cy.get(".stBokehChart").should("have.length", 3);
-  });
-
-  it("shows left and right graph", () => {
-    cy.getIndexed(".stBokehChart", 1).find("canvas");
-    cy.getIndexed(".stBokehChart", 2).find("canvas");
-  });
-});
diff --git a/e2e_flaky/specs/st_bokeh_chart.spec.ts b/e2e_flaky/specs/st_bokeh_chart.spec.ts
deleted file mode 100644
index aca5c77e5c0c..000000000000
--- a/e2e_flaky/specs/st_bokeh_chart.spec.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/// <reference types="cypress" />
-
-describe("st.bokeh_chart", () => {
-  before(() => {
-    cy.loadApp("http://localhost:3000/");
-  });
-
-  it("displays a bokeh chart", () => {
-    cy.get(".element-container .stBokehChart").should(
-      "have.css",
-      "height",
-      "600px"
-    );
-  });
-});
diff --git a/e2e/scripts/st_bokeh_chart.py b/e2e_playwright/st_bokeh_chart.py
similarity index 52%
rename from e2e/scripts/st_bokeh_chart.py
rename to e2e_playwright/st_bokeh_chart.py
index 68b491c808fb..6fbbc77efec7 100644
--- a/e2e/scripts/st_bokeh_chart.py
+++ b/e2e_playwright/st_bokeh_chart.py
@@ -12,6 +12,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import numpy as np
+from bokeh.layouts import column, row
+from bokeh.models import ColumnDataSource, CustomJS, Slider
 from bokeh.plotting import figure
 
 import streamlit as st
@@ -38,3 +41,38 @@
 
 with col2:
     st.bokeh_chart(right_chart, use_container_width=True)
+
+x = np.linspace(0, 10, 500)
+y = np.sin(x)
+
+source = ColumnDataSource(data=dict(x=x, y=y))
+
+plot = figure(y_range=(-10, 10), width=400, height=400)
+
+plot.line("x", "y", source=source, line_width=3, line_alpha=0.6)
+
+amp = Slider(start=0.1, end=10, value=1, step=0.1, title="Amplitude")
+freq = Slider(start=0.1, end=10, value=1, step=0.1, title="Frequency")
+phase = Slider(start=-6.4, end=6.4, value=0, step=0.1, title="Phase")
+offset = Slider(start=-9, end=9, value=0, step=0.1, title="Offset")
+
+callback = CustomJS(
+    args=dict(source=source, amp=amp, freq=freq, phase=phase, offset=offset),
+    code="""
+    const A = amp.value
+    const k = freq.value
+    const phi = phase.value
+    const B = offset.value
+
+    const x = source.data.x
+    const y = Array.from(x, (x) => B + A*Math.sin(k*x+phi))
+    source.data = { x, y }
+""",
+)
+
+amp.js_on_change("value", callback)
+freq.js_on_change("value", callback)
+phase.js_on_change("value", callback)
+offset.js_on_change("value", callback)
+
+st.bokeh_chart(row(plot, column(amp, freq, phase, offset)))
diff --git a/e2e_playwright/st_bokeh_chart_test.py b/e2e_playwright/st_bokeh_chart_test.py
new file mode 100644
index 000000000000..4a329f8a6e85
--- /dev/null
+++ b/e2e_playwright/st_bokeh_chart_test.py
@@ -0,0 +1,28 @@
+# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from playwright.sync_api import Page, expect
+
+
+def test_bokeh_chart(themed_app: Page):
+    """Test that st.bokeh_chart renders correctly."""
+    bokeh_chart_elements = themed_app.locator("[data-testid=stBokehChart]")
+    expect(bokeh_chart_elements).to_have_count(4)
+
+    expect(bokeh_chart_elements.nth(0).locator("canvas").nth(0)).to_be_visible()
+    expect(bokeh_chart_elements.nth(1).locator("canvas").nth(0)).to_be_visible()
+    expect(bokeh_chart_elements.nth(2).locator("canvas").nth(0)).to_be_visible()
+
+    # show a bokeh slider
+    expect(bokeh_chart_elements.nth(3).locator("canvas").nth(0)).to_be_visible()
diff --git a/frontend/lib/package.json b/frontend/lib/package.json
index 1319a28a7fe0..1fdc36cda4cb 100644
--- a/frontend/lib/package.json
+++ b/frontend/lib/package.json
@@ -5,7 +5,7 @@
   "license": "Apache-2.0",
   "main": "dist/index.js",
   "types": "dist/index.d.ts",
-  "sideEffects": false,
+  "sideEffects": ["**/vendor/bokeh/**"],
   "files": [
     "dist"
   ],
diff --git a/frontend/lib/src/vendor/bokeh/bokeh-api-2.4.3.esm.min.d.ts b/frontend/lib/src/vendor/bokeh/bokeh-api-2.4.3.esm.min.d.ts
new file mode 100644
index 000000000000..d2e9f340f06e
--- /dev/null
+++ b/frontend/lib/src/vendor/bokeh/bokeh-api-2.4.3.esm.min.d.ts
@@ -0,0 +1,5 @@
+// Including this polyfill type declaration prevents typescript checker from
+// parsing bokeh-api-2.4.3 JS source file that has TS deems invalid (\u2118)
+// https://mothereff.in/js-variables
+declare const plugin;
+export default plugin;
\ No newline at end of file
diff --git a/frontend/lib/src/vendor/bokeh/bokeh-gl-2.4.3.esm.min.d.ts b/frontend/lib/src/vendor/bokeh/bokeh-gl-2.4.3.esm.min.d.ts
new file mode 100644
index 000000000000..397965023ba9
--- /dev/null
+++ b/frontend/lib/src/vendor/bokeh/bokeh-gl-2.4.3.esm.min.d.ts
@@ -0,0 +1,5 @@
+// Including this polyfill type declaration prevents typescript checker from
+// parsing bokeh-gl-2.4.3 JS source file that has TS deems invalid (\u2118)
+// https://mothereff.in/js-variables
+declare const plugin;
+export default plugin;
\ No newline at end of file
diff --git a/frontend/lib/src/vendor/bokeh/bokeh-tables-2.4.3.esm.min.d.ts b/frontend/lib/src/vendor/bokeh/bokeh-tables-2.4.3.esm.min.d.ts
new file mode 100644
index 000000000000..b1ffab3f51fa
--- /dev/null
+++ b/frontend/lib/src/vendor/bokeh/bokeh-tables-2.4.3.esm.min.d.ts
@@ -0,0 +1,5 @@
+// Including this polyfill type declaration prevents typescript checker from
+// parsing bokeh-tables-2.4.3 JS source file that has TS deems invalid (\u2118)
+// https://mothereff.in/js-variables
+declare const plugin;
+export default plugin;
\ No newline at end of file
diff --git a/frontend/lib/src/vendor/bokeh/bokeh-widgets-2.4.3.esm.min.d.ts b/frontend/lib/src/vendor/bokeh/bokeh-widgets-2.4.3.esm.min.d.ts
new file mode 100644
index 000000000000..06c9c94463f5
--- /dev/null
+++ b/frontend/lib/src/vendor/bokeh/bokeh-widgets-2.4.3.esm.min.d.ts
@@ -0,0 +1,5 @@
+// Including this polyfill type declaration prevents typescript checker from
+// parsing bokeh-widgets-2.4.3 JS source file that has TS deems invalid (\u2118)
+// https://mothereff.in/js-variables
+declare const plugin;
+export default plugin;
\ No newline at end of file

<!--
⚠️ BEFORE CONTRIBUTING PLEASE READ OUR CONTRIBUTING GUIDELINES!
https://github.com/streamlit/streamlit/wiki/Contributing
-->

## Describe your changes
- need to add an exception to `sideEffects` in `package.json` as we are doing side effect imports in `BokehChart.tsx`
- add a test in e2e to make sure this regression doesn't happen
- migrate e2e cypress test to playwright
## GitHub Issue Link (if applicable)
closes #7171
## Testing Plan

- Explanation of why no additional tests are needed
- Unit Tests (JS and/or Python)
  - not sure of how to add a unit test for this
- E2E Tests
  - added a test
- Any manual testing needed?

---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
