Skip to content

v0.1.9

Choose a tag to compare

@ZtaMDev ZtaMDev released this 10 Jan 04:41
· 14 commits to main since this release

Release Notes - v0.1.9

round-core v0.1.9

Routing and DX improvements focused on 404 handling, scroll behavior, and better integration with the markdown companion package.

New Features

  • Per-route scroll restoration: The router now stores scroll positions per pathname.
    • When you navigate away from a page, its scroll offset is saved.
    • When you come back (via links or browser back/forward), the scroll is restored to where you left it.
    • Different routes no longer "share" or drag scroll position between each other.
  • Faster 404 detection: getIsNotFound() and useIsNotFound() now react immediately to the latest match flag.
    • Eliminates the visible flicker where a large 404 component lagged one frame behind navigation.
    • Custom NotFound UIs feel snappier in large apps.

Vite note: After upgrading to round-core@0.1.9 (and the markdown companion), clear Vite's prebundle cache by deleting node_modules/.vite in your app before restarting the dev server. This avoids stale code from previous versions.

Ecosystem: @round-core/markdown v0.1.1

This release syncs the core with the new markdown companion package and documents how it fits into the RoundJS stack.

  • New package: @round-core/markdown
    • A small, focused markdown renderer built on top of round-core.
    • Uses marked@17 for parsing and shiki for syntax highlighting.
    • Ships rich code blocks with language header, copy button and theming support.
  • Correct inline markdown rendering:
    • Relies on the default marked renderers for headings, paragraphs, lists, blockquotes and links.
    • Avoids [object Object] issues caused by feeding raw token objects into custom renderers.
  • Code block UI:
    • Custom renderer only for fenced code blocks to add a header, language label and an optional copy-to-clipboard button.
    • Highlighting is applied asynchronously so the first paint is fast and the UI stays responsive.
  • Shiki language support:
    • Loads an explicit set of common languages by default: javascript, typescript, jsx, tsx, json, css, html, bash, markdown, yaml, toml, python, rust, go, java, c, cpp, csharp, php, ruby, swift, kotlin, dart, lua, sql, and more.
  • Theming and styling:
    • The <Markdown /> component exposes an options.theme object to control background, text, and accent colors.
    • Colors are applied via CSS variables on the root .round-md container so they can be overridden per-page or globally.
    • Exported defaultMarkdownStyles gives you stable class names for headings, paragraphs, lists, links, inline code and code blocks.

Installation & Usage

Install the markdown package alongside round-core:

npm install round-core @round-core/markdown

or with Bun:

bun add round-core @round-core/markdown

Basic usage in a Round app:

import { Markdown, defaultMarkdownStyles } from '@round-core/markdown';

export default function DocsPage() {
  const content = `# Hello RoundJS\n\nHere is some **markdown** with \\`code\\` and a list:`;

  return (
    <div className={defaultMarkdownStyles.rootClass}>
      <Markdown content={content} />
    </div>
  );
}

You can also enable faster first highlight by preloading Shiki:

<Markdown
  src="./docs/getting-started.md"
  options={{
    preloadHighlighter: true,
    theme: {
      markdownBackground: '#050816',
      markdownText: '#E5E7EB',
      primaryColor: '#38BDF8',
      secondaryColor: '#A855F7'
    }
  }}
/>;