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

Refactored the ContributeGuide.tsx file #906

Closed

Conversation

PeachesMLG
Copy link

No description provided.

Copy link
Author

Choose a reason for hiding this comment

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

This file is still fairly bulky, but I dont think there is much way around that

Copy link
Member

@gnattu gnattu left a comment

Choose a reason for hiding this comment

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

I personally do not like what it is in its current form. It seems to achieve the goal of reducing the original file's line count, but it introduces unnecessary complexity and makes the code even harder to maintain.

import Link from '@docusaurus/Link';

export const contributeData: NodeData = {
links: [
Copy link
Member

Choose a reason for hiding this comment

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

I'm sorry, but I really don't think a huge Nodedata object is more maintainable and easier to work with than JSX. This will cause extra pain if we ever want to change this page.

Copy link
Author

Choose a reason for hiding this comment

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

I disagree to be honest, it means if we want to change any of the stucture of a "node" we can do so very easily in the Node.tsx file, I also dont see how this is harder to edit than the previous one.

Doing it this way also means that we can unit test this alot easier than before.

node: NodeData;
}

export default function Node({ data }: { data: NodeData }) {
Copy link
Member

Choose a reason for hiding this comment

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

This is a terrible name for this "component" and I think it is meaningless to have a component like this because the idea passing "node data" is just terrible. If you really want a re-usable component, made a "Tabs" component which switch between displaying multiple panels of content and use saner syntax like:

<Tabs id="TabsExample" onChange={this.handleTabChange} selectedTabId="code">
   <Tab id="code" title="Code" panel={<CodePanel />} />
   <Tab id="translations" title="Translations" panel={<TranslationsPanel />} />
   <Tab id="other" title="Other" panel={<OtherPanel />} />
</Tabs>

Copy link
Author

Choose a reason for hiding this comment

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

I made a new pr here: #907

See if this option looks better

@nielsvanvelzen
Copy link
Member

This file is moved in the developers branch, unless actual content changes are made i don't see the point of making changes to it as it only complicates rebasing the dev branch.

@PeachesMLG
Copy link
Author

PeachesMLG commented Mar 15, 2024

I dont believe it has moved in the developer branch? still appears to be there?

https://github.com/jellyfin/jellyfin.org/blob/developers/src/components/contribute/ContributorGuide.tsx

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

Successfully merging this pull request may close these issues.

3 participants