-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core] Fix next
using stale pages
#24635
Merged
Merged
Conversation
This file contains 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
eps1lon
force-pushed
the
docs/fix-deploys
branch
from
January 26, 2021 16:27
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 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) ...
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
/api
at runtime. Since we rely on the filesystem, we're usingbabel-preval
to 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-preval
is 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:api
changes, we can leverage that script to generate the necessary page entries.TODO:
babel-plugin-preval
pagesAPI
indocs:api
Aside:
src/pages
is 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-grid
is hosted somewhere else and handled via netlify redirects. Orhttps://medium.com/material-ui
which is just an external link. Might be worth entangling but I'm waiting for another bug to arise from this premature abstraction.