Skip to content

Conversation

Copy link

Copilot AI commented Nov 11, 2025

The library was missing 21 package.json exports and lacked documentation on optimal import patterns for tree-shaking.

Changes

Package Exports

  • Added 11 missing component exports (collapsible, container, contextmenu, divider, icon, image, layer, link, root, tree, virtual)
  • Added 5 missing atoms subpath exports (breadcrumb/atoms, collapsible/atoms, contextmenu/atoms, layer/atoms, tree/atoms)
  • Added 5 missing subcomponent exports (datagrid/td, datagrid/th, datagrid/tr, dropdown/item, portal/portals)
  • Sorted all 83 exports alphabetically

Source Fixes

  • Created missing index.ts files for incomplete components
  • Populated empty atoms.ts file for contextmenu
  • Removed duplicate list export from components barrel

Documentation

  • Added comprehensive tree-shaking guide at docs/TREE_SHAKING.md
  • Added tree-shaking section to README.md

Import Pattern

Consumers should use subpath imports for optimal tree-shaking:

// Recommended - only bundles what you use
import { Button } from '@svelte-atoms/core/button';
import { Card } from '@svelte-atoms/core/card';

// Avoid - may bundle more than needed
import { Button, Card } from '@svelte-atoms/core';

The package is configured with sideEffects: ["**/*.css"] to enable aggressive tree-shaking. All components are now accessible via 83 subpath exports.

Original prompt

analyze the current imports and expors and provide a refactoring plan for improving tree-shacking process


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@netlify
Copy link

netlify bot commented Nov 11, 2025

Deploy Preview for statuesque-boba-0fb888 ready!

Name Link
🔨 Latest commit 002e353
🔍 Latest deploy log https://app.netlify.com/projects/statuesque-boba-0fb888/deploys/691322da8313190008b75761
😎 Deploy Preview https://deploy-preview-21--statuesque-boba-0fb888.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI and others added 4 commits November 11, 2025 11:40
Co-authored-by: ryu-man <25468773+ryu-man@users.noreply.github.com>
Co-authored-by: ryu-man <25468773+ryu-man@users.noreply.github.com>
Co-authored-by: ryu-man <25468773+ryu-man@users.noreply.github.com>
Co-authored-by: ryu-man <25468773+ryu-man@users.noreply.github.com>
Copilot AI changed the title [WIP] Analyze imports and exports for improved tree-shaking Add missing package exports and tree-shaking documentation Nov 11, 2025
Copilot AI requested a review from ryu-man November 11, 2025 11:53
Copilot finished work on behalf of ryu-man November 11, 2025 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants