blocks icon indicating copy to clipboard operation
blocks copied to clipboard

Universal component library

Open pedrohperalta opened this issue 5 years ago • 5 comments

The ideia is to share this same lib between mobile and web projects. To do so, we should be able to reuse the same CSSs between the web/mobile components.

Organization:

  • @loadsmart/blocks-core

    • Shared css files
  • @loadsmart/blocks-web

    • Styled components for Web. Ex: styled.button
  • @loadsmart/blocks-mobile

    • Styled components for Mobile. Ex: styled.Button
  • @loadsmart/blocks-types

    • Types for Props/Theme
  • @loadsmart/blocks-styleguide

    • Typography (fonts, dimensions, weights, etc...)
    • Palette
    • Standard for media queries (mobile first?)
    • eslint

pedrohperalta avatar Dec 12 '19 21:12 pedrohperalta

Package name can have forward slashes (/) even if they are not nested directories, so

  • @loadsmart/blocks-web

could become

  • @loadsmart/blocks/web

Just a thought

gugiserman avatar Dec 13 '19 15:12 gugiserman

@pedrohperalta @gugiserman

If we have the Theme shared between projects, this is nice. I am wondering if we should have blocks-mobile and -web with 2 separated repositories.

The problem I see is some components having updates on one side and not in the other.

Example: Button receives a new prop called "loading" in mobile but not in web.

What is your idea? 1 or 2 repos?

djalmaaraujo avatar Dec 13 '19 15:12 djalmaaraujo

General Concept of what it could be: https://gist.github.com/djalmaaraujo/9206a68cc0a28b79960da0d5687e90f4

djalmaaraujo avatar Dec 13 '19 15:12 djalmaaraujo

If we have the Theme shared between projects, this is nice. I am wondering if we should have blocks-mobile and -web with 2 separated repositories.

I think the idea is to have a theme/styleguide/DSM in a separate package that both blocks-web and blocks-mobile would consume.

What is your idea? 1 or 2 repos?

We talked a bit about lerna so we could have a single repository to publish multiple NPM packages versioned independently (or in sync if we choose to).

I'm concerned with lack of sync between mobile and web as well, but even if they are in the same folder it won't guarantee that the person that is pushing changes will update both components always. We don't know if we will always have the time to afford updating both platforms on every change as well, this is a critical issue we need to review before making compromises...

gugiserman avatar Dec 13 '19 15:12 gugiserman

@gugiserman awesome. Lerna #ftw

djalmaaraujo avatar Dec 13 '19 15:12 djalmaaraujo