Skip to content

Instantly share code, notes, and snippets.

@lfbergee
Last active December 20, 2019 08:55
Show Gist options
  • Save lfbergee/87a6a38b9c837001aa51a5b2bb49439f to your computer and use it in GitHub Desktop.
Save lfbergee/87a6a38b9c837001aa51a5b2bb49439f to your computer and use it in GitHub Desktop.

Shared

Whats new

  • Build job
    • Was just plain babel, now we use rollup to run babel
    • Enables easier integration with typescript
    • Enables build time optimizations, like strip prop-types, minification
    • Enables code-splitting
  • Update from babel 6 to 7
  • Update from styleguidist 6 to 10
  • Minimum React peer-dependency set to 16.8, allows us to use hooks in shared
  • Introduced prettier
  • Updated from husky 0.14 to 3.1 and added lint-staged
    • Only lint files in stage
  • Different structure of lib files

Migration guide

  • No changes for utils
  • Components must be imported as named from root
    • import { SomeComponent } from 'kfp-shared';
  • Decorators are imported as named from lib
    • `import { SomeDecorator } from 'kfp-shared/lib/decorators';
  • Validators are imported as named from lib
    • `import { SomeValidators } from 'kfp-shared/lib/validators';
  • Less are imported from lib
    • @import ~kfp-shared/lib/less/someLessFile.less

Deprecation notice

  • Combobox/LargeCombobox, replace with SearchableDropdown from FFE
  • LoadingText, replace with something less terrible
  • Formatters, replace with equivalent FFE formatter
    • FormatAccountNumber
    • FormatNumber
    • FormatAmount
    • FormatDistance
    • FormatSSN
  • withEasedProperties, replace with animationHook from jokul

Questions

  • Do we need /example?
  • Do we need /images?
  • Does anyone want/need/require stylelint?
  • Should we minify code out of shared?
  • Should pure utilities and formatters be moved up to a common Fremtind repo, so shared is KFP only?

Next step

  • Prettify entire project
  • Coolocation of test
  • Deprecation of old code, combobox in particular should go
  • Introduction of typescript
  • Change from mocha/enzyme to jest/testing-libary
  • Deploy styleguide somewhere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment