Giter Site home page Giter Site logo

react-library's Introduction

React Library

Setup

Installation

  • git clone this repository
  • first terminal: cd demo && npm install && npm start
  • second terminal: cd library && npm run library:build

Publish

  • create account on https://www.npmjs.com
  • npm login on command line
  • replace rwieruch-react-library in all files with your-name-react-library
  • first terminal: cd library && npm run library:build && npm publish
  • second terminal: cd demo && npm install your-name-react-library

Update

  • make changes in /library
  • increment version in package.json
  • first terminal: cd library && npm run library:build && npm publish
  • second terminal: cd demo && npm install your-name-react-library

Tasks

Webpack to Rollup

  • The /library is build with Webpack and Babel. However, Rollup is the most popular choice when it comes to libraries. So exchange Webpack with Rollup, but keep and use the .babelrc.

Code Splitting

  • Webpack does code splitting at the moment. Rollup should do the same, so that the annotated // TODO imports in /demo/src/App.js work.

TypeScript

  • Make /library work with TypeScript and export the type definitions. Then convert /demo to TypeScript and use the typed library.

CSS Modules instead of Styled Components

  • Make /library work with CSS Modules instead of TypeSript. The crucial file that needs to work is /library/src/Data/Item/index.js with its theme and offset. So injecting CSS from the outside needs to work (theme) and setting dynamic values (offset) should work too.

NPM Link

  • Use NPM linking, so that /library can be used like a library in /demo, but without installing it via npm.

react-library's People

Contributors

rwieruch avatar

Stargazers

Roman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.