Skip to content

Conversation

@meagharty
Copy link
Contributor

@meagharty meagharty commented Nov 8, 2024

Summary of changes

Asana Ticket: 🏹 Implement "Create/Edit Shuttle Route Definition": Autocomplete for shapes

Reviewer Checklist

  • Meets ticket's acceptance criteria
  • Any new or changed functions have typespecs
  • Tests were added for any new functionality (don't just rely on Codecov)
  • This branch was deployed to the staging environment and is currently running with no unexpected increase in warnings, and no errors or crashes.

mix.exs Outdated
{:phoenix_live_react, "~> 0.4"},
{:phoenix_html, "~> 4.0"},
{:phoenix_html_helpers, "~> 1.0"},
{:phoenix_live_react, path: "/Users/mharty/git/phoenix_live_react"},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mix.exs Outdated
{:postgrex, ">= 0.0.0"},
# If react_phoenix changes, check assets/src/ReactPhoenix.js, too
{:react_phoenix, "1.3.1"},
{:react_phoenix, path: "/Users/mharty/git/react-phoenix"},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{:phoenix_live_reload, "~> 1.5", only: :dev},
{:phoenix_html, "~> 3.0"},
{:phoenix_live_react, "~> 0.4"},
{:phoenix_html, "~> 4.0"},
Copy link
Contributor Author

@meagharty meagharty Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phoenix_live_react and react-phoenix don't have compatibility yet with this version of phoenix_html. See comments with branches of my forks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't get any attention on the PRs to the open source projects, so I created my own fork for phoenix_live_react and updated the mbta for react-phoenix.

It didn't make sense to try to combine the two package because the integration is different. Liveview's JS has it's own setup with hooks and event functions.

Copy link
Contributor Author

@meagharty meagharty Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A difference between the two packages is the behavior on DOMContentLoaded.

for phoenix_live_react (https://github.com/fidr/phoenix_live_react/blob/5166af8209192cf421eccaa66cdaaeba2b9309ce/README.md?plain=1#L46-L51):

// Optionally render the React components on page load as
// well to speed up the initial time to render.
// The pushEvent, pushEventTo and handleEvent props will not be passed here.
document.addEventListener("DOMContentLoaded", e => {
initLiveReact()
})

vs. non-optional (part of source code, not app.js) in react-phoenix:
https://github.com/mbta/react-phoenix/blob/23728aae60cad3f478c06d1047f4b1a65d5c2b5a/src/react_phoenix.js#L18-L20

If it's important to us to reduce this to one elixir package, we could create a follow-up ticket.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like this was merged/released in the main repo https://github.com/fidr/phoenix_live_react/releases/tag/v0.6.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated phoenix_live_react to point back to the main repo, thank you!

@meagharty meagharty force-pushed the meag/try-live-select branch 3 times, most recently from 432cb07 to 513ca9c Compare November 20, 2024 01:04
@meagharty meagharty changed the title poc: try out live-select with shapes select feat: add live-select for shapes search Nov 20, 2024
@meagharty meagharty changed the title feat: add live-select for shapes search feat: add live-select for shapes autocompletion Nov 20, 2024
@meagharty meagharty marked this pull request as ready for review November 20, 2024 01:29
@meagharty meagharty requested review from a team and bfauble and removed request for a team November 20, 2024 01:29
@meagharty meagharty force-pushed the meag/try-live-select branch 2 times, most recently from a0ac4de to f3f1dcc Compare November 20, 2024 15:54
@meagharty meagharty force-pushed the meag/try-live-select branch from 0f00985 to fe18f01 Compare November 22, 2024 19:56
@meagharty meagharty merged commit 3e83c20 into master Nov 25, 2024
17 checks passed
@meagharty meagharty deleted the meag/try-live-select branch November 25, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants