Skip to content

Releases: souporserious/renoun

[email protected]

14 Oct 09:29
11cb7ce
Compare
Choose a tag to compare

Major Changes

  • 0e6279a: Removes the deprecated collection function.

    Breaking Changes

    The collection function has been removed. You can now use the Collection class directly to create a collection:

    import { Collection } from 'renoun/collections'
    
    const posts = new Collection({
      filePattern: 'posts/*.mdx',
    })

Minor Changes

  • ebdfb16: Adds getFileSystemPath method to FileSystemSource and ExportSource to allow getting types for a file in APIReference.

  • 489960a: Adds the ability to specify the set of languages loaded for syntax highlighting using the languages field in the renoun.json configuration file. This allows you to reduce the bundle size by only loading the languages you need:

    {
      "languages": ["sh", "ts", "tsx"]
    }
  • ed8fb6a: Adds support for formatting the CodeBlock component source text using prettier if it is available to the workspace.

Patch Changes

  • cab837b: Fixes issue with trying to format dynamic imports added to collections from CLI causing issues with linters. Now, formatting will only occur if the workspace has access to prettier.

[email protected]

12 Oct 22:56
617e9d6
Compare
Choose a tag to compare

Minor Changes

  • 555815e: Adds a cache to the <ExportSource>.getType method to prevent unnecessary processing of types since this is an expensive operation. Types will now only be resolved the first time they are requested and then cached for subsequent requests unless one of the file dependencies has changed.

Patch Changes

  • c8760f7: Runs initial script to write collections in parallel when starting the dev server. This needed to run synchronously in a previous implementation.
  • d6c374b: Handles CLI sub-process clean up better if an error in the WebSocket server occurs.

[email protected]

11 Oct 23:09
252c9cf
Compare
Choose a tag to compare

Minor Changes

  • f37e6e1: Adds support for analyzing generic parameters.
  • 09e4efd: Adds initial support for analyzing class member decorators.

Patch Changes

  • 72697ee: Makes sure to update Collection new expressions with the related dynamic import.
  • 00d64e2: Improves errors that can occur during type resolution.
  • 9c86e10: Fixes collection exports generic parameter to not be overconstrained.

[email protected]

10 Oct 22:42
792273e
Compare
Choose a tag to compare

Minor Changes

  • 6a74c71: Deprecates the collection utility in favor of using the Collection class directly:

    -- import { collection } from 'renoun/collections'
    ++ import { Collection } from 'renoun/collections'
    
    -- export const PostsCollection = collection({
    ++ export const PostsCollection = new Collection({
      filePattern: 'posts/*.mdx',
      baseDirectory: 'posts',
      basePath: 'posts',
    })
  • ad250de: Introduces a new CompositeCollection class. This allows grouping a set of collections to treat them as a single collection:

    import { Collection, CompositeCollection } from 'renoun/collections'
    
    const CollectionsCollection = new Collection({
      filePattern: 'src/collections/index.tsx',
      baseDirectory: 'collections',
    })
    
    const ComponentsCollection = new Collection({
      filePattern: 'src/components/**/*.{ts,tsx}',
      baseDirectory: 'components',
    })
    
    const AllCollections = new CompositeCollection(
      CollectionsCollection,
      ComponentsCollection
    )

    When getting a source from a composite collection, the <FileSystemSource>.getSiblings method will account for all collections in the composite collection:

    const source = AllCollections.getSource('collections/index')!
    
    const [previousSource, nextSource] = await source.getSiblings()

    A new <Collection>.hasSource type guard is also available to help constrain the type of the source when working with composite collections:

    if (ComponentsCollection.hasSource(nextSource)) {
      // nextSource is now typed as a ComponentsCollection source
    }
  • f499a2b: Adds support to <ExportSource>.getType() for capturing API references that use index types.

  • 8822ce6: Adds an initial highlight animation of all symbols when the pointer enters the CodeBlock.

  • fc1e9a6: Adds support for passing a file path to the APIReference.source prop:

    import { APIReference } from 'renoun/components'
    
    export function FilePath() {
      return (
        <APIReference
          source="./GitProvider.tsx"
          workingDirectory={import.meta.url}
        />
      )
    }

Patch Changes

  • 53ad975: Moves image mask to code element when using CodeBlock.focusedLines prop to prevent dimming the border and copy button.

  • c35be54: Fixes CLI errors not bubbling correctly during local development.

  • 508d086: This update resolves several issues with API references, particularly recursion bugs in the internal resolveType utility. The key changes involve an updated algorithm for computing component types, which affects the following case:

    • Named functions with a capitalized first letter and a single non-object argument are now interpreted as components when they should be functions. This is an unintended behavior change and will be corrected in an upcoming update.

    Type References

    Type references are now split into two maps that serve the following use cases:

    • Prevent Infinite Recursion: A map of type references is maintained during type iteration of the root type to prevent infinite recursion.
    • Optimized Type Handling for Exported Declarations:
      • Adds an explicit map for tracking exported declarations to avoid type duplication.
      • Improves performance and establishes a link between types.
  • a8b77df: Updates renoun/assets with the latest logos.

  • fc2cc02: Allows CodeInline to stretch by anchoring the CopyButton to the end.

  • 2e75254: Adds better error messaging with actions to take when CodeBlock or CodeInline has diagnostic errors.

[email protected]

03 Oct 08:02
28c5f36
Compare
Choose a tag to compare

Minor Changes

  • 6fc89d2: Adds filter prop to APIReference component.
  • d6cdba2: Adds declaration file path to symbol metadata for use when filtering API references.

Patch Changes

  • a753254: Fixes filtered types being treated as reference types when generating API references.

[email protected]

02 Oct 08:30
4fb5067
Compare
Choose a tag to compare

Minor Changes

  • 7b6dc4a: Moves type reference resolution to the renoun cli process. This offers a few benefits:

    • Faster page loads in development where the APIReference component is used since it now utilizes a Suspense boundary
    • Cross-references between types are now supported which will allow linking type references across pages

Patch Changes

  • 6b321e3: Fixes excessive CodeBlock vertical scroll area on mobile Safari.
  • dd1db4c: Improve readability for WebSocket params in error messages.
  • ca95e54: Adds named functions to web socket methods for better debuggability.

[email protected]

30 Sep 08:10
f40be7a
Compare
Choose a tag to compare

Major Changes

  • 1c4c390: Moves MDXContent and MDXComponents type exports to @renoun/mdx package.

  • 5fa1a9e: Renames createCollection to collection.

    Breaking Changes

    Replace all instances of createCollection with collection:

    -import { createCollection } from 'renoun/collections'
    +import { collection } from 'renoun/collections'
    
    -const PostsCollection = createCollection({
    +const PostsCollection = collection({
      filePattern: 'posts/*.mdx',
    })
  • f5ecc15: Removes getDefaultExport and getNamedExport from collection export sources in favor of a new getExport method. This method works exactly the same as the previous getNamedExport method with the addition of accepting default as an export. This simplifies the API and reduces the number of methods needed to query an export source.

    Breaking Changes

    Update any usage of getDefaultExport and getNamedExport to use the new getExport method:

    • getDefaultExport() -> getExport('default')
    • getNamedExport('metadata') -> getExport('metadata')

Minor Changes

  • 5cdff4d: Adds @renoun/mdx to core renoun package as a renoun/mdx export. The @renoun/mdx package was initially split off to make maintenance easier. Since renoun is catering to content authoring, the MDX features should be as easy as possible to use.

Patch Changes

  • 482e1e4: Fixes fast refresh when using a custom JSX pragma.
  • 78080ed: Fixes fast refresh for collections targeting files outside of workspace.
  • abca1f8: Fixes package manager tab panel layout shift on page load.
  • 7e58c6d: Adds better error handling to internal CLI WebSocketClient.
  • 5da3781: Fixes watch command running during deployments.
  • Updated dependencies [1c4c390]
  • Updated dependencies [b9d52a3]

@renoun/[email protected]

30 Sep 08:10
f40be7a
Compare
Choose a tag to compare

Minor Changes

  • 1c4c390: Moves MDXContent and MDXComponents type exports to @renoun/mdx package.
  • b9d52a3: More descriptive name for remark paragraphs plugin, removeParagraphs -> removeImmediateParagraphs.

[email protected]

25 Sep 05:58
9c57054
Compare
Choose a tag to compare

Minor Changes

  • ff7665e: Moves import map generation from the .renoun directory to the second argument of the createCollection call expression. This will automatically be updated to the new filePattern argument and generate the import getter for each collection:

    import { createCollection } from 'renoun/collections'
    
    export const DocsCollection = createCollection(
      {
        filePattern: 'docs/**/*.mdx',
        baseDirectory: 'docs',
        basePath: 'docs',
      },
      (slug) => import(`docs/${slug}.mdx`)
    )

    This reduces a lot of boilerplate and configuration. Previously, the .renoun directory needed to be generated, added to .gitignore, and then the server needed to be restarted after the first initialization. Now, import maps are colocated with their respective collection configuration.

  • a484f7e: Adds support for Vite by utilizing the package.json imports field when the workspace is a module.

Patch Changes

  • 2f4837b: Prevents error when tsconfig exclude field is not defined.
  • d49606d: Adds baseUrl field if it does not exist when code-modding tsconfig to add the path alias.
  • 46e463f: Fixes PackageInstall component warning showing when not being used.
  • 8621338: Uses CJS compatible imports to fix bundlers like Vite that will end up with undefined imports.

[email protected]

22 Sep 05:49
497c986
Compare
Choose a tag to compare

Minor Changes

  • 2d64da1: Adds a PackageInstall component for displaying a list of package manager install commands that can be copied.

Patch Changes

  • 2ad1db1: Removes unused createCollection title and label options.
  • 779df0a: Adds better error when trying to create a collection within a route group file pattern that needs to be escaped properly.
  • 170d382: Fixes error when collection baseDirectory does not have any additional segments after normalizing file paths.