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

Remove process dependency #757

Merged
merged 7 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 25 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
{
"private": true,
"description": "HASH monorepo",
"workspaces": [
"packages/blocks/*",
"packages/engine/apache-arrow-js-bundle",
"packages/hash/api",
"packages/hash/backend-utils",
"packages/hash/datastore",
"packages/hash/design-system",
"packages/hash/eslint-config",
"packages/hash/frontend",
"packages/hash/integration",
"packages/hash/playwright",
"packages/hash/realtime",
"packages/hash/search-loader",
"packages/hash/shared",
"packages/hash/task-executor",
"packages/hash/tsconfig",
"sites/hashai",
"sites/hashdev"
],
"workspaces": {
"packages": [
"packages/blocks/*",
"packages/engine/apache-arrow-js-bundle",
"packages/hash/api",
"packages/hash/backend-utils",
"packages/hash/datastore",
"packages/hash/design-system",
"packages/hash/eslint-config",
"packages/hash/frontend",
"packages/hash/integration",
"packages/hash/playwright",
"packages/hash/realtime",
"packages/hash/search-loader",
"packages/hash/shared",
"packages/hash/task-executor",
"packages/hash/tsconfig",
"sites/hashai",
"sites/hashdev"
],
"nohoist": [
"**/ts-invariant"
]
Comment on lines +24 to +26
Copy link
Contributor Author

@kachkaev kachkaev Jul 6, 2022

Choose a reason for hiding this comment

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

The new configuration of dependencies and sub-dependencies provided @apollo/client with a wrong version of ts-invariant, which caused the crash. Removing nohoist will be possible after upgrading @apollo/client and apollo-server-express and thus avoid mutually incompatible ts-invariant sub-dependencies. This will be done in #757.

Some detail on the issue: apollographql/apollo-client#9094 (comment)

},
"scripts": {
"codegen": "yarn workspace @hashintel/hash-api codegen && yarn workspace @hashintel/hash-frontend codegen && yarn workspace @hashintel/hash-integration codegen && yarn workspace @hashintel/hash-shared codegen",
"dev": "concurrently \"yarn:dev:backend\" \"yarn:dev:frontend\"",
Expand Down Expand Up @@ -65,7 +70,7 @@
"node-fetch": "^2.6.7"
},
"devDependencies": {
"check-dependency-version-consistency": "2.0.0",
"check-dependency-version-consistency": "3.0.0",
Copy link
Contributor Author

@kachkaev kachkaev Jul 6, 2022

Choose a reason for hiding this comment

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

"concurrently": "7.0.0",
"cross-env": "7.0.3",
"dotenv-flow": "3.2.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/hash/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"@mui/material": "5.4.3",
"@rjsf/core": "4.1.1",
"@rjsf/material-ui": "4.1.1",
"@sentry/nextjs": "6.17.9",
"@sentry/nextjs": "7.5.1",
"@sentry/react": "7.5.1",
"@svgr/webpack": "6.2.1",
"@twind/next": "1.0.9",
"ajv": "8.11.0",
Expand All @@ -49,10 +50,9 @@
"jsonschema": "1.4.0",
"lodash": "4.17.21",
"material-ui-popup-state": "2.0.0",
"next": "12.1.0",
"next": "12.2.0",
"next-transpile-modules": "9.0.0",
"pluralize": "8.0.0",
"process": "0.11.10",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🧹

"prosemirror-collab": "1.2.2",
"prosemirror-commands": "1.2.1",
"prosemirror-dev-tools": "3.1.0",
Expand Down Expand Up @@ -82,7 +82,7 @@
"@graphql-codegen/fragment-matcher": "2.0.1",
"@graphql-codegen/typescript": "1.22.1",
"@graphql-codegen/typescript-operations": "1.18.0",
"@next/bundle-analyzer": "12.1.0",
"@next/bundle-analyzer": "12.2.0",
"@testing-library/dom": "8.14.0",
"@testing-library/jest-dom": "5.16.4",
"@testing-library/react": "12.1.5",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { FallbackRender } from "@sentry/react/dist/errorboundary";
import type { FallbackRender } from "@sentry/react";
import React from "react";
import { tw } from "twind";
import { Button } from "../../shared/ui";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Sentry from "@sentry/nextjs";
import * as Sentry from "@sentry/react";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FramedBlock.tsx is bundled via this setting in next.config.json:

          new HtmlWebpackPlugin({
            filename: "static/sandbox.html",
            template: path.join(__dirname, framedBlockFolder, "index.html"),
            chunks: ["sandbox"],
          }),

This is a non-conventional way of bundling Next.js. Looks like a separate entry point affects webpack features in a custom bundle and it’s impossible to use process.env.SOMETHING in it. Replacing @sentry/nextjs with @sentry/react (which is a sub-dependency of @sentry/nextjs) resolve the issue. It also avoids similar errors like unable to import "fs". This may be to do with the less advanced tree-shaking in a custom bundle.

Copy link
Contributor

Choose a reason for hiding this comment

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

Are there Nextjs-specific features we miss out on when switching to @sentry/react?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hard to say, but because FramedBlock is separate and bespoke webpack bundle, not sure we can restore them if we import from @sentry/next

import {
BlockProtocolAggregateEntitiesFunction,
BlockProtocolAggregateEntityTypesFunction,
Expand Down
2 changes: 1 addition & 1 deletion packages/hash/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"dependencies": {
"@apollo/client": "3.3.21",
"@sentry/browser": "6.14.1",
"@sentry/browser": "7.5.1",
"blockprotocol": "0.0.10",
"graphql-tag": "2.12.5",
"immer": "9.0.6",
Expand Down
2 changes: 1 addition & 1 deletion sites/hashdev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"image-size": "1.0.1",
"md5": "2.3.0",
"mock-block-dock": "0.0.15",
"next": "12.1.0",
"next": "12.2.0",
"next-mdx-remote": "4.0.2",
"prism": "4.1.2",
"prismjs": "1.28.0",
Expand Down
Loading