Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds KinoLiveComponent for local component development #2220

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ if ("outerHTML" in SVGElement.prototype) {
// breakpoints defined in assets/css/_variables.scss
const breakpoints = { xs: 0, sm: 544, md: 800, lg: 1088, xxl: 1344 };

submitOnEvents(["blur", "change"]);
/* submitOnEvents(["blur", "change"]);
googleAnalytics();
setupGlobalNavigation();
collapse();
Expand Down Expand Up @@ -159,4 +159,4 @@ previousEventsButton();
pslPageSetup();
accordionInit();

mobileAppBanner();
mobileAppBanner(); */
5 changes: 5 additions & 0 deletions config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ import Config

config :dotcom, :cache, Dotcom.Cache.Multilevel
config :dotcom, :trip_plan_feedback_cache, Dotcom.Cache.TripPlanFeedback.Cache

config :kino_live_component,
css_path: "http://localhost:8090/app.css",
endpoint: "http://localhost:4001/kino-live-component",
js_path: "http://localhost:8090/app.js"
10 changes: 10 additions & 0 deletions lib/dotcom_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,16 @@ defmodule DotcomWeb.Router do
end
end

import KinoLiveComponent.Plug, only: [allow_insecure_connection: 2]

if Mix.env() == :dev do
scope "/kino-live-component", KinoLiveComponent do
pipe_through([:allow_insecure_connection])

live("/", Live.Index)
end
end

scope "/preview", DotcomWeb do
import Phoenix.LiveView.Router
pipe_through([:browser, :browser_live, :basic_auth])
Expand Down
1 change: 1 addition & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ defmodule DotCom.Mixfile do
{:httpoison, "2.2.1"},
{:inflex, "2.1.0"},
{:jason, "1.4.4", override: true},
{:kino_live_component, "0.0.3"},
{:logster, "1.1.1"},
{:mail, "0.4.1"},
{:mbta_metro, "0.0.54"},
Expand Down
Loading