helloadhavan/github_issues huggingface dataset:
Repository: vercel/next.js
Pull request: [build-sourcemaps] Ensure errors during prerender can be sourcemapped

These weren't sourcemapped because we logged the stack directly as a string. Only actual error instances will be sourcemapped not arbitrary strings.

Now we'll also include digest and `cause` in the error.

Changed files:
filename: packages/next/src/export/worker.ts
patch: @@ -19,7 +19,6 @@ import { normalizePagePath } from '../shared/lib/page-path/normalize-page-path'
 import { normalizeLocalePath } from '../shared/lib/i18n/normalize-locale-path'
 import { trace } from '../trace'
 import { setHttpClientAndAgentOptions } from '../server/setup-http-agent-env'
-import isError from '../lib/is-error'
 import { addRequestMeta } from '../server/request-meta'
 import { normalizeAppPath } from '../shared/lib/router/utils/app-paths'
 
@@ -571,12 +570,11 @@ async function exportPage(
       // A static generation bailout error is a framework signal to fail static generation but
       // and will encode a reason in the error message. If there is a message, we'll print it.
       // Otherwise there's nothing to show as we don't want to leak an error internal error stack to the user.
+      // TODO: Always log the full error. ignore-listing will take care of hiding internal stacks.
       if (isStaticGenBailoutError(err)) {
         if (err.message) {
           console.error(`Error: ${err.message}`)
         }
-      } else if (isError(err) && err.stack) {
-        console.error(err.stack)
       } else {
         console.error(err)
       }
Repository: denoland/deno
Pull request: fix(ext/node): pass content-disposition header as string instead of bytes

Closes https://github.com/denoland/deno/issues/25117

Changed files:
filename: ext/node/polyfills/http.ts
patch: @@ -906,7 +906,7 @@ class ClientRequest extends OutgoingMessage {
     // https://www.rfc-editor.org/rfc/rfc6266#section-4.3
     // Refs: https://github.com/nodejs/node/pull/46528
     if (isContentDispositionField(key) && this._contentLength) {
-      value = Buffer.from(value, "latin1");
+      value = Buffer.from(value).toString("latin1");
     }
 
     if (Array.isArray(value)) {

filename: tests/unit_node/http_test.ts
patch: @@ -1559,3 +1559,30 @@ Deno.test("[node/http] req.url equals pathname + search", async () => {
 
   await promise;
 });
+
+Deno.test("[node/http] ClientRequest content-disposition header works", async () => {
+  const payload = Buffer.from("hello world");
+  let body = "";
+  let headers = {} as http.IncomingHttpHeaders;
+  const { promise, resolve, reject } = Promise.withResolvers<void>();
+  const req = http.request("http://localhost:4545/echo_server", {
+    method: "PUT",
+    headers: {
+      "content-disposition": "attachment",
+    },
+  }, (resp) => {
+    headers = resp.headers;
+    resp.on("data", (chunk) => {
+      body += chunk;
+    });
+
+    resp.on("end", () => {
+      resolve();
+    });
+  });
+  req.once("error", (e) => reject(e));
+  req.end(payload);
+  await promise;
+  assertEquals(body, "hello world");
+  assertEquals(headers["content-disposition"], "attachment");
+});
Repository: ggml-org/llama.cpp
Pull request: Granite MoE NoPE fix

https://github.com/ggml-org/llama.cpp/pull/13269#discussion_r2088055810

This PR moves the `build_inp_pos` step to the top of the graph building for consistency with other models while still guarding it behind the `use_rope` check.

Changed files:
filename: src/llama-model.cpp
patch: @@ -12218,6 +12218,9 @@ struct llm_build_granite : public llm_graph_context {
 
         // inp_pos - built only if rope enabled
         ggml_tensor * inp_pos = nullptr;
+        if (use_rope) {
+            inp_pos = build_inp_pos();
+        }
 
         auto * inp_attn = build_attn_inp_kv_unified();
 
@@ -12260,10 +12263,6 @@ struct llm_build_granite : public llm_graph_context {
                 Vcur = ggml_reshape_3d(ctx0, Vcur, n_embd_head, n_head_kv, n_tokens);
 
                 if (use_rope) {
-
-                    if (!inp_pos) {
-                        inp_pos = build_inp_pos();
-                    }
                     ggml_tensor * rope_factors = model.get_rope_factors(n_ctx_per_seq, il);
                     Qcur = ggml_rope_ext(
                             ctx0, Qcur, inp_pos, rope_factors,
Repository: denoland/deno
Pull request: fix(fmt/markdown): metadata header sometimes missing trailing blank line

* https://github.com/dprint/dprint-plugin-markdown/pull/119

Changed files:
filename: .dprint.json
patch: @@ -67,7 +67,7 @@
   "plugins": [
     "https://plugins.dprint.dev/typescript-0.91.6.wasm",
     "https://plugins.dprint.dev/json-0.19.3.wasm",
-    "https://plugins.dprint.dev/markdown-0.17.5.wasm",
+    "https://plugins.dprint.dev/markdown-0.17.6.wasm",
     "https://plugins.dprint.dev/toml-0.6.2.wasm",
     "https://plugins.dprint.dev/exec-0.5.0.json@8d9972eee71fa1590e04873540421f3eda7674d0f1aae3d7c788615e7b7413d0",
     "https://plugins.dprint.dev/g-plane/pretty_yaml-v0.4.0.wasm"

filename: Cargo.lock
patch: @@ -2483,9 +2483,9 @@ dependencies = [
 
 [[package]]
 name = "dprint-plugin-markdown"
-version = "0.17.5"
+version = "0.17.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f1d74e1b3481450e956c35a68e0a5e795796adb13e100d19b6971b9cb531824"
+checksum = "6ef42762177b1a74b52b98fe946cb88fa4a01f149b56208de72b43d2be0a54c6"
 dependencies = [
  "anyhow",
  "dprint-core",

filename: cli/Cargo.toml
patch: @@ -102,7 +102,7 @@ dissimilar = "=1.0.4"
 dotenvy = "0.15.7"
 dprint-plugin-json = "=0.19.3"
 dprint-plugin-jupyter = "=0.1.3"
-dprint-plugin-markdown = "=0.17.5"
+dprint-plugin-markdown = "=0.17.6"
 dprint-plugin-typescript = "=0.91.6"
 env_logger = "=0.10.0"
 fancy-regex = "=0.10.0"
Repository: ggml-org/llama.cpp
Pull request: server : passthrough the /models endpoint during loading

Certain 3rd-party applications could use the information about the model currently being loaded. This change allows the `/models` and `/v1/models` endpoints to passthrough.

@ngxson Not sure if this is the correct way to do this, so suggestions are welcome.

cc @astoilkov

Changed files:
filename: tools/server/README.md
patch: @@ -1040,7 +1040,7 @@ To know the `id` of the adapter, use GET `/lora-adapters`
 
 Returns information about the loaded model. See [OpenAI Models API documentation](https://platform.openai.com/docs/api-reference/models).
 
-The returned list always has one single element.
+The returned list always has one single element. The `meta` field can be `null` (for example, while the model is still loading).
 
 By default, model `id` field is the path to model file, specified via `-m`. You can set a custom value for model `id` field via `--alias` argument. For example, `--alias gpt-4o-mini`.
 

filename: tools/server/server.cpp
patch: @@ -3707,6 +3707,9 @@ int main(int argc, char ** argv) {
             if (req.path == "/" || tmp.back() == "html") {
                 res.set_content(reinterpret_cast<const char*>(loading_html), loading_html_len, "text/html; charset=utf-8");
                 res.status = 503;
+            } else if (req.path == "/models" || req.path == "/v1/models") {
+                // allow the models endpoint to be accessed during loading
+                return true;
             } else {
                 res_error(res, format_error_response("Loading model", ERROR_TYPE_UNAVAILABLE));
             }
@@ -4365,7 +4368,13 @@ int main(int argc, char ** argv) {
         res_ok(res, {{ "prompt", std::move(data.at("prompt")) }});
     };
 
-    const auto handle_models = [&params, &ctx_server, &res_ok](const httplib::Request &, httplib::Response & res) {
+    const auto handle_models = [&params, &ctx_server, &state, &res_ok](const httplib::Request &, httplib::Response & res) {
+        server_state current_state = state.load();
+        json model_meta = nullptr;
+        if (current_state == SERVER_STATE_READY) {
+            model_meta = ctx_server.model_meta();
+        }
+
         json models = {
             {"object", "list"},
             {"data", {
@@ -4374,7 +4383,7 @@ int main(int argc, char ** argv) {
                     {"object",   "model"},
                     {"created",  std::time(0)},
                     {"owned_by", "llamacpp"},
-                    {"meta",     ctx_server.model_meta()}
+                    {"meta",     model_meta},
                 },
              }}
         };
Repository: nodejs/node
Pull request: build: fix GN build on macOS

use_gold is not defined on macOS.

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: unofficial.gni
patch: @@ -263,7 +263,7 @@ template("node_gn_build") {
           ldflags = [ "/OPT:NOICF" ]  # link.exe, but also lld-link.exe.
         } else if (is_apple && !use_lld) {
           ldflags = [ "-Wl,-no_deduplicate" ]  # ld64.
-        } else if (use_gold || use_lld) {
+        } else if ((!is_apple && use_gold) || use_lld) {
           ldflags = [ "-Wl,--icf=none" ]
         }
       }
Repository: facebook/react
Pull request: Release script prompts to stop running DEV scripts

Wouldn't want a _watch_ script to accidentally modify the contents of the build directory before we publish to NPM.

![Screen Shot 2022-03-24 at 11 20 46 AM](https://user-images.githubusercontent.com/29597/159950273-5100b076-a7e1-4358-814e-84eb8224e406.png)


Changed files:
filename: scripts/devtools/build-and-test.js
patch: @@ -21,6 +21,26 @@ const {
 async function main() {
   clear();
 
+  await confirm('Have you stopped all NPM DEV scripts?', () => {
+    const packagesPath = relative(process.cwd(), join(__dirname, 'packages'));
+
+    console.log('Stop all NPM DEV scripts in the following directories:');
+    console.log(
+      chalk.bold('  ' + join(packagesPath, 'react-devtools-core')),
+      chalk.gray('(start:backend, start:standalone)')
+    );
+    console.log(
+      chalk.bold('  ' + join(packagesPath, 'react-devtools-inline')),
+      chalk.gray('(start)')
+    );
+
+    const buildAndTestScriptPath = join(__dirname, 'build-and-test.js');
+    const pathToPrint = relative(process.cwd(), buildAndTestScriptPath);
+
+    console.log('\nThen restart this release step:');
+    console.log(chalk.bold.green('  ' + pathToPrint));
+  });
+
   await confirm('Have you run the prepare-release script?', () => {
     const prepareReleaseScriptPath = join(__dirname, 'prepare-release.js');
     const pathToPrint = relative(process.cwd(), prepareReleaseScriptPath);
Repository: vercel/next.js
Pull request: build: Fix minifier options for webpack builds

### What?

Adjust the options for the SWC minifier to disable character frequency analysis for webpack builds correctly.

### Why?

https://github.com/vercel/next.js/pull/77887 only adjusted the option for rspack.

### How?

Follow-up of https://github.com/vercel/next.js/pull/77887


Closes PACK-4498

Changed files:
filename: packages/next/src/build/webpack-config.ts
patch: @@ -1207,7 +1207,10 @@ export default async function getBaseWebpackConfig(
               // @ts-ignore No typings yet
               const { MinifyPlugin } =
                 require('./webpack/plugins/minify-webpack-plugin/src/index.js') as typeof import('./webpack/plugins/minify-webpack-plugin/src')
-              new MinifyPlugin({ noMangling }).apply(compiler)
+              new MinifyPlugin({
+                noMangling,
+                disableCharFreq: !isClient,
+              }).apply(compiler)
             },
             // Minify CSS
             (compiler: webpack.Compiler) => {

filename: packages/next/src/build/webpack/plugins/minify-webpack-plugin/src/index.ts
patch: @@ -32,7 +32,9 @@ function buildError(error: any, file: string) {
 const debugMinify = process.env.NEXT_DEBUG_MINIFY
 
 export class MinifyPlugin {
-  constructor(private options: { noMangling?: boolean }) {}
+  constructor(
+    private options: { noMangling?: boolean; disableCharFreq?: boolean }
+  ) {}
 
   async optimize(
     compiler: any,
@@ -47,7 +49,11 @@ export class MinifyPlugin {
       RawSource: typeof sources.RawSource
     }
   ) {
-    const mangle = !this.options.noMangling
+    const mangle = this.options.noMangling
+      ? false
+      : {
+          disableCharFreq: !!this.options.disableCharFreq,
+        }
     const compilationSpan =
       getCompilationSpan(compilation)! || getCompilationSpan(compiler)
Repository: facebook/react
Pull request: Add details in READMEs for react-devtools local developement

When I was trying to run `react-devtools-shell` locally, I hit some small blockers. Adding some details to the README so it's easier for next person.

Changed files:
filename: packages/react-devtools-inline/README.md
patch: @@ -348,10 +348,14 @@ To build dependencies from source, run the following command from the root of th
 yarn build-for-devtools
 ```
 ### Download from CI
-To use the latest build from CI, run the following command from the root of the repository:
+To use the latest build from CI, go to `scripts/release/` and run the following commands:
 ```sh
-./scripts/release/download-experimental-build.js
+yarn
+./download-experimental-build.js --commit=main
 ```
+
+Please note that you might need to [create a Circle CI API Token](https://circleci.com/docs/2.0/managing-api-tokens/) and set up an environment variable `CIRCLE_CI_API_TOKEN`.
+
 ## Build steps
 Once the above packages have been built or downloaded, you can watch for changes made to the source code and automatically rebuild by running:
 ```sh

filename: packages/react-devtools-shell/README.md
patch: @@ -2,11 +2,13 @@ Harness for testing local changes to the `react-devtools-inline` and `react-devt
 
 ## Development
 
-This target should be run in parallel with the `react-devtools-inline` package. The first step then is to run that target following the instructions in the [`react-devtools-inline` README](https://github.com/facebook/react/blob/main/packages/react-devtools-inline/README.md).
+This target should be run in parallel with the `react-devtools-inline` package. The first step then is to run that target following the instructions in the [`react-devtools-inline` README's local development section](https://github.com/facebook/react/tree/main/packages/react-devtools-inline#local-development).
 
 The test harness can then be run as follows:
 ```sh
 cd packages/react-devtools-shell
 
 yarn start
 ```
+
+Once you set both up, you can view the test harness with inlined devtools in browser at http://localhost:8080/
Repository: denoland/deno
Pull request: fix(ext/websocket): unhandled close rejection in WebsocketStream

Fixes https://github.com/denoland/deno/issues/25077



Changed files:
filename: ext/websocket/02_websocketstream.js
patch: @@ -323,6 +323,8 @@ class WebSocketStream {
                   } catch (_) {
                     // needed to ignore warnings & assertions
                   }
+                }, () => {
+                  // needed to ignore warnings & assertions
                 });
 
                 PromisePrototypeThen(this[_closeSent].promise, () => {
@@ -335,7 +337,6 @@ class WebSocketStream {
               cancel: async (reason) => {
                 let closeCode = null;
                 let reasonString = "";
-
                 if (
                   ObjectPrototypeIsPrototypeOf(WebSocketErrorPrototype, reason)
                 ) {
Repository: vercel/next.js
Pull request: Change stylistic ESLint TypeScript defaults

As discussed stylistic ESLint defaults should not be errors they should be warnings instead as errors from ESLint should be serious as they cause builds to fail. If users want to be more strict they can make them errors themselves.

x-ref: [slack thread](https://vercel.slack.com/archives/C088NDH88AY/p1745893026311189?thread_ts=1745871583.511739&cid=C088NDH88AY)

Changed files:
filename: packages/eslint-config-next/typescript.js
patch: @@ -1,3 +1,7 @@
 module.exports = {
   extends: ['plugin:@typescript-eslint/recommended'],
+  rules: {
+    '@typescript-eslint/no-unused-vars': 1,
+    '@typescript-eslint/no-unused-expressions': 1,
+  },
 }

filename: test/production/eslint/test/__snapshots__/next-build-and-lint.test.ts.snap
patch: @@ -509,10 +509,10 @@ exports[`Next Build production mode first time setup with TypeScript - ESLint v8
       "error",
     ],
     "@typescript-eslint/no-unused-expressions": [
-      "error",
+      1,
     ],
     "@typescript-eslint/no-unused-vars": [
-      "error",
+      1,
     ],
     "@typescript-eslint/no-wrapper-object-types": [
       "error",
@@ -767,10 +767,10 @@ exports[`Next Build production mode first time setup with TypeScript - ESLint v9
       "error",
     ],
     "@typescript-eslint/no-unused-expressions": [
-      "error",
+      1,
     ],
     "@typescript-eslint/no-unused-vars": [
-      "error",
+      1,
     ],
     "@typescript-eslint/no-wrapper-object-types": [
       "error",
Repository: vercel/next.js
Pull request: fix: broken deploy test from #77898

i messed up a deployment test thing in https://github.com/vercel/next.js/pull/77898, had the fix locally but forgot to push before merging. the test tries to wait for some initial stuff to happen stuff after the deployment finishes, but we should only to do that once, it won't work in the second test of the `it.each`, so the test fails.

Changed files:
filename: test/e2e/app-dir/use-cache/use-cache.test.ts
patch: @@ -740,12 +740,33 @@ describe('use-cache', () => {
     expect(text).toBe('This page could not be found.')
   })
 
-  it.each([
-    { description: 'js enabled', disableJavaScript: false },
-    { description: 'js disabled', disableJavaScript: true },
-  ])(
-    'should not read nor write cached data when draft mode is enabled: $description',
-    async ({ disableJavaScript }) => {
+  describe('should not read nor write cached data when draft mode is enabled', () => {
+    if (isNextDeploy) {
+      // Wait for the background revalidation after the deployment to settle.
+      beforeAll(async () => {
+        const browser = await next.browser('/draft-mode')
+        try {
+          const initialTopLevelValue = await browser
+            .elementById('top-level')
+            .text()
+          await retry(async () => {
+            await browser.refresh()
+
+            expect(await browser.elementById('top-level').text()).not.toBe(
+              initialTopLevelValue
+            )
+          })
+        } finally {
+          // we're not in a test, so the browser won't get cleaned up automatically.
+          await browser.close()
+        }
+      })
+    }
+
+    it.each([
+      { description: 'js enabled', disableJavaScript: false },
+      { description: 'js disabled', disableJavaScript: true },
+    ])('$description', async ({ disableJavaScript }) => {
       const browser = await next.browser('/draft-mode', {
         // This test relies on a server action to set draft mode.
         // To ensure that it works for both fetch actions and MPA actions,
@@ -769,20 +790,7 @@ describe('use-cache', () => {
         'Enable Draft Mode'
       )
 
-      let initialTopLevelValue = await browser.elementById('top-level').text()
-
-      if (isNextDeploy) {
-        await retry(async () => {
-          // Wait for the background revalidation after the deployment to settle.
-          await browser.refresh()
-
-          expect(await browser.elementById('top-level').text()).not.toBe(
-            initialTopLevelValue
-          )
-        })
-
-        initialTopLevelValue = await browser.elementById('top-level').text()
-      }
+      const initialTopLevelValue = await browser.elementById('top-level').text()
 
       // Draft mode is disabled, cached data should be returned on refresh.
 
@@ -853,8 +861,8 @@ describe('use-cache', () => {
       expect(await browser.elementById('closure').text()).toBe(
         initialClosureValue
       )
-    }
-  )
+    })
+  })
 
   if (isNextDev) {
     it('should not have unhandled rejection of Request data promises when use cache is enabled without dynamicIO', async () => {
Repository: nodejs/node
Pull request: node-api: remove deprecated attribute from napi_module_register

This PR targets to addresses the issue #56153 by removing the `[[deprecated]]` attribute from the `napi_module_register` function.

The code described in the issue does not use the `napi_module_register`  function as it was intended from a module shared library. Instead, it uses it to register modules for embedding scenarios. While it was never the intended use, we currently do not have a better approach to register modules before `Environment` is created until we complete the new embedding API  - PR #54660. 

We discussed the issue in the Node-API meeting on Dec 6th 2024, and decided that the quickest and the least intrusive way to address it is to remove the `[[deprecated]]` attribute from the `napi_module_register` function for now.

Changed files:
filename: src/node_api.h
patch: @@ -90,9 +90,6 @@ EXTERN_C_START
 
 // Deprecated. Replaced by symbol-based registration defined by NAPI_MODULE
 // and NAPI_MODULE_INIT macros.
-#if defined(__cplusplus) && __cplusplus >= 201402L
-[[deprecated]]
-#endif
 NAPI_EXTERN void NAPI_CDECL
 napi_module_register(napi_module* mod);