react-dark-mode-toggle icon indicating copy to clipboard operation
react-dark-mode-toggle copied to clipboard

TypeScript/Rollup Rewrite

Open todd-elvers opened this issue 4 years ago • 3 comments

TypeScript/Rollup Rewrite

  • Rewrote library in TypeScript
  • Changed from default-export syntax to named-export syntax
  • Rewrote Storybook config & stories in TypeScript
  • Added Storybook prop controls & more stories
  • Switched to the Rollup bundler
    • Allows us to output both a CJS and an ESM bundle
    • Allows us to compile animationData.json directly into the code
  • Resolved issue #17
  • Integrated parse-unit directly into the library
  • Added jest, ts-jest, and associated configuration for running tests with yarn test
  • Updated react-lottie-player to the latest version
  • Added pre-commit git hook to format all changed files w/ prettier before committing
    • Ensures we never have to look at formatting changes in a git diff
  • Added pre-commit git hook to compile the entire library before committing
    • Makes it impossible to commit code that does not compile
  • Updated README.md
  • Removed a lot of unused dependencies
  • Removed yarn.lock from .gitignore and committed it
  • Added .storybook and .babelrc to .npmignore
  • Bumped to 1.0.0
  • Moved react-lottie-player to peerDependencies
  • Added react and react-dom to peerDependencies

todd-elvers avatar May 29 '21 18:05 todd-elvers

Okay, I believe I'm done with my changes. Recent:

  • All files are now TypeScript, even the config files
  • Library also now requires all tests to pass before git commit will succeed

I'll be around this weekend if you have questions about any of these changes.

todd-elvers avatar May 29 '21 19:05 todd-elvers

I've moved react and react-dom and react-lottie-player to peer-dependencies, reducing the bundle size. CJS bundle is less than 90 lines and ESM bundle is less than 60.

That's my final change, I swear 😄

Could someone create a canary/dev release so I can test?

todd-elvers avatar May 30 '21 00:05 todd-elvers

@cawfree Any chance you could take a look at this? I can rebase if that helps.

todd-elvers avatar Jun 11 '21 21:06 todd-elvers