Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(_meta): replace with build time JSON #2840

Merged
merged 37 commits into from
May 31, 2018
Merged

refactor(_meta): replace with build time JSON #2840

merged 37 commits into from
May 31, 2018

Conversation

levithomason
Copy link
Member

@levithomason levithomason commented May 25, 2018

Fixes #2848

This PR removes the static _meta property from our components. This required widespread changes. During these changes, many other improvements were made.

Notable Changes

Remove _meta from all components, docs, and tests

This property is only used for documentation and tests, yet it is exposed in production code. Our production bundle will now be smaller due to removing this property from every component and subcomponent.

Generate JSON files for docs and tests

  • componentMenu.json
    A minimal list of component display names and types. Powers the main docs left menu.

  • docs/app/exampleMenus/Component.examples.json
    A separate gitignored json file describing the examples of each component. Used in the docs right menu and dynamically imported. Previously called menuInfo.json.

  • docs/app/componentInfo/Component.info.json
    A separate gitignored file for every component. This file documents the component and its API in detail as well as information about the file and path itself. This detailed information is used in tests and the doc site. Replaces docgenInfo.json and parentComponents.js, componentInfo.js, and META.js.

Other Changes

  1. Moved many tasks to gulp, parallelized build steps
  2. Dynamically imports sidebar menu data (more dynamic imports to come in the future)
  3. Updated babel deps
  4. Removed docs/app/HOC/pure in favor of React.PureComponent.
  5. Removed docs/app/HOC/withDocInfo in favor of computing in the single place it is required.
  6. Removed docs/app/utils/getNewHash as it is unused.
  7. Removed docs/app/utils/isOldHash as it is unused.
  8. Normalize use of name, componentName, and displayName in doc site props and variables.
  9. Fixed typo subComponents => subcomponents
  10. Fixed typo docBlock => docblock

TODO

  • fix maximize view
  • fix props table name bug
  • watch components and rebuild *.info.json files on component change
    ...others

@codecov-io
Copy link

codecov-io commented May 30, 2018

Codecov Report

Merging #2840 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2840      +/-   ##
==========================================
- Coverage   99.74%   99.74%   -0.01%     
==========================================
  Files         160      160              
  Lines        2779     2696      -83     
==========================================
- Hits         2772     2689      -83     
  Misses          7        7
Impacted Files Coverage Δ
src/collections/Message/MessageList.js 100% <ø> (ø) ⬆️
src/collections/Form/FormRadio.js 100% <ø> (ø) ⬆️
src/collections/Table/TableFooter.js 100% <ø> (ø) ⬆️
src/collections/Form/FormCheckbox.js 100% <ø> (ø) ⬆️
src/collections/Form/FormField.js 100% <ø> (ø) ⬆️
src/modules/Search/SearchResults.js 100% <ø> (ø) ⬆️
src/modules/Search/Search.js 99.46% <ø> (ø) ⬆️
src/elements/Image/ImageGroup.js 100% <ø> (ø) ⬆️
src/addons/Ref/Ref.js 100% <ø> (ø) ⬆️
src/elements/Step/Step.js 100% <ø> (ø) ⬆️
... and 145 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d2d509...12dd8fa. Read the comment docs.

@levithomason levithomason changed the title [WIP] Remove static _meta and generate data refactor(_meta): replace _meta with generated json May 31, 2018
@levithomason levithomason changed the title refactor(_meta): replace _meta with generated json refactor(_meta): replace with build time JSON May 31, 2018
@levithomason levithomason merged commit b298d59 into master May 31, 2018
@levithomason levithomason deleted the docs/meta branch May 31, 2018 20:44
@levithomason
Copy link
Member Author

Released in [email protected].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Full screen doc examples result in 404
3 participants