[internal] Fix next using stale pages#24635
Merged
Conversation
761333d to
6fe3884
Compare
eps1lon
commented
Jan 27, 2021
| * Creates .js file containing all /api nextjs pages | ||
| */ | ||
| function generateApiPagesManifest(outputPath: string, prettierConfigPath: string): void { | ||
| const [{ children: apiPages }] = findPages({ front: true }); |
Member
Author
There was a problem hiding this comment.
findPages({ front: true }) was what we pre-evaled previously in findPage.js.
oliviertassinari
approved these changes
Jan 27, 2021
xs9627
added a commit
to xs9627/material-ui
that referenced
this pull request
Jan 27, 2021
* next: (34 commits) [Tab] Migrate to emotion (mui#24651) [TextField] Migrate Input component to emotion (mui#24638) [ImageList] Migrate ImageListItemBar to emotion (mui#24632) [CircularProgress] Migrate to emotion (mui#24622) [DataTable] Add example in docs for data table (mui#24428) [Card] Migrate CardActionArea to emotion (mui#24636) [core] Fix `next` using stale pages (mui#24635) [List] Migrate ListItemIcon to emotion (mui#24630) [ClickAwayListener] Fix `children` and `onClickAway` types (mui#24565) [docs] Include in docs directive to silence `eslint` erroneous warning (mui#24644) [Fab] Migrate to emotion (mui#24618) [TextField] Migrate FilledInput to emotion (mui#24634) [Card] Migrate CardHeader to emotion (mui#24626) [Card] Migrate CardMedia to emotion (mui#24625) [ImageList] Migrate ImageListItem to emotion (mui#24619) [website] Add vision block (mui#24603) [docs] Add sorting section (mui#24637) [TextField] Prepare removal of labelWidth prop (mui#24595) [Dialog] Migrate DialogTitle to emotion (mui#24623) [ImageList] Migrate to emotion (mui#24615) ...
next using stale pagesnext using stale pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We're currently computing all the available pages in
/apiat runtime. Since we rely on the filesystem, we're usingbabel-prevalto compute the api pages at transpile time. However, transpiled files are cached and we cannot invalidate that the cache for a particular file. This leads to netlify deploys failing on a cache hit when pages changed (e.g. in #24626: https://app.netlify.com/sites/material-ui/deploys/60103453834bf5000813eeee).Invalidating just
babel-prevalis currently not possible (kentcdodds/babel-plugin-preval#19).We're now hardcoding /api pages just like any other page. This reduces complexity of what is considered a page. Since we already require committing
yarn docs:apichanges, we can leverage that script to generate the necessary page entries.TODO:
babel-plugin-prevalpagesAPIindocs:apiAside:
src/pagesis currently the wrong abstraction. It doesn't contain nextjs pages but items for the nav. Not every nav item is a nextjs page e.g./components/data-gridis hosted somewhere else and handled via netlify redirects. Orhttps://medium.com/material-uiwhich is just an external link. Might be worth entangling but I'm waiting for another bug to arise from this premature abstraction.