duckdb-wasm icon indicating copy to clipboard operation
duckdb-wasm copied to clipboard

Compile npm modules to JavaScript

Open multimeric opened this issue 2 years ago • 3 comments

It seems that the @duckdb/react-duckdb* npm packages contain raw typescript source code, which is fairly unusual. It means that consumers of the packages need to enable the typescript loader for node_modules, which is quite computationally expensive.

You can see this here on npm:

  • https://www.npmjs.com/package/@duckdb/react-duckdb?activeTab=explore
  • https://www.npmjs.com/package/@duckdb/react-duckdb-table?activeTab=explore

Interestingly, the @duckdb/duckdb-wasm* packages are correctly compiled to JS. Could you please pre-compile these packages to standard JavaScript in future versions? Thanks.

multimeric avatar Feb 11 '23 12:02 multimeric

These packages aren't really intended for public consumption, and I'm surprised they're being published to npm. I assume that's why they're a bit odd?

Mause avatar Feb 14 '23 07:02 Mause

Probably, but I do think they're useful packages to have on npm.

multimeric avatar Feb 14 '23 07:02 multimeric

I second the point that @duckdb/react-duckdb would be useful to have on NPM in their compiled form. The implementation looks very clean, minimal, and generic.

Otherwise, any user who wants to use DuckDB in a React application will end-up re-implementing the wheel in order to instantiate the database and access it from within sub-components.

keller-mark avatar Mar 22 '24 20:03 keller-mark