Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

cf-component-pagination migration to Fela#135

Merged
sejoker merged 15 commits intocloudflare:masterfrom
sejoker:pagination-fela-migration
Apr 4, 2017
Merged

cf-component-pagination migration to Fela#135
sejoker merged 15 commits intocloudflare:masterfrom
sejoker:pagination-fela-migration

Conversation

@sejoker
Copy link
Contributor

@sejoker sejoker commented Mar 29, 2017

No description provided.

@jwineman
Copy link
Contributor

Looks like cf-builder-pagination tests are failing

@sejoker sejoker force-pushed the pagination-fela-migration branch from e8cf8c0 to 5d42e2e Compare March 30, 2017 18:30
@sejoker sejoker changed the title WIP Pagination fela migration Pagination fela migration Mar 30, 2017
Copy link
Contributor

@tajo tajo left a comment

Choose a reason for hiding this comment

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

Looking pretty good! I'll test it visually later. We should deal with the tests before merging (I'm working on StyleProvider now)

import React from 'react';
import { Pagination, PaginationItem } from 'cf-component-pagination';
import Icon from 'cf-component-icon';
import { applyTheme } from 'cf-style-container';
Copy link
Contributor

Choose a reason for hiding this comment

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

unused

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


export { PaginationUnstyled };

export default applyTheme(PaginationUnstyled, PaginationTheme);
Copy link
Contributor

Choose a reason for hiding this comment

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

To preserve the consistency with my code, can you do these exports in index.js instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want consistency with my code, I use default export for PaginationLink and PaginationRoot


export { PaginationItemUnstyled };

export default applyTheme(PaginationItemUnstyled, PaginationItemTheme);
Copy link
Contributor

Choose a reason for hiding this comment

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

please, do these exports in index.js

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want consistency with my code, I use default export for PaginationLink and PaginationRoot


const PaginationLinkUnstyled = createComponent(styles, PaginationLink);

export default applyTheme(PaginationLinkUnstyled, PaginationLinkTheme);
Copy link
Contributor

Choose a reason for hiding this comment

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

move to index.js

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I use export default applyTheme(PaginationLinkUnstyled, PaginationLinkTheme); to import into PaginationItem, I don't want duplication in index.js and PaginationLink

Copy link
Contributor

Choose a reason for hiding this comment

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

you could import them from ./index.js but that's ok


export { PaginationRootUnstyled };

export default applyTheme(PaginationRootUnstyled, PaginationRootTheme);
Copy link
Contributor

Choose a reason for hiding this comment

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

move to index.js

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I use export default applyTheme(PaginationRootUnstyled, PaginationRootTheme) to import into Pagination, I don't want duplication in index.js and PaginationRoot

@jamiebuilds
Copy link
Contributor

I agree with @tajo that the export stuff should be done in index.js, if you're super consistent about modules it will make working with the AST much much easier for the styleguide and any transformations/codemods you want to do.

@sejoker
Copy link
Contributor Author

sejoker commented Mar 31, 2017

All right, I moved all exports into index.js as per suggestions from @tajo and @thejameskyle. Should be good to go?

test('should should call onPageChange when clicking another page', () => {
const onPageChange = createStub();
// StyleProvider does not pass props
// test('should call onPageChange when clicking another page', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

If you're disabling this test you should use test.skip( instead so that it appears in test results as being skipped. That way you're reminded to revisit it later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@thejameskyle valid point, updated

@sejoker sejoker changed the title Pagination fela migration cf-component-pagination migration to Fela Apr 4, 2017
@sejoker sejoker merged commit bf4f63a into cloudflare:master Apr 4, 2017
@jwineman jwineman mentioned this pull request Apr 5, 2017
33 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants