canary
Commits on Apr 30, 2022
-
Refactor Page Paths utils and Middleware Plugin (#36576)
This PR brings some significant refactoring in preparation for upcoming middleware changes. Each commit can be reviewed independently, here is a summary of what each one does and the reasoning behind it: - [Move pagesDir to next-dev-server](javivelasco@f2fe154) simply moves the `pagesDir` property to the dev server which is the only place where it is needed. Having it for every server is misleading. - [Move (de)normalize page path utils to a file page-path-utils.ts](javivelasco@27cedf0) Moves the functions to normalize and denormalize page paths to a single file that is intended to hold every utility function that transforms page paths. Since those are complementary it makes sense to have them together. I also added explanatory comments on why they are not idempotent and examples for input -> output that I find very useful. - [Extract removePagePathTail](javivelasco@6b12133) This extracts a function to remove the tail on a page path (absolute or relative). I'm sure there will be other contexts where we can use it. - [Extract getPagePaths and refactor findPageFile](javivelasco@cf2c7b8) This extracts a function `getPagePaths` that is used to generate an array of paths to inspect when looking for a page file from `findPageFile`. Then it refactors such function to use it parallelizing lookups. This will allow us to print every path we look at when looking for a file which can be useful for debugging. It also adds a `flatten` helper. - [Refactor onDemandEntryHandler](javivelasco@4be685c) I've found this one quite difficult to understand so it is refactored to use some of the previously mentioned functions and make it easier to read. - [Extract absolutePagePath util](javivelasco@3bc0783) Extracts yet another util from the `next-dev-server` that transforms an absolute path into a page name. Of course it adds comments, parameters and examples. - [Refactor MiddlewarePlugin](javivelasco@c595a2c) This is the most significant change. The logic here was very hard to understand so it is totally redistributed with comments. This also removes a global variable `ssrEntries` that was deprecated in favour of module metadata added to Webpack from loaders keeping less dependencies. It also adds types and makes a clear distinction between phases where we statically analyze the code, find metadata and generate the manifest file cc @shuding @huozhi EDIT: - [Split page path utils](158fb00) After seeing one of the utils was being used by the client while it was defined originally in the server, with this PR we are splitting the util into multiple files and moving it to `shared/lib` in order to make explicit that those can be also imported from client.
Commits on Apr 29, 2022
-
-
Adds inline script functionality to
next/scriptforworkerand `b… -
-
chore: clarify CLI network errors (#36567)
Makes it easier to detect why a network error occurred with the CLI or `next info`, based on #36344 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint`
-
Add note about running next without a sub-command (#36560)
This should be made explicitly clear because other code may just call `next` instead of `next dev` (e.g. https://github.com/netlify/framework-info/blob/main/src/frameworks/next.json). Being in the ninth circle of debug hell right now I could not take it for granted that the two were the same till I saw some kind of confirmation, either from the docs or from the source. Source is great, but calling it out in the docs would saved me some time. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint`
Commits on Apr 28, 2022
-
bump styled-jsx to latest (#36554)
x-ref: coryetzkorn/twitter-algorithm#2 * Bump styled-jsx to latest version (5.0.2), so that it could get dedup when user installs the styled-jsx manually * Remove the legacy `@types/styled-jsx`
-
Hoist the desired ReactDOM import expression (#36552)
* hoist `react-dom/server` imports to reduce module load time in nodejs * simplify `reactRoot` detection condition by checking the streaming rendering API we're using. (if it doesn't existed, like react 17, then we won't enable `reactRoot`) * Merge `__NEXT_CONCURRENT_FEATURES` into `__NEXT_REACT_ROOT` env var since they're identical now
-
-
unlock eslint-config-next dependencies (#35781)
Fixes #35753 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint` Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
-
Tweak lockfile patching to be eager (#36549)
This is a follow-up to #36527 to make sure we eagerly patch the lockfile as the correct swc dependency will be present if the platform matches so the load failure isn't hit which is where we were previously patching the lockfile. This is done in the background so does not block compilation. This also removes some extra logs that aren't necessary. <details> <summary>before lockfile patch</summary>  </details> <details> <summary>after lockfile patch</summary>  </details> This also fixes a case I noticed where we weren't flushing events before exiting when builds fail
-
Refactor base server to get rid of the __server_context hack (#36550)
This PR makes the `Options` type of base server configurable as well as assigning to `this.serverOptions`, so the web server can access it during `constructor()`. This gets rid of the dirty `__server_context` hack. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint`
-
docs(examples): Updated Chakra UI examples (#36333)
## Overview This PR updates both Chakra UI examples by updating the Chakra UI packages to the latest versions, and added better examples for Semantic Tokens (new feature in Chakra UI), and pseudo props. ## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint` Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
-
This PR updates swc to swc-project/swc@a72f436 This PR applies - swc-project/swc#4452 - Fixes `yield*` of async generators in async generators. - Fixes name mangling of injected helpers. - Note: This only applies to tiny files which enables lots of helpers. - swc-project/swc#4468 - Fixes newer version of react.
-
-
-
Bump react dev dep to 18.1 (#36491)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
-
Align behavior of SWC transform & transformSync (#36500)
fixes #35661 ## Bug - [x] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [x] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint`
-
Adds
<link rel="preconnect" ... />to example optimized font output (……#36529) This makes it clear that the font optimization adds these for you. This avoids duplicate `<link rel="preconnect" />` in the HTML output if the developer is unaware that it is being added automatically. ## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint`
Commits on Apr 27, 2022
-
Add docs on self-hosted ISR persisting across pods. (#36520)
ISR works self-hosted, but there's some more guidance needed when hosting with container-based setups (e.g. Kubernetes) and how the files are shared between different pods. This was based on community feedback. Please let me know if you'd like to see any additions here!
🙏 -
Always add height and width prop to image with layout="raw" (#36523)
This PR makes the following changes: * Always add the `height` and `width` prop to image with `raw` layout (previously only added to images without `sizes`) * Add a warning if a raw layout image is getting stretched (which can be caused by interaction of height and width prop with styles) * Remove automatic aspect-ratio style from `raw` images. This is no longer necessary if all `raw` images have height and width props. * Update tests and docs accordingly
-
-
Ensure optional params are normalized correctly in minimal mode (#36513)
Follow-up for #36463 this fixes an issue with optional catch-all params not being normalized correctly which was caught by the runtimes tests. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md`
-
polish isomorphic path module (#36521)
List all exports for internal path module to avoid import destruction is breaking with typescript. #### Prev ```js import pathMod from '../isomorphic/path' const { join, resolve } = pathMod ``` #### Now ```js import { join, resolve } from '../isomorphic/path' ``` -
Update rewrite destination for flakey rewrite tests (#36519)
* Update rewrite destination for flakey rewrite tests * update other test
-
Add with-edgedb example (#35929)
## Documentation / Examples - [X] Make sure the linting passes by running `yarn lint`
-
-
-

