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

Child/nested components? #54

Open
deyanp opened this issue Jun 12, 2019 · 5 comments
Open

Child/nested components? #54

deyanp opened this issue Jun 12, 2019 · 5 comments
Labels
question Further information is requested

Comments

@deyanp
Copy link

deyanp commented Jun 12, 2019

How can I extract Model/Message/Html Template for subcomponents into separate folders/files?
The (otherwise excellent) HelloWorld sample has all the code in Main.fs, and all the templates in main.html ...

@deyanp
Copy link
Author

deyanp commented Jun 13, 2019

Ignore that, figured it out, and this helped me:

https://github.com/nojaf/elmish-component

I have reworked the HelloWorld sample with components, but not sure if it is fully correct, and if you are interested in such ..

@Tarmil Tarmil added the question Further information is requested label Jun 16, 2019
@Tarmil
Copy link
Member

Tarmil commented Jun 18, 2019

I'd be curious to see your reworked HelloWorld! I have started one myself here: https://github.com/Tarmil/bolero.template.structured

@deyanp
Copy link
Author

deyanp commented Jun 18, 2019

@BentTranberg
Copy link

I've done work on this in my business project, but I don't know yet if it's ok or needs fixing. Will study the links above. My initial work can be seen in the repro uploaded for this issue: #55

I don't think I split the html in that early revision, but it's as easy as snipping a <template>...</template> into a separate html file, and load it the same way you load main.html.

I think it will mean a lot for Bolero's popularity that template(s) contains demo code illustrating the basic things you need to get started with development, as well as some structure that can guide the developer in expanding the application. A list of things I can think of at the moment :

  • How to implement and organize submodels.
  • How to push data/messages from the server to the client.
  • How to handle long-running queries from the client, with replies from the server.
  • How to transfer large data between client and server. E.g. a file being downloaded.
  • A more advanced menu than the one currently used. Preferably hierarchical in some way.

I guess some of this is too complex for the template, and should rather be available elsewhere, e.g. in the docs.

@kdblocher
Copy link

@Tarmil I used your github for the template for a more structured approach successfully, and was even able to split the nav into the actual page header without issue. Perhaps you could offer another template with this approach with dotnet new for those of us that want to use Bolero with this structured approach by default? Or adopt the structured approach over the simplified one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants