Skip to content

Releases: doczjs/docz

v0.12.5

30 Sep 00:44
Compare
Choose a tag to compare

Changelog

🐞  Bug Fixes

  • docz-core: close dataserver connection on build (0f6bd7b)
  • docz-theme-default: adjust theme colors (eed7212)

v0.12.4

28 Sep 17:22
Compare
Choose a tag to compare

Changelog

🐞  Bug Fixes

  • docz: remove Children.only (656d8f1)
  • docz: restore scroll on history change (905010e)
  • docz-theme-default: use local vendors (27d04c0)
  • docz-core: data server rewriting files and refac utils (b157060)
  • docz-theme-default: add syntax highlight test for typescript (f8ff2ac)
  • docz-theme-default: inlineCode font size using em (ea3274e)
  • docz-utils: get value from heading recursive (a86a3e1)
  • docz-core: data server rewriting files (66e6248)
  • docz: merge menus and submenus (f8249da)

🚀  Features

  • ordering menu on doczrc (0efb905)
  • create menu based on doczrc property (94b4467)
  • add code sandbox integration (f0cc1cc)
  • docz-core: add --config flag (44dd6cb)
  • docz-theme-default: add link to root route on logo (8252ebf)
  • docz-core: add svgr built-in (1b19340)

CodeSandbox Integration

Now you can open your playground code on Code Sandbox out of the blue:

New config flag

The new --config flag allow you to set the path of your config file

$ docz dev --config ./my-config-file.js

Create and order menu from config

Now you can order the menu and create new links from your config file like this:

// doczrc.js
export default {
  menu: [
    'Home',
    'Components',
    { name: 'Github', href: 'https://github.com/pedronauck/docz' },
  ],
}

And even reorder submenus:

// doczrc.js
export default {
  menu: [
    'Home',
    { name: 'Components', menu: ['Alert', 'Button'] },
    { name: 'Github', href: 'https://github.com/pedronauck/docz' },
  ],
}

Svgr built-in support

If you want to load svg as a component using svgr, now you don't need anymore docz-plugin-svgr. In this new release the support for svgr in built-in on docz-core just using the named import ReactComponent:

import { ReactComponent as MyIcon } from './my-icon.svg'

<MyIcon />

⚠️  Warnings

v0.11.2

11 Sep 05:50
Compare
Choose a tag to compare

Changelog

🐞  Bug Fixes

  • docz: prevent crash when use imported props (ef6de9d)
  • docz-core: add watcher outside of update method scope (18c744d)
  • docz-core: prevent entries block when parse mdx crash (07ae769)
  • docz-core: remove https option and fix message (#321) (ea88841)
  • docz-theme-default: scrolling and overflows performance (a28ab79)
  • heading hash link with hash router config (7d7f557)

🚀  Features

  • add native config for doczrc (2580712)

v0.11.1

07 Sep 05:24
Compare
Choose a tag to compare

Changelog

🐞  Bug Fixes

  • docz: add react router inside the docz bundle (a293aa4)
  • docz-core: basename configuration (5fad743)
  • update no documents found text (#289) (cb782f9)
  • docz-core: chokidar performance improvements (0c344d8)
  • docz-core: literal value of headings for menus (85e4083)
  • docz-core: open js and ts loader scope of files (03c01b7)
  • docz-theme-default: prevent sidebar toggle on desktop (7a3b97d)

🚀  Features

  • docz-core: add config as parameter for onPrebuild and onPostBuild (98692bb)

v0.11.0

02 Sep 23:31
Compare
Choose a tag to compare

Changelog

🐞  Bug Fixes

  • docz-core: dispose hmr on imports (ba51086)
  • docz-core: join head tags (#255) (065e8b3)
  • docz-core: update react-docgen-typescript-loader to fix props table (34b2fdf)
  • docz-plugin-css: fix empty loaderOpts (193367b)
  • docz-plugin-css: fix empty loaderOpts (bb9b946)
  • docz-theme-default: add prop to keep codemirror last line (5c1e813)
  • docz-theme-default: add prop to keep codemirror last line (bf19ad5)
  • docz-theme-default: codemirror line end bug (9b07d27)
  • docz-theme-default: fix mobile menu peaking (#262) (77b627f)
  • docz-theme-default: remove react-breakpoints (c8288b0)
  • docz-theme-default: update the empty message (9db9231)
  • load-cfg: use fs-extra to read json sync instead of JSON.parse (04d1e1a)
  • base url and hash router making weird url (f483638)

🚀  Features

  • add link of repository from website (#245) (85cc9e7)
  • babel-preset-docz: add new babel preset (5efb568)
  • integration with react native (#271) (ac359ce)
  • docz-example-styled-components: add new example (0cef75e)
  • docz-theme-default: add auto close tags on playground editor (a6e5cf7)
  • docz-theme-default: add blockquote component (86ada87)
  • docz-theme-default: add refresh btn on playground (#254) (ebefd91), closes #251
  • docz-theme-default: add scrollbar on playground (#279) (0f6ea2a)

Thanks on this release to @jaburcodes @nicholasess @arojunior @lucasferreira 👏🏻👏🏻


⚠️  Drop support to Babel 6 ⚠️

Since Babel 7 now is a reality, in this new release we're dropping support for older versions of babel. Please, if you want to use this version, upgrade your babel. You can use babel-upgrade by just running:

npx babel-upgrade --write

📱  React Native Integration

Now you can easily document and test your React Native components just by adding docz-plugin-react-native on your doczrc.js:

import { reactNative } from 'docz-plugin-react-native'

export default {
  plugins: [reactNative()]
}

⏬  Automatic scrollbar on code

Now if your code snippet is too big, docz automatic shows a scrollbar on it

🔖  Auto-close tags on Playground

v0.10.3

16 Aug 05:06
Compare
Choose a tag to compare

Changelog

🐞  Bug Fixes

  • docz-core: correct data server websocket port (47fe714)
  • docz-core: try catch on get repo info (2016736)
  • docz-example-typescript: fix dependencies (#222) (67e68aa)
  • docz-theme-default: add playground min-height just on fullscreen (a82903a)
  • docz-theme-default: use padding on link instead of margin (b15457c)

🚀  Features

  • docz-core: add editBranch option to mount repo link (c619d9c)

v0.10.2

13 Aug 20:26
Compare
Choose a tag to compare

Changelog

🐞  Bug Fixes

  • prevent codemirror bug on build (3d0894e)
  • docz-core: remove data server cache 😕 (9683280)
  • docz-core: try catch on get repo info (bdfbf0b)

v0.10.1

13 Aug 19:22
Compare
Choose a tag to compare

Changelog

🐞  Bug Fixes

  • docz-core: prevent crash when not have cache (cd3609a)
  • docz-example-flow: scale and outline props (#211) (c8a4195)

v0.10.0

13 Aug 16:47
Compare
Choose a tag to compare

Changelog

🐞  Bug Fixes

  • bug template typo (#197) (497fcfb)
  • docz: add initial loading as true (3f05536)
  • docz-core: prevent crash on delete entry (28e1728)
  • docz-core: prevent delete entire app folder on build (e345896)
  • docz-theme-default: playground overflow on mobile (db1eb5b)
  • rehype-docz: add props on playground scope (ee4b6c0)
  • rehype-docz: allow ticks and backticks inside playground (#203) (fa4ff40)

🚀  Features

  • docz: fetch data on documents (04ff0d6)
  • docz-core: add cache system for entries (b90e598)
  • docz-core: resolve markdown files by default (#210) (e0a95b3)
  • add github repository link (78a19f6)
  • allow edit code inside playground (#205) (4f948f7)

⚠️  BREAKING CHANGE

  • docz-core: add htmlContext and mini-html-webpack-plugin (4b6ec0f)

By some performance and architecture issues, we changed to use mini-html-webpack-plugin instead of html-webpack-plugin. So, this can affect your index.html file if you're customizing it since html-webpack-plugin inject automatically scripts and styles and with mini-html-webpack-plugin we need to do this manually. To avoid a page without any script, just add this lines of code on your custom index.html:

<!DOCTYPE html>
+<html lang="{{ lang }}">
-<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="description" content="{{ description }}">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>{{ title }}</title>
+   {{ head }}
  </head>
  <body>
    <div id="root" />
+   {{ footer }}
  </body>
</html>

📺  Allow users to edit the playground examples

🔗  Automatic Github Link

Now, if you have a repository field on your package.json, docz you add a github link to your repo on the docz-theme-default:

📌  Custom head tags

With mini-html-webpack-plugin now you can add custom head tags without need to use a custom index.html file. The new htmlContext property on doczrc.js gives you the ability to add this tags:

// doczrc.js
export default {
  htmlContext: {
    head: {
      links: [{
        rel: 'stylesheet',
        href: '/some/style/custom.css'
      }]
    }
  }
}

⏳  Fetch data on documents

Now you can fetch data on documents just by exporting an async method called getInitialData, then you can use document data property inside your componentes, like that:

import { MyComponent } from './MyComponent'

export const getInitialData = async () => {
  return {
    myProp: await someAsyncMethod()
  }
}

# My Component

This is just markdown

<MyComponent loading={props.data.loading} prop={props.data.myProp} />

🔖 Resolve markdown files by default

In the new version of docz you can import markdown files inside your mdx:

import Readme from './readme.md'

# My Component

<Readme />

So, if you want to resolve markdown files by default you can change files property on your doczrc.js to parse markdown extensions together with mdx, this will result in markdown files automatically parsed and routes generated by this file like we do with mdx:

// doczrc.js
export default {
  files: '**/*.{md,markdown,mdx}'
}

v0.9.6

06 Aug 19:52
Compare
Choose a tag to compare

Changelog

🐞&bsp; Bug Fixes

  • docz-core: remove @babel/runtime alias (0dbd8f0)
  • docz-theme-default: using lodash.get to prevent classname crash (befc643)