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

[KED-2470] Add Container component to simplify app/lib entrypoint #379

Merged
merged 1 commit into from
Feb 24, 2021

Conversation

richardwestenra
Copy link
Contributor

Description

  1. Create new Container component, and move a lot of the logic for the app entrypoint to it, in order to keep src/index.js as simple as possible. This should help make it easier to understand the different entrypoints for the app/lib use-cases.
  2. Move the 'what-input' import to the App component - it should have been there to begin with.
  3. Move the global app styles from src/styles.index.scss to Container component, as they are most related to this component.
  4. Change import order in App component - cosmetic change to ensure that absolute imports come first.
  5. Add better explanation in App/Container JSDoc comments

Development notes

The only functionality change is that focus highlights should work in app imports now - I don't think they would have before.

I wasn't sure about the 'Container' component name, but I wasn't sure what else to call it. 'KedroViz'? 'AppContainer' and 'LibContainer'? I think it works for now with the comments I've added. Besides, this is all fairly temporary, no need to spend too much time scrutinising it.

QA notes

Check both lib/app usages.

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added new entries to the RELEASE.md file
  • Added tests to cover my changes

Legal notice

  • I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":

  • I submit this contribution under the Apache 2.0 license and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.

  • I certify that (a) this contribution is my original creation and / or (b) to the extent it is not my original creation, I am authorised to submit this contribution on behalf of the original creator(s) or their licensees.

  • I certify that the use of this contribution as authorised by the Apache 2.0 license does not violate the intellectual property rights of anyone else.

1. Create new Container component, and move a lot of the logic for the app entrypoint to it, in order to keep src/index.js as simple as possible.
2. Move the 'what-input' import to the App component - it should have been there to begin with.
3. Move the global app styles from src/styles.index.scss to Container component, as they are most related to this component.
4. Change import order in App component - cosmetic change to ensure that absolute imports come first.
5. Add better explanation in App/Container JSDoc comments
import './app.css';

/**
* Main wrapper component. Intialises the Redux store
* Entry-point component for the use-case where Kedro-Viz is imported as a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newer component is good as it explains the use case for this component 👍

* Top-level component for the use-case where Kedro-Viz is run as a standalone
* app rather than imported as a library/package into a larger application.
*/
const Container = () => (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: I might've preferred to call AppContainer just to allow this to be more specific.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe even KedroViz as that's the alias being used? Makes sense based on intended usage, since that's the public component.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's a good shout! I'm inclined to leave it for now because we'll be revisiting/refactoring this when we deprecate the library/package use-case, but can revisit if you feel strongly about it :)

@richardwestenra richardwestenra changed the title [KED-2470] Create new Container component to simplify app/lib entrypoint Add Container component to simplify app/lib entrypoint Feb 24, 2021
@richardwestenra richardwestenra merged commit 616413f into main Feb 24, 2021
@richardwestenra richardwestenra deleted the feature/container-component branch February 24, 2021 17:09
@richardwestenra richardwestenra changed the title Add Container component to simplify app/lib entrypoint [KED-2470] Add Container component to simplify app/lib entrypoint Feb 25, 2021
@richardwestenra richardwestenra mentioned this pull request Mar 2, 2021
1 task
richardwestenra added a commit that referenced this pull request Mar 2, 2021
# Release 3.10.0

## Major features and improvements

- Display a prompt before rendering very large graphs (#361, #376, #377, #381)

## Bug fixes and other changes

- Clean up SCSS tech debt (#380)
- Add Container component to simplify app/lib entrypoint (#379)
- Add stylelint 'rule-empty-line-before': 'always' (#378)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants