Skip to content
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

Clean up plugins #14676

Merged
merged 1 commit into from
Jun 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions packages/next-plugin-material-ui/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions packages/next-plugin-material-ui/readme.md

This file was deleted.

17 changes: 0 additions & 17 deletions packages/next-plugin-material-ui/src/document-head-tags-server.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions packages/next/build/plugins/collect-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ export const VALID_MIDDLEWARE = [
'on-error-client',
'on-error-server',
'babel-preset-build',
'unstable-post-hydration',
'unstable-get-styles-server',
'unstable-enhance-app-server',
]

type ENV_OPTIONS = { [name: string]: string }
Expand Down
14 changes: 0 additions & 14 deletions packages/next/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,6 @@ class Container extends React.Component {
componentDidMount() {
this.scrollToHash()

if (process.env.__NEXT_PLUGINS) {
// eslint-disable-next-line
import('next-plugin-loader?middleware=unstable-post-hydration!')
.then((mod) => {
return mod.default()
})
.catch((postHydrationErr) => {
console.error(
'Error calling post-hydration for plugins',
postHydrationErr
)
})
}

// We need to replace the router state if:
// - the page was (auto) exported and has a query string or search (hash)
// - it was auto exported and is a dynamic route (to provide params)
Expand Down
20 changes: 1 addition & 19 deletions packages/next/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,30 +56,12 @@ export default class Document<P = {}> extends Component<DocumentProps & P> {
static async getInitialProps(
ctx: DocumentContext
): Promise<DocumentInitialProps> {
const enhancers = process.env.__NEXT_PLUGINS
? await import(
// @ts-ignore loader syntax
'next-plugin-loader?middleware=unstable-enhance-app-server!'
).then((mod) => mod.default(ctx))
: []

const enhanceApp = (App: any) => {
for (const enhancer of enhancers) {
App = enhancer(App)
}
return (props: any) => <App {...props} />
}

const { html, head } = await ctx.renderPage({ enhanceApp })
const styles = [
...flush(),
...(process.env.__NEXT_PLUGINS
? await import(
// @ts-ignore loader syntax
'next-plugin-loader?middleware=unstable-get-styles-server!'
).then((mod) => mod.default(ctx))
: []),
]
const styles = [...flush()]
return { html, head, styles }
}

Expand Down