Releases: souporserious/renoun
[email protected]
Major Changes
-
0e6279a: Removes the deprecated
collection
function.Breaking Changes
The
collection
function has been removed. You can now use theCollection
class directly to create a collection:import { Collection } from 'renoun/collections' const posts = new Collection({ filePattern: 'posts/*.mdx', })
Minor Changes
-
ebdfb16: Adds
getFileSystemPath
method toFileSystemSource
andExportSource
to allow getting types for a file inAPIReference
. -
489960a: Adds the ability to specify the set of languages loaded for syntax highlighting using the
languages
field in therenoun.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 usingprettier
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]
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
[email protected]
[email protected]
Minor Changes
-
6a74c71: Deprecates the
collection
utility in favor of using theCollection
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 theCopyButton
to the end. -
2e75254: Adds better error messaging with actions to take when
CodeBlock
orCodeInline
has diagnostic errors.
[email protected]
[email protected]
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 aSuspense
boundary - Cross-references between types are now supported which will allow linking type references across pages
- Faster page loads in development where the
Patch Changes
[email protected]
Major Changes
-
1c4c390: Moves
MDXContent
andMDXComponents
type exports to@renoun/mdx
package. -
5fa1a9e: Renames
createCollection
tocollection
.Breaking Changes
Replace all instances of
createCollection
withcollection
:-import { createCollection } from 'renoun/collections' +import { collection } from 'renoun/collections' -const PostsCollection = createCollection({ +const PostsCollection = collection({ filePattern: 'posts/*.mdx', })
-
f5ecc15: Removes
getDefaultExport
andgetNamedExport
from collection export sources in favor of a newgetExport
method. This method works exactly the same as the previousgetNamedExport
method with the addition of acceptingdefault
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
andgetNamedExport
to use the newgetExport
method:getDefaultExport()
->getExport('default')
getNamedExport('metadata')
->getExport('metadata')
Minor Changes
- 5cdff4d: Adds
@renoun/mdx
to corerenoun
package as arenoun/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]
@renoun/[email protected]
[email protected]
Minor Changes
-
ff7665e: Moves import map generation from the
.renoun
directory to the second argument of thecreateCollection
call expression. This will automatically be updated to the newfilePattern
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]
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
andlabel
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.