TypeCellOS / TypeCell

https://www.typecell.org
GNU Affero General Public License v3.0
417 stars 27 forks source link

Specifying npm version breaks types #378

Open tennox opened 9 months ago

tennox commented 9 months ago

Normal import - working types: Screenshot from 2023-12-18 17-54-52

I was happy to see selecting a specific npm package version works, but it shows an error & doesn't load types: Screenshot from 2023-12-18 17-55-55

Tried different variations:

import { create } from "canvas-confetti@1.9.0";
import { create } from "https://esm.run/canvas-confetti@1.9.0";

Example notebook

tennox commented 9 months ago

While we're at it, I'm thinking if there could be a nice way to globally import things, because currently you have to either:

  1. import in every cell
  2. import in top cell, but use $. to access imports
  3. import in top cell, and const { helper } = $

While 1. is too verbose, it's the only option to have code in notebooks copyable into a different IDE

YousefED commented 8 months ago

Agree it would be great to add support for this!