Skip to content

[feat] Pull out example app from library codebase #2001

@haworku

Description

@haworku

Is your feature request related to a problem? Please describe.

I find that having the example app inside the library codebase makes library maintenance burdensome.

  • It increases the load on dependabot.
  • It slows our CI and approval workflow. We often have many outstanding PRs for dependencies that are not used in the published library.
  • Security alerts are hard to parse. Hard to understand which issues are impacting the library specific code because most are the example app.

I am also not sure we are getting value out of having the example app in the library

  • We do not build the example application as part of CI or regularly test it. We currently have an outstanding issue fix: Project's example doesn't seem to compile/run #1931 that reflects this.
  • We are not using the example app as a test sandbox. Instead, we rely on Storybook to test changes, which seems to work pretty well. In addition, maintainers prefer to pull the library into live working apps regularly to verify changes during releases (rather than relying on the example app).

At this point, I think we might be better suited pulling the example out into its own repository that can be updated on its own, separate from the @trussworks/react-uswds codebase. It could reference the latest main branch in its package.json.

Describe the solution you'd like

Remove the /example folder with its nested package.json and all depedendencies. Create a new repo for the example app, pointing at our codebase.

Describe alternatives you've considered

  • Use existing tools more efficiently. Lean more into yarn workpaces to isolate the two aspects of the codebase better. Start building the example app in CI and deploying it regularly to ensure its working. Move towards updating example app dependencies in large PRs all at once rather than relying on dependabot. Or have a separate CI flow for dependencies inside the example app. We don't need to be running our library visual regression tests (Happo) on example app changes for example. Consider also simplifying the dependencies in the example app, probably this should not be a CRA app.

^ The issue I see with this approach is its a significant lift and I'm not sure that we are getting value out of the example app to merit it. I would love comments on this though, there are likely things that I am missing. Or maybe folks think that separating the app will not help the maintenance of the library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: dependenciesMaintaining 3rd-party dependenciestype: exampleExample implementations of ReactUSWDS, such as Storybook or kitchen sink app

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions