-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/#210 auto install deps when creating a new ts srcbook #210 #342
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
AutoInstallation
field in databasetsx
,typescript
, and@types/node
upon 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