TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Node.js: Be a good dev: offer dependencies

18 点作者 leichtgewicht超过 8 年前

6 条评论

sevcsik超过 8 年前
Correct me if I'm wrong, but this would mean that I will be informed about missing dependencies RUNTIME? And I have to do that multiple times, if there are multiple 'dynamic dependencies' like this. The main reason for having declarative dependencies is to NOT be having to do that.
评论 #12428515 未加载
arik-so超过 8 年前
Isn't that the whole reason there is a package.json? That way, people just run npm install and already have all the necessary dependencies.
评论 #12428501 未加载
al2o3cr超过 8 年前
Here&#x27;s some discussion on a related idea:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;rails&#x2F;rails&#x2F;commit&#x2F;2dfff4d31634d669f4c198c4fb85b59d39477862#comments" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rails&#x2F;rails&#x2F;commit&#x2F;2dfff4d31634d669f4c198...</a><p>In that case, the &quot;offered&quot; dependency was on the mysql2 gem. The intent was similar (don&#x27;t want to force users of ActiveRecord to install DB adapters they don&#x27;t use) but ran into an unexpected situation when the generated Gemfile entry didn&#x27;t have a version constraint but the runtime-loading code <i>did</i>.
easong超过 8 年前
Honestly, this sounds like a big step backwards in UX if implemented widely.<p>I would really rather not have to manually install a million packages when pulling down dependencies - &quot;npm install &amp;&amp; npm start&quot; and then going to grab a glass of water feels great.<p>The given use case of a master parsing library doesn&#x27;t really resonate. A handful of extra kb on disk doesn&#x27;t bother me at all for an all-in-one solution, and I&#x27;ve never really had the problem of not being able to find a parsing library on npm to begin with.
评论 #12428547 未加载
joesb超过 8 年前
He said that approach &quot;d&quot; (implement every implementation) has the problem that &quot;It will take a lot of time to implement all configuration files properly&quot;.<p>Somehow that problem disappears when using his approach, and I think that&#x27;s even bigger problem than the download size of the dependencies.
vsenko超过 8 年前
I&#x27;m not shure that it is a good idea to create (and use) such packages as &#x27;parse-any-structed-file&#x27;. If you know what you need, then you can use an optimized implementation.
评论 #12428580 未加载