Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feat/#210 auto install deps when creating a new ts srcbook #210#342

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Aswanth-c wants to merge7 commits intosrcbookdev:main
base:main
Choose a base branch
Loading
fromAswanth-c:feat/#210-Auto-install-deps-when-creating-a-new-TS-Srcbook-#210

Conversation

Aswanth-c
Copy link
Contributor

@Aswanth-cAswanth-c commentedOct 9, 2024
edited
Loading

FixedIssue #210

Changes

  • Added a toggle button for auto-installing dependencies.
  • AddedAutoInstallation field in database
  • Ran database migrations.
  • Added a conditional check and automatic installation oftsx,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 pressesRun

"idx": 11,
"version": "6",
"when": 1728457840317,
"tag": "0011_apps_external_id_unique",
Copy link
Contributor

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?

Copy link
ContributorAuthor

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 migration0011_apps_external_id_unique.sql are missing while the migration is present.

}
setInitialInstallAttempt(true);
};
setTimeout(() => handleAutoInstallation(), 1500);
Copy link
Contributor

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?

@BeRecursive22
Copy link
Contributor

BeRecursive22 commentedOct 14, 2024
edited
Loading

@nichochar@Aswanth-c

I have observed that if you add cell:format after creating cell:create, the deps are automatically installed. I was wondering why we didn't go with option?

image

There might be some edge cases...I haven't considered.

@nichochar
Copy link
Contributor

Actually, that's the kind of option I was assuming.

Trigger cell:create, and then on callback once things are created, call adeps:install event (we shouldn't use cell:format for this as it's semantically a bit weird)

useEffect(() => {
const handleAutoInstallation = () => {
if (autoInstallDependencies) {
npmInstall();
Copy link
Contributor

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 calleddeps: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.

Copy link
ContributorAuthor

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 executesdeps:install under the hood,
isn't it better to call npmInstall(); function? as it does more checks and error handling

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nichocharnichocharnichochar left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Auto-install deps when creating a new TS Srcbook
3 participants
@Aswanth-c@BeRecursive22@nichochar

[8]ページ先頭

©2009-2025 Movatter.jp