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 package.json #104

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"url": "https://github.com/fastify/fast-uri/issues"
},
"homepage": "https://github.com/fastify/fast-uri",
"sideEffects": false,
Copy link
Member

Choose a reason for hiding this comment

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

What is this? How is this used by the project?

Copy link
Member

Choose a reason for hiding this comment

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

Brave Search:

In a package.json file, sideEffects is a property that indicates whether a package has side effects or not. A side effect occurs when a module’s execution affects something outside its own scope, such as:

Modifying the global scope (e.g., adding properties to the window object).
Throwing errors or exceptions.
Logging messages to the console.
Making network requests or I/O operations.

Why is sideEffects important?

When a bundler like Webpack or Rollup builds a bundle, it uses the sideEffects property to determine which modules can be safely removed or “tree-shaken” from the bundle. This optimization helps reduce the bundle size and improves performance.

I don't know if we support these non-official properties though

Copy link
Member

Choose a reason for hiding this comment

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

  1. https://wiki.commonjs.org/wiki/Packages/1.0
  2. https://docs.npmjs.com/cli/v10/configuring-npm/package-json?v=true

In general, if it isn't documented in one of those places, and doesn't have a direct use by the project itself (e.g. a precommit field used by @fastify/pre-commit), I don't think unexplained properties should be added to the package manifest. If it requires searching the Internet to figure out its purpose, it is an unmaintainable property contributing nothing other than mystery to the project.

Copy link
Member

Choose a reason for hiding this comment

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

I agree with this in principle

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

None of which are used by this project.

"scripts": {
"bench": "node benchmark.js",
"lint": "standard | snazzy",
Expand Down
Loading