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

Add warning to pwa-kit-create-app that v2 is outdated. #1497

Merged
merged 2 commits into from
Oct 24, 2023

Conversation

wjhsf
Copy link
Contributor

@wjhsf wjhsf commented Oct 24, 2023

New projects should be generated with @salesforce/pwa-kit-create-app, but we don't want to completely break the v2 app. Solution: add a warning!

An additional optional step might be to mark the package as deprecated in npm.

Description

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

  • (change1)

How to Test-Drive This PR

  • Check out this branch, create a new app. It will print a warning!

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@wjhsf wjhsf requested a review from a team as a code owner October 24, 2023 16:28
@@ -421,7 +421,14 @@ const checkOutputDir = (path) => {
}
}

const main = (opts) => {
const main = async (opts) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: this method already returns a promise, so changing this to an async function is of minimal consequence.

console.warn('Please use the new package to use the latest PWA Kit features.')
console.log('')
// Wait 1 second before continuing to draw attention to the warning
await new Promise((resolve) => setTimeout(resolve, 1000))
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice UX touch.. appreciate this delay 👍

@wjhsf wjhsf merged commit 5d7b1b4 into release-2.8.x Oct 24, 2023
29 checks passed
@wjhsf wjhsf deleted the wjh/warn-old-app branch October 24, 2023 21:17
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.

None yet

3 participants