Idea seed: share component examples with FIDL examples?

12 views
Skip to first unread message

Yifei Teng

unread,
Apr 5, 2022, 7:36:17 PM4/5/22
to fidl-dev, component-framework-dev, docs-d...@fuchsia.dev
Hey folks,

I was reviewing "[examples] Create cpp version of routing" (fxrev.dev/652462) which exercises FIDL (a bit) and service routing (a lot). In parallel, we have also written FIDL examples in each language (e.g. LLCPP one here, and rendered tutorials) which exercises FIDL (a lot) and service routing (a bit).

I think the average user onboarding Fuchsia could benefit from learning the two together, what do folks think about sharing the examples and/or the tutorials to talk about service routing and serving/consuming said services in one document?

Besides reducing duplication it also fixes fxbug.dev/97170 (migrate component examples to async FIDL APIs) because the FIDL examples already cover async clients and servers.

Cheers,
Yifei

Shai Barack

unread,
Apr 5, 2022, 7:39:42 PM4/5/22
to Yifei Teng, fidl-dev, component-framework-dev, docs-d...@fuchsia.dev
I agree. The two "bootstrap" concepts for Fuchsia development are FIDL and Components. Conceptually they seem co-equal to me.

--
All posts must follow the Fuchsia Code of Conduct https://fuchsia.dev/fuchsia-src/CODE_OF_CONDUCT or may be removed.
---
You received this message because you are subscribed to the Google Groups "component-framework-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to component-framewo...@fuchsia.dev.
To view this discussion on the web visit https://groups.google.com/a/fuchsia.dev/d/msgid/component-framework-dev/CANbn4XBQZAPgJGgapzDwMCsd9q53tXr3YtcT1suhPC2rO6gxoA%40mail.gmail.com.

Gary Bressler

unread,
Apr 5, 2022, 8:31:49 PM4/5/22
to Shai Barack, Yifei Teng, fidl-dev, component-framework-dev, docs-d...@fuchsia.dev
Makes sense to me. Component examples are basically a superset of fidl examples because you have to write a component if you want to demonstrate a fidl sender and receiver.

Dave Smith

unread,
Apr 6, 2022, 10:05:44 AM4/6/22
to Gary Bressler, Shai Barack, Yifei Teng, fidl-dev, component-framework-dev, docs-d...@fuchsia.dev
Thanks for raising this, Yifei! I do love a good conversation about sample code.
Hopefully the following isn't too much of a brain dump...

Component Framework and FIDL together absolutely weave together to make up the foundation of developing Fuchsia software. This is why they are the core components of Fuchsia Fundamentals. This is where new developers learn about these two concepts, how they fit together, and form the basis for Fuchsia development. Today, the examples that drive this content are under //examples/components, and specifically the "one sample" that ties these two elements together is //examples/components/routing. It covers the simplest form of both so developers can see how the pieces fit together.

So what comes after that point? This is where I think the two start to diverge. After that initial learning stage, Component Framework and FIDL both have more to teach us separately, and this is where those additional tutorials come in. FIDL has concepts like sync/async clients and pipelining while CF includes things like expanded capability types (storage, events, etc.) and parent/child management. Diving deeper into those additional features of each API surface is where the existing FIDL tutorials and future CF tutorials can lean in.

Having said that, there is some technical debt here that we probably should address since these two examples evolved over time around essentially the same FIDL protocol (Echo). At a minimum, we probably don't need a fuchsia.examples.Echo and a fidl.examples.routing.echo.Echo definition. This branching has also created some fragmentation in the different test artifacts that have come to depend on either example. But there's also an opportunity to expand the FIDL tutorials to a protocol that better encompasses additional FIDL features we don't really cover in the Echo examples; and this is another way of differentiating the two. I could also envision having some of these foundational examples moved elsewhere (//examples/basic?) to help clarify that the content under //examples/components and //examples/fidl are both more free to explore the specifics of those APIs.

The CLs you referenced here are directly in service of improving Fuchsia Fundamentals with support for C++ in addition to Rust, and eventually for developers using the SDK. If you have any thoughts on the Fuchsia Fundamentals learning pathway that could improve how we discuss these FIDL and Components concepts as a pair, I'd love to chat about them too!
Dave Smith | Developer Relations | smit...@google.com | @devunwired


You received this message because you are subscribed to the Google Groups "fidl-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fidl-dev+u...@fuchsia.dev.
To view this discussion on the web visit https://groups.google.com/a/fuchsia.dev/d/msgid/fidl-dev/CAK1yh2%3DL7SNJ84_uXchz-wYqe8n9EtFC69Qyxu5Z8N_w%2BzO1xA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages