[App Extensibility ⚙️] Introduce project .force_overrides file @@W-17569698@@#2207
Conversation
packages/pwa-kit-extension-sdk/src/configs/webpack/overrides-resolver-loader.ts
Show resolved
Hide resolved
packages/pwa-kit-extension-sdk/src/configs/webpack/overrides-resolver-loader.ts
Outdated
Show resolved
Hide resolved
| // PLACE THE RELATIVE __POSIX__ PATH TO THE EXTENSION FILE YOU WANT TO OVERRIDE STARTING WITH THE EXTENSION PACKAGE NAME. | ||
| // MULTIPLE OVERRIDES CAN BE ADDED TO THIS FILE, ONE PER LINE.\ | ||
| // EXAMPLE: | ||
| // @salesforce/extension-sample/src/pages/home.tsx No newline at end of file |
There was a problem hiding this comment.
🤔 are the file paths supposed to be relative paths or absolute paths? The example look like neither
There was a problem hiding this comment.
So it's really more of a module import path, I was wavering on this a little too. I could make it something like:
./@salesforce/extension-sample/src/pages/home.tsx
or
./node_modules/@salesforce/extension-sample/src/pages/home.tsx
I think the second one is probably the way to go and shouldn't be hard to fix.
| @@ -0,0 +1,11 @@ | |||
| // DISCLAIMER | |||
There was a problem hiding this comment.
Are we missing adding documentation in README.md files or similar to let users know how to use this file?
There was a problem hiding this comment.
I've create this small ticket to do this later.
https://gus.lightning.force.com/lightning/_classic/%2Fa07EE0000285F7zYAE
| }) | ||
| }) | ||
|
|
||
| describe('validateOverrideSource', () => { |
There was a problem hiding this comment.
Should we add a test for handle a malformed overridable list?
There was a problem hiding this comment.
The overridable list in simply text file.. each line that isn't being commented out is interpreted as a path. I think the simplicity of this means we don't have to validate it or maintain code that validates it.
Let's evaluate this later and we can create a ticket if there is a benefit to doing this validation.
Description
In order to help those migrating from v3 to new extensibility model in v4 we need to make sure there is an escape hatch for those customers that have overridden files that are not part of the
extension-chakra-storefrontpublic file API.To do this we introduce the
.force_overridesthat allows the PWA developer to instruct the extensibility SDK to treat the files listed in this "dot" file at overridable. This allows their current projects to be migrated to the latest version of the platform.It's suggested that over time the customer should whittle this list down, so it, over time, has no entries in it. This will result in their projects being a lot more upgradable.
Force.Overrides.720p.mov
Types of Changes
Changes
How to Test-Drive This PR
node packages/pwa-kit-create-app/scripts/create-mobify-app-dev.js --outputDir generated-retail-react-app-test-project/app/overrides/@salesforce/extension-chakra-store-locator/components/list.tsxnpm startand navigate to the store locator `/store-locator' path..force_overridesfile and add the below line at the end of the file:@salesforce/extension-chakra-store-locator/src/components/list.tsxChecklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization