kobalte icon indicating copy to clipboard operation
kobalte copied to clipboard

fix: include the source in the packages

Open aminya opened this issue 1 year ago • 2 comments

This has several benefits:

  • Allows directly importing the source files, that could resolve the issues with server-side rendering with various build systems
  • Can result in more optimized code as the source file is directly built by the build tool (better tree shaking or more modern syntax)
  • Compatibility with new package registries such as JSR that prefer TypeScript over JavaScript
  • In security conscious environments, the source files can be checked against GitHub and then used directly.

aminya avatar May 05 '24 06:05 aminya

Deploy Preview for kobalte ready!

Name Link
Latest commit b96dd4db0d0e925abaddf7c8b3b3b9d57ed32b6f
Latest deploy log https://app.netlify.com/sites/kobalte/deploys/663722dd2f482c0008055fd0
Deploy Preview https://deploy-preview-408--kobalte.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 site configuration.

netlify[bot] avatar May 05 '24 06:05 netlify[bot]

I'm not super familiar with source exports, but for @kobalte/core would this be more optimized to avoid barrel files (which will be removed at some point) in favor of separated exports:

"exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "solid": "./dist/index.jsx",
      "default": "./dist/index.js"
    },
    "./*": {
      "types": "./dist/*/index.d.ts",
      "solid": "./dist/*/index.jsx",
+     "source": "./src/*/index.tsx", // or "source": "./src/*" ?
      "default": "./dist/*/index.js"
    }
  },

jer3m01 avatar May 07 '24 22:05 jer3m01

The import map change allows importing the source files. The top-level source entry is for some bundlers like Parcel that prefer the source files over the built files.

aminya avatar May 25 '24 04:05 aminya

Thanks for the PR!

jer3m01 avatar Jun 18 '24 16:06 jer3m01