<p dir="auto"><em>Original title: Support having non-page js/jsx files in pages dir</em></p>
<p dir="auto">This is an often requested feature. See issues <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="284890110" data-permission-text="Title is private" data-url="https://github.com/vercel/next.js/issues/3508" data-hovercard-type="issue" data-hovercard-url="/vercel/next.js/issues/3508/hovercard" href="https://github.com/vercel/next.js/issues/3508">#3508</a> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="226904261" data-permission-text="Title is private" data-url="https://github.com/vercel/next.js/issues/1914" data-hovercard-type="issue" data-hovercard-url="/vercel/next.js/issues/1914/hovercard" href="https://github.com/vercel/next.js/issues/1914">#1914</a> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="220829280" data-permission-text="Title is private" data-url="https://github.com/vercel/next.js/issues/1689" data-hovercard-type="issue" data-hovercard-url="/vercel/next.js/issues/1689/hovercard" href="https://github.com/vercel/next.js/issues/1689">#1689</a> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="217685541" data-permission-text="Title is private" data-url="https://github.com/vercel/next.js/issues/1545" data-hovercard-type="issue" data-hovercard-url="/vercel/next.js/issues/1545/hovercard" href="https://github.com/vercel/next.js/issues/1545">#1545</a> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="205349963" data-permission-text="Title is private" data-url="https://github.com/vercel/next.js/issues/988" data-hovercard-type="issue" data-hovercard-url="/vercel/next.js/issues/988/hovercard" href="https://github.com/vercel/next.js/issues/988">#988</a> and there are likely more. <em>edit: Also <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="268726767" data-permission-text="Title is private" data-url="https://github.com/vercel/next.js/issues/3183" data-hovercard-type="issue" data-hovercard-url="/vercel/next.js/issues/3183/hovercard" href="https://github.com/vercel/next.js/issues/3183">#3183</a>.</em></p>
<p dir="auto">This issue was fixed in PR <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="269175943" data-permission-text="Title is private" data-url="https://github.com/vercel/next.js/issues/3195" data-hovercard-type="pull_request" data-hovercard-url="/vercel/next.js/pull/3195/hovercard" href="https://github.com/vercel/next.js/pull/3195">#3195</a> but somewhere along the way the <code class="notranslate">pagesGlobPattern</code> config became broken, and was cleaned out in PR <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="288925622" data-permission-text="Title is private" data-url="https://github.com/vercel/next.js/issues/3578" data-hovercard-type="pull_request" data-hovercard-url="/vercel/next.js/pull/3578/hovercard" href="https://github.com/vercel/next.js/pull/3578">#3578</a>.</p>
<p dir="auto">This feature would allow us to place files that support specific pages, <em>with the pages that they support</em>. These "support" files could be tests, components, utilities, and more. This would improve the application's file organization, especially for large projects.</p>
<p dir="auto">(I searched for duplicates, apologies if this has been discussed before.)</p>
<p dir="auto">The package.json files in <a href="https://github.com/zeit/next.js/blob/094bb1f7b95f10c84a9e98d4ec76abfd03f8c60d/package.json#L49-L105">Next.js</a> and <a href="https://github.com/zeit/styled-jsx/blob/296526dc43212aa4244932b138791a7fe908bd96/package.json#L56-L67">styled-jsx</a> omit the conventional <code class="notranslate">^</code> on dependency versions.</p>
<p dir="auto">Why is this? I'm guessing it's intentional, as it seems to be this way on multiple Zeit projects, and you obviously know what you're doing.</p>
<p dir="auto">Why it causes a problem for me: I'm making a Next.js website. I found a bug coming from <a href="https://github.com/thysultan/stylis.js">Stylis</a> the other night, and it got fixed by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/thysultan/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/thysultan">@thysultan</a> quickly. But then I had to wait for styled-jsx to be republished, which happened the next day. And Next.js is still not republished (at time of writing), so I'm still blocked until that happens.</p>
<p dir="auto">If it's a defence against regressions in dependencies, FWIW, it seems like opting out of automatic patches does more harm than good. I know patch releases can sometimes introduce regressions, but they fix bugs more often. The approach would make sense to me if you had an automated nightly test-and-republish system to ensure you pick up patches quickly, but this doesn't seem to be in place – for example, until a few hours ago, styled-jsx was fixed to a two-month-old Stylis version (3.2.8), from July 24. Stylis has released 10 patches over that time, and none of them made it into styled-jsx until 5 hours ago. (And they're still not in Next.js.) On balance, wouldn't it make more sense to use <code class="notranslate">^</code>?</p>