OpenFn / OpenFn/lightning

(new-react) Allow html placeholders to be added to components in elixirland

Open
#3,091 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug elixir feature enhancement
Dominant language
Elixir
Stars
296
Forks
86
Avg merge
1d 13h
Merged PRs (30d)
50

Description

Issue

In our new react implementation with phoenix, we're unable to pass child elements to our components on the phoenix side.

We're unable to do this

<.WorkflowEditor>
  <div>loading...</div>
</.WorkflowEditor>

We can only do this

<.WorkflowEditor />

Hence, we lose the ability to specify placeholders before the actual react mount happens. I think someone on the elixir team should be able to resolve this. Thanks

Place to look

https://github.com/OpenFn/lightning/blob/main/lib/react.ex
The child elements needs to be passed in and rendered inside the div below
https://github.com/OpenFn/lightning/blob/52a6c87aea733b1060b107de8b291ba8e84fe8f0/lib/react.ex#L125C11-L130C13

cc: @stuartc

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open lib/react.ex and inspect the component-rendering code around lines 125-130, then trace how HEEx child elements are received by the React mount. The work is complete when children passed to a Phoenix component render inside the generated div before React mounts, while self-closing components continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir, react
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.