Skip to content

Commit

Permalink
Revert "fix: history is undefined on render (#9765)" (#9798)
Browse files Browse the repository at this point in the history
This reverts commit 2d0ed66.

Co-authored-by: pshu <pishu.spf@antfin.com>
  • Loading branch information
stormslowly and stormslowly committed Nov 17, 2022
1 parent d73b20d commit 788a58c
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions packages/preset-umi/templates/umi.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,16 @@ async function render() {
},
});

const contextOpts = pluginManager.applyPlugins({
key: 'modifyContextOpts',
type: ApplyPluginsType.modify,
initialValue: {},
});

const basename = contextOpts.basename || '{{{ basename }}}';

const history = createHistory({
type: contextOpts.historyType || '{{{ historyType }}}',
basename,
...contextOpts.historyOpts,
});

return (pluginManager.applyPlugins({
key: 'render',
type: ApplyPluginsType.compose,
initialValue() {
const contextOpts = pluginManager.applyPlugins({
key: 'modifyContextOpts',
type: ApplyPluginsType.modify,
initialValue: {},
});
const basename = contextOpts.basename || '{{{ basename }}}';
const context = {
{{#hydrate}}
hydrate: true,
Expand All @@ -62,7 +53,11 @@ async function render() {
{{/loadingComponent}}
publicPath,
runtimePublicPath,
history,
history: createHistory({
type: contextOpts.historyType || '{{{ historyType }}}',
basename,
...contextOpts.historyOpts,
}),
basename,
};
return renderClient(context);
Expand Down

0 comments on commit 788a58c

Please sign in to comment.