Feat/#210 auto install deps when creating a new ts srcbook #210#342
Conversation
…nd run migrations
…reating-a-new-TS-Srcbook-srcbookdev#210
…reating-a-new-TS-Srcbook-srcbookdev#210
| "idx": 11, | ||
| "version": "6", | ||
| "when": 1728457840317, | ||
| "tag": "0011_apps_external_id_unique", |
There was a problem hiding this comment.
Hmm I wonder if this is a rebase issue, but I expect only one entry in the journal for this PR. Maybe we need to rebase and rerun the migration?
There was a problem hiding this comment.
On the main branch, the journal entry and snapshot for the 11th migration 0011_apps_external_id_unique.sql are missing while the migration is present.
| } | ||
| setInitialInstallAttempt(true); | ||
| }; | ||
| setTimeout(() => handleAutoInstallation(), 1500); |
There was a problem hiding this comment.
Why is there a timeout set here?
|
Actually, that's the kind of option I was assuming. Trigger cell:create, and then on callback once things are created, call a |
| useEffect(() => { | ||
| const handleAutoInstallation = () => { | ||
| if (autoInstallDependencies) { | ||
| npmInstall(); |
There was a problem hiding this comment.
As @BeRecursive22 commented, we have an event we can send up called deps:install rather than re-implement the logic here.
This works but for consistency of how we interface with the server, it might be better to dispatch the websocket event. cc @benjreinhart might have an opinion.
There was a problem hiding this comment.
I agree that it's a better option to install packages once the code cell is created rather than when the component mounts; I will change that.
npmInstall();. function executes deps:install under the hood,
isn't it better to call npmInstall(); function? as it does more checks and error handling

Fixed Issue #210
Changes
AutoInstallationfield in databasetsx,typescript, and@types/nodeupon TypeScript Srcbook creation.Question:
Currently, the packages are installed automatically only upon the creation of a Srcbook. I was not sure if it was a design choice to require the user to press the install button for npm packages, so I have left it as is. if needed. I can change it to automatically install when the user presses Run