Skip to content

Commit

Permalink
Merge pull request #175 from airbnb/fix-linaria-deps
Browse files Browse the repository at this point in the history
Upgrade deps & fix missing linaria issue in create CLI template
  • Loading branch information
malash authored Nov 21, 2022
2 parents e963a6e + 0a07177 commit 1b10f19
Show file tree
Hide file tree
Showing 5 changed files with 2,877 additions and 2,990 deletions.
1 change: 1 addition & 0 deletions packages/cli/src/config/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ export const getWebpackConfig = ({
},
],
},
// @ts-ignore
plugins: [
new MiniCssExtractPlugin({
filename: `[name].${CSS_FILE_EXT[target] ?? 'wxss'}`,
Expand Down
13 changes: 11 additions & 2 deletions packages/core/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@ import { ReactElement } from 'react';
import { Container } from './container';
import { reconciler } from './reconciler';

export function renderIntoContainer(rootElement: ReactElement | null, container: Container) {
export function renderIntoContainer(rootElement: ReactElement, container: Container) {
// Create a root Container if it doesn't exist
if (!container.fiberRootContainer) {
container.fiberRootContainer = reconciler.createContainer(container, 0, false, null);
container.fiberRootContainer = reconciler.createContainer(
container,
0,
null,
false,
null,
'',
() => {},
null,
);
}

reconciler.updateContainer(rootElement, container.fiberRootContainer, null, () => {});
Expand Down
1 change: 1 addition & 0 deletions packages/create-goji-app/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@types/css-modules": "^1.0.0",
"@types/react": "^16.9.35",
"@types/weixin-app": "^2.9.3",
"linaria": "^2.3.0",
"typescript": "^4.0.3"
}
}
5 changes: 4 additions & 1 deletion packages/webpack-plugin/src/plugins/projectConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import { GojiBasedWebpackPlugin } from './based';
type CopyPluginPatterns = Array<{
from: string;
to: string;
transform?: (content: Buffer, path: string) => string | Buffer | Promise<string | Buffer>;
transform?: (
content: Buffer,
path: string,
) => string | Buffer | Promise<string> | Promise<Buffer>;
}>;

export class GojiProjectConfigPlugin extends GojiBasedWebpackPlugin {
Expand Down
Loading

0 comments on commit 1b10f19

Please sign in to comment.