Skip to content
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

Update dependencies to allow build for all packages to pass #566

Merged
merged 4 commits into from
May 6, 2024

Conversation

kvnlam
Copy link
Contributor

@kvnlam kvnlam commented May 3, 2024

Summary / Background
There were issues when attempting to publish the next branch. These were mostly due to outdated dependencies that conflicted with a recent change to get our Chevron and handleRichTextBoxKeyEventNavigation packages to use an updated version of quip-apps-webpack-config.

kvnlam added 4 commits May 3, 2024 14:30
- Upgrade Webpack related dependencies because they're conflicting with the projects in `packages`
- Run `npm install` using Node 20 to update the `package-lock.json` format
- Make `readFile` synchronous since this part seems to be flaky when running tests
- Update CSS plugin variable name to match new dependency name
- Use Node 20 instead of Node 12
- Run `npm ci` instead of `npm install` to prevent unexpected dependency changes from being installed
@kvnlam kvnlam requested a review from hao2018 May 3, 2024 22:16
Copy link
Contributor

@hao2018 hao2018 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM, left two questions. Thank you for making this change!

const mPath = dir ? path.join(dir, "manifest.json") : "manifest.json";
return String(await fs.promises.readFile(mPath, "utf-8"));
return String(fs.readFileSync(mPath, "utf-8"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about the reasons why we need to change this from sync to async.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question! i was running tests via npm test locally and noticed that the quip-cli was flaky - particularly around the parts where it would read in pre-created files to compare with the command outputs. my theory is that the test times out before it can completely (and consistently) read the files. by forcing it to be synchronous the flakiness disappeared. i ran it several times consecutively and saw 0 failures

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! Thanks for the fix!

@@ -7,13 +7,15 @@
"author": "Quip",
"main": "dist/handleRichTextBoxKeyEventNavigation.js",
"scripts": {
"build": "cross-env-shell NODE_ENV=production webpack --output-library-target umd"
"build": "cross-env-shell NODE_ENV=production webpack"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we want to remove --output-library-target umd?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so i added a newer version of webpack via the webpack-cli dependency. based on my research it seems that the --output-library-target argument has been deprecated. we already configure the output to be umd in our webpack.config.js files anyways so i didn't think it'd be an issue to remove the argument. local builds show that the files are indeed in the correct umd format and tests all pass so that gave me more confidence that the change should be safe

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks for the additional info!

@kvnlam kvnlam merged commit 50c55c0 into next May 6, 2024
8 checks passed
@kvnlam kvnlam deleted the kvnlam_peaceful-murdock branch May 6, 2024 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants