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

Shell for Home View WebViewView #1249

Merged
merged 11 commits into from
Apr 1, 2024
Merged

Conversation

sagerb
Copy link
Collaborator

@sagerb sagerb commented Mar 29, 2024

Intent

This is PR 2 of 3 which will implement the new Home View for the Publisher VSCode Extension.

The code within this PR builds upon the PR: #1248 to implement a skeleton Home View, built as a WebViewView. It is implemented as a Vue app.

When built and run, this extension shows the Home View as:
2024-03-29 at 3 07 PM

Type of Change

    • Bug Fix
    • New Feature
    • Breaking Change
    • Documentation
    • Refactor
    • Tooling

Approach

Automated Tests

Directions for Reviewers

Checklist

Copy link
Collaborator

@dotNomad dotNomad left a comment

Choose a reason for hiding this comment

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

I have quite a few follow-up, nitpicky comments in here, but to highlight my main concerns for this PR specifically:

  • the extension bundle (see .vscodeignore section below)
  • the Content-Security-Policy

The most important follow-up is going to be the tooling to ensure releases work with the current GitHub workflows

.vscodeignore

I noticed that there we no updates to the .vscodeignore with the introduction of the webviews folder. I believe that should be included so vsce doesn't bundle in source code. I saw that in a few of their examples.

What I did when exploring this was used their method for ignoring all files in the webviews dir, and generalized some ignores for configuration files that could be in multiple directories.

Here is what I had:

# `.vscodeignore`
.vscode/**
.vscode-test/**
src/**
.yarnrc
**/*.map
**/*.ts
CONTRIBUTING.md
vsc-extension-quickstart.md

# Ignore all webview files except the build directories
webviews/homeView/src/**
webviews/homeView/index.html
webviews/homeView/package.json
webviews/homeView/package-lock.json
webviews/homeView/README.md
webviews/homeView/node_modules/**

# Ignore configuration files
**/.gitignore
**/.eslintrc.json
**/tsconfig*.json
**/vite.config.json

I found it very helpful to use npx vsce ls from the extensions/vscode directory to see just what files would be included in the bundle and removing ones that weren't used.

Note: that I am not sure if node_modules should or shouldn't be included? I haven't seen examples excluding them so I've left it alone, would be a good discovery task to understand our vsce bundling a bit better.

extensions/vscode/src/utils/getNonce.ts Show resolved Hide resolved
extensions/vscode/package.json Show resolved Hide resolved
extensions/vscode/webviews/homeView/public/favicon.ico Outdated Show resolved Hide resolved
extensions/vscode/webviews/homeView/index.html Outdated Show resolved Hide resolved
extensions/vscode/tsconfig.json Outdated Show resolved Hide resolved
extensions/vscode/webviews/homeView/tsconfig.json Outdated Show resolved Hide resolved
Base automatically changed from sagerb-api-updates to main March 30, 2024 01:55
Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs to be .vscodeignore. We already have that file, but we can combine these two.

extensions/vscode/webviews/homeView/.gitignore Outdated Show resolved Hide resolved
Copy link
Collaborator

@dotNomad dotNomad left a comment

Choose a reason for hiding this comment

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

This PR is looking fantastic. Thanks for taking the time to look at all of those comments 😅

@sagerb sagerb merged commit 78bf6ea into main Apr 1, 2024
19 checks passed
@sagerb sagerb deleted the sagerb-add-webviewview-vue-skeleton branch April 1, 2024 23:13
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