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

Feature/template extensibility #1162

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
3f8939e
initial work on moving code to use resolver
yunakim714 Mar 27, 2023
f650221
fix getoverridepath and break on ^ imports
yunakim714 Mar 29, 2023
a5d3f01
add todos and comments
yunakim714 Mar 29, 2023
2eecb75
rewrite requestcontext.request for path with caret
yunakim714 Mar 30, 2023
3766818
perform overrideshashmap lookup for relative import
yunakim714 Mar 30, 2023
1b42d87
progress
yunakim714 Apr 4, 2023
9a2252c
progress
yunakim714 Apr 5, 2023
b4ef5b9
merge feature branch back
yunakim714 Apr 6, 2023
93727d1
resolve merge conflicts
yunakim714 Apr 6, 2023
3863783
regenerate lock files
yunakim714 Apr 6, 2023
cc30d3a
Merge branch 'feature/template-extensibility' into extensibility-code…
bfeister Apr 6, 2023
a22ef36
fix dupe useToast
bfeister Apr 6, 2023
74f1d24
progress on making `charles-solution` work
bfeister Apr 6, 2023
8b80436
initial pass at migration to `resolver.getHook('resolve').tapAsync` w…
bfeister Apr 7, 2023
b388e56
restore icons file and add extensible text to home
yunakim714 Apr 7, 2023
6541b8f
add some comments and construct hashmap in new plugin
yunakim714 Apr 10, 2023
a654ef3
working glob sync lookup??
yunakim714 Apr 11, 2023
2cb9cce
resolve lookup when there is no extension
yunakim714 Apr 11, 2023
fcd183b
add component slot for testing
yunakim714 Apr 11, 2023
7adceb1
fix some lookup errors
yunakim714 Apr 11, 2023
d287a16
cleanup
yunakim714 Apr 13, 2023
a8b593d
rewrite requests coming from underlying template
yunakim714 Apr 14, 2023
9d79b8e
cleanup
yunakim714 Apr 14, 2023
6ebbe1a
rename plugin file
yunakim714 Apr 14, 2023
38f3b92
resolve merge conflict
yunakim714 Apr 14, 2023
be3bb04
remove unnecessary build files
yunakim714 Apr 19, 2023
0cb80f4
rename to overrides
yunakim714 Apr 19, 2023
2b726b9
fix lookup errors
yunakim714 Apr 20, 2023
940565a
Merge branch 'feature/template-extensibility' into extensibility-code…
bfeister Apr 25, 2023
e76ee0a
fix some broken upstream changes, eslint fixes
bfeister Apr 25, 2023
7345439
Bring back the deleted package.json
vmarta Apr 26, 2023
f9b1477
Install new eslint plugin
vmarta Apr 26, 2023
71f21b2
No more relative imports in retail-react-app
vmarta Apr 26, 2023
16cca08
Create .prettierrc.yaml
vmarta Apr 26, 2023
4fcbf92
restore other deleted package lockfiles
bfeister Apr 26, 2023
a8d9021
fix some eslint issues
bfeister Apr 26, 2023
d3f6860
remove `^` imports and begin migrating logic away from previous API. …
bfeister Apr 26, 2023
f0bed51
short circuit plugin temporarily, get webpack `alias` working for tem…
bfeister Apr 26, 2023
856427d
fix unreachable condition
bfeister Apr 26, 2023
e8cc5b4
wow... freaking works 🚀
bfeister Apr 26, 2023
f2ce238
cleanup, get `template-retail-react-app` working again
bfeister Apr 26, 2023
24622a6
cleanup
bfeister Apr 26, 2023
6df83a6
Create .eslintrc.js
vmarta Apr 27, 2023
edacf34
fix routes.jsx which no longer pulled relative template
bfeister Apr 27, 2023
1862c9e
make routes.jsx more concise
bfeister Apr 27, 2023
20c3042
update lockfiles
bfeister Apr 27, 2023
69fcd79
add jsconfig.json for IDEs to have magic `retail-react-app` be discov…
bfeister Apr 27, 2023
78b6c53
Merge branch 'feature/template-extensibility' into feature/template-e…
bfeister Apr 28, 2023
4241eab
more cleanup
bfeister Apr 28, 2023
7bac071
change package.json key from `mobify` => `ccExtensibility`
bfeister Apr 28, 2023
dbaba8b
cleanup
bfeister Apr 28, 2023
06cb1f0
Final cleanup, remove console.logs, make `extendable` dynamic for int…
bfeister Apr 28, 2023
98c382b
fix straggler non-dynamic filepath
bfeister Apr 28, 2023
29e6e58
cleanup
bfeister Apr 28, 2023
c3fa1f3
remove code that shouldn't be in v3+
bfeister Apr 28, 2023
9b39529
sync package.json deps in extended example project
bfeister May 2, 2023
b8fe972
cleanup / pr feedback
bfeister May 2, 2023
148ea0a
pr feedback, great catch @kevinxh
bfeister May 3, 2023
4543a4d
fix problem with bad copy from underlying template file
bfeister May 3, 2023
11701dc
pr feedback / cleanup
bfeister May 3, 2023
e1aabf1
cleanup
bfeister May 3, 2023
2fe771e
Update package-lock.json
vmarta May 3, 2023
83f07fe
WIP
vcua-mobify May 3, 2023
7e3b678
drop unneeded complexity
bfeister May 3, 2023
95488be
lockfiles
bfeister May 3, 2023
8b6f5fb
moving toward an array of `alias`es
bfeister May 4, 2023
a29cc07
Refactor template extensibility functionality to use `resolve.alias` …
bfeister May 5, 2023
d96c107
Merge branch 'feature/template-extensibility-algo-refactor' of github…
vcua-mobify May 5, 2023
ce151a1
add brand-logo with no clash for server side viewBox
bfeister May 5, 2023
034e2d7
add `request-processor.js` (required for worker.js to load) and fix b…
bfeister May 5, 2023
a0086fd
lint fix
bfeister May 9, 2023
a9ec4bf
fix failing pwa-kit-react-sdk tests
bfeister May 9, 2023
2afa605
cleanup
bfeister May 9, 2023
de5fd5c
Merge branch 'feature/template-extensibility' into feature/template-e…
bfeister May 9, 2023
5cb9f44
lint:fix
bfeister May 9, 2023
58becd0
fix failing tests in CI re: `TextDecoder is not defined`
bfeister May 9, 2023
344a65e
take 2 attempting to fix TextDecoder global in jest
bfeister May 9, 2023
e7eba97
fix jest module mapper
bfeister May 9, 2023
79a1b55
fix jest moduleMapper config
bfeister May 9, 2023
e0c6c4b
REALLY fix jest moduleNameMapper config for new pathing + fix node `u…
bfeister May 9, 2023
e750b29
add brand-logo
bfeister May 9, 2023
f5b14d0
remove previously added `AbovePDP` Template Hook component
bfeister May 9, 2023
65293a2
replay #1128 from bad merge
bfeister May 9, 2023
a9fae57
eslint:fix for `retail-react-app` base paths
bfeister May 10, 2023
f382362
de-duplicate deps in bundle
bfeister May 10, 2023
eafa3b1
fix path defaulting, don't pass nullish value to path.resolve
bfeister May 10, 2023
151b96b
improve pathing for overridesDir in pwa-kit-dev webapack config + add…
bfeister May 10, 2023
61e32b8
Merge branch 'v3' into feature/template-extensibility-algo-refactor
bfeister May 10, 2023
868f9b2
fix pathing
bfeister May 11, 2023
fe7c3ce
fix pathing issue that was mysteriously UNFIXED
bfeister May 11, 2023
bf921b9
fix `worker.js` path
bfeister May 11, 2023
74d1191
fix app/static pathing in non-extensible builds
bfeister May 12, 2023
3e57e0b
[Extensibility] Remove Einstein proxy and send Einstein events direct…
vcua-mobify May 16, 2023
412c3f8
Replace ExtendsCircularImportsPlugin with OverridesResolverPlugin (#1…
vcua-mobify May 16, 2023
6a53a96
remove irrelevant bundlesize check to pass CI
bfeister May 17, 2023
d429521
Fix `vendor.js` inclusion of `retail-react-app` files (#1198)
bfeister May 18, 2023
bddb532
replace relative with absolute path fetchTranslations (#1215)
alexvuong May 18, 2023
e1b5bfd
Refactor for unit testing, fix pathing issue from old version of file…
bfeister May 18, 2023
23c195a
Merge branch 'develop' into feature/template-extensibility-algo-refactor
bfeister May 23, 2023
d73a770
fix merge conflict resolution
bfeister May 23, 2023
e50b67f
remove template extensible demo in prep for @bendvc's pr for generato…
bfeister May 23, 2023
46cff7e
regen lockfiles for react 18 changes
bfeister May 23, 2023
4cd60bf
fix linting
alexvuong May 23, 2023
47e1959
Merge branch 'feature/template-extensibility' into feature/template-e…
bfeister May 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
606 changes: 0 additions & 606 deletions diff.txt

This file was deleted.

3 changes: 3 additions & 0 deletions packages/commerce-sdk-react/setup-jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class LocalStorageMock {
}
}

/* eslint-disable @typescript-eslint/no-var-requires */
global.TextDecoder = require('util').TextDecoder

const localStorageMock = new LocalStorageMock()

Object.defineProperty(window, 'localStorage', {
Expand Down
6 changes: 4 additions & 2 deletions packages/pwa-kit-dev/bin/pwa-kit-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const WebSocket = require('ws')
const program = require('commander')
const validator = require('validator')
const {execSync: _execSync} = require('child_process')
const pkg = require('../package.json')
const projectPkg = require(process.cwd() + '/package.json')
const {getConfig} = require('pwa-kit-runtime/utils/ssr-config')

Expand Down Expand Up @@ -183,7 +182,10 @@ const main = async () => {
const appSSRjs = fse.pathExistsSync(appSSRpath)
const overrideSSRpath = p.join(
process.cwd(),
projectPkg?.mobify?.overridesDir ?? '',
typeof projectPkg?.ccExtensibility?.overridesDir === 'string' &&
!projectPkg?.ccExtensibility?.overridesDir?.startsWith('/')
? '/' + projectPkg?.ccExtensibility?.overridesDir
: projectPkg?.ccExtensibility?.overridesDir ?? '',
Comment on lines +185 to +188
Copy link
Collaborator

Choose a reason for hiding this comment

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

This conditional assignment doesn't read that well. We are checking type, does that mean that is can be a non-string? Will it error out when someone puts an array or object as a value?

There are 2 things we can do:

  1. add proper schema validation for the ccExtensibility key in the package.json that will allow use to define the types for the various values, or validation functions for more complex props like this one.
  2. We drop the configurability of the extensibility folder until we do the above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the logic reads (indirectly) typeof overridesDir === 'string' ? overridesDir : ''

I'm not convinced we need to change this, sure we could, but I'm not sold on the effort being necessary

'app',
'ssr.js'
)
Expand Down
13 changes: 13 additions & 0 deletions packages/pwa-kit-dev/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/pwa-kit-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"@types/git-rev-sync": "^2.0.0",
"@types/node-fetch": "^2.6.3",
"@types/validator": "^13.7.14",
"eslint-plugin-no-relative-import-paths": "^1.5.2",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did we file 3PP in GUS for all the new dependencies that we are adding?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just remembered this last night, we weren't expecting to need a new lib, but that changed very recently

"internal-lib-build": "^3.0.0-dev",
"nock": "^13.3.0",
"nodemon": "^2.0.22",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
},
extends: ['plugin:react/recommended', 'plugin:jsx-a11y/recommended'],
plugins: ['jsx-a11y', 'react', 'react-hooks', 'use-effect-no-deps'],

settings: {
react: {
version: 'detect'
Expand Down
Loading