Skip to content

Unify the Webpack bundle#1477

Merged
koesie10 merged 3 commits intomainfrom
koesie10/unified-webpack-bundle
Aug 30, 2022
Merged

Unify the Webpack bundle#1477
koesie10 merged 3 commits intomainfrom
koesie10/unified-webpack-bundle

Conversation

@koesie10
Copy link
Copy Markdown
Member

This will move all webviews into a single Webpack bundle. This will make it easier to add new webviews since we don't need to add a new bundle, but just need to add a new directory with an index.tsx file.

It also moves the CSS processing to Webpack so that we don't need to specify the CSS files to use separately, but can simply do so in the TypeScript files.

The next step will be abstracting/simplifying the interface classes which create the panel.

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

This will move all webviews into a single Webpack bundle. This will make
it easier to add new webviews since we don't need to add a new bundle,
but just need to add a new directory with an `index.tsx` file.

It also moves the CSS processing to Webpack so that we don't need to
specify the CSS files to use separately, but can simply do so in the
TypeScript files.
@koesie10 koesie10 requested review from a team as code owners August 26, 2022 09:40
Copy link
Copy Markdown
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on! Looks really good. I have a few questions, but nothing really blocking. I haven't downloaded this and tried it out, which I plan on doing.

@@ -31,9 +30,7 @@ export const config: webpack.Configuration = {
{
test: /\.less$/,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor:

Hmmm...looks like we have a rule for less files, but we're not using any less. This has been in the file since the very beginning. If we're not using less now and have no plans to, perhaps we should remove it. And in the future, use sass if we want.

Not something you need to do for this PR. Just a thought and something to discuss for later.

Uri.file(ctx.asAbsolutePath('out/webview.css'))
];

if (includeCodicons) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the danger of always including codicons? It would be nice to slowly move our other webviews to use the same UI styles as the MRVA webview.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you have noticed in #1478, I think we should always include the codicons and will do it in that PR. However, to include the codicons the path should also be included in the localResourceRoots, so that would require duplicating this line to the other two interface managers. I didn't really think that would be worth it, especially since that part is going to be replaced anyway in #1478.

allowInlineStyles?: boolean;
includeCodicons?: boolean;
} = {
allowInlineStyles: false,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is only true for the mrva page so that it can use inline styles while loading react components from the primer UI toolkit library. Since we are moving away from primer and using the vscode UI toolkit, is this still necessary?

Again, not related to this PR, but perhaps something to check later.

@koesie10 koesie10 merged commit 6d7d0ca into main Aug 30, 2022
@koesie10 koesie10 deleted the koesie10/unified-webpack-bundle branch August 30, 2022 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants