question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Discuss] Kubeflow Pipelines frontend development best practice.

See original GitHub issue

Topic

Inspired by https://github.com/kubeflow/pipelines/pull/5040#discussion_r569956232 : Determine the pattern and anti-pattern for frontend development on Kubeflow Pipelines. There are some existing development styles which are either out-of-date, or not recommended in the codebase. For example, enzyme vs react-testing-library, Ref vs Hook/State Update.

Request

Everyone is welcome to add their opinions on best practice for frontend development. Please use the following format in your comment for better reviewing:

### Suggested Practice

// Write down the pattern or anti-pattern you suggest, prefer a concise statement with necessary link.

### Reason

// Write down the reason why a pattern is preferred, or why certain pattern should be avoided. You can be very verbose here.

### Example (Optional)

// Give an entry point for people to understand how to adopt this practice, or point out the existing file in codebase where we should improve or should follow.

Action

After collecting feedback, frontend reviewers will make a call on whether to apply such practice, then update the README.

/kind discussion /area frontend

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
zijianjoycommented, Feb 9, 2021

Suggested Practice

Prefer using react-testing-library in testing, avoid using enzyme when possible.

Reason

The more your tests resemble the way your software is used, the more confidence they can give you.

react-testing-library allows you to focus on the user facing elements and interactions, while enzyme has tested implementation detail which might produce false positive/negative when refactoring. Although enzyme has helped with certain scenarios and it has been widely used by community, it can be verbose and fragile which doesn’t serve the best interest: production user’s experience. However, it is hard to flip the coin at once, so feel free to choose the best fit library depending on the scenario. https://kentcdodds.com/blog/testing-implementation-details

Example (Optional)

https://github.com/kubeflow/pipelines/blob/master/frontend/src/pages/ExperimentList.test.tsx#L317-L324

Instead of testing the props value, validating that the UI has rendered 2 runs for certain experiment is preferred.

1reaction
Bobgycommented, Feb 15, 2021

Regarding the process, I’d suggest putting up individual PRs for the proposals, so that each of them can be addressed and discussed in its own context. It’s hard to browse if we have several different topics in one github issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Discuss - frontend best practice] one way data flow #5136
Build page component tests using react testing library, rather than accessing component instance and methods. (as documented in [Discuss] ...
Read more >
Best Practices for Designing Components - Kubeflow
This page describes some recommended practices for designing components. For an application of these best practices, see the component ...
Read more >
Community and Support - Kubeflow Pipelines
This is an opportunity to learn about changes to KFP developments, discuss feature requests, and ask questions.
Read more >
Introduction | Kubeflow
What is Kubeflow Pipelines? · End-to-end orchestration: enabling and simplifying the orchestration of machine learning pipelines. · Easy ...
Read more >
AWS Machine Learning Blog
Kubeflow Pipelines helps build and deploy portable, scalable ML workflows that can include steps like data extraction, preprocessing, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found