Add/standardize Next and Remix demos - #10
Conversation
| @@ -0,0 +1,4 @@ | |||
| { | |||
There was a problem hiding this comment.
Made things easier when working in the demos with Prettier configured (which is now default in VSCode) without going all the way to configuring linting for each of them. Happy to remove is this is problematic though.
| @@ -0,0 +1,23 @@ | |||
| # useAckee with Next.js | |||
There was a problem hiding this comment.
README's all have the same structure, adapted from the one made by create-next-app.
| "react-router-dom": "^5.2.0", | ||
| "react-scripts": "4.0.1", | ||
| "use-ackee": "^3.0.1" | ||
| "eslintConfig": { |
There was a problem hiding this comment.
This is necessary to prevent CRA from looking up the directory tree and finding+complaining about the package's own ESLint config. This sets it back to the default lint CRA rules.
| useAckee(pathname, { | ||
| domainId: 'hd11f820-68a1-11e6-8047-79c0c2d9bce0', | ||
| server: 'https://example.com', | ||
| }) |
There was a problem hiding this comment.
The original demo had ignoreLocalhost: false which resulted in CORS errors (and would otherwise fail even without them). Without that setting (which you probably don't recommend for real apps anyway), you get the nice console.warn which shows that Ackee is successfully running. Happy to revert if you prefer, though.
30f5d82 to
cbb2539
Compare
cbb2539 to
c4523bc
Compare
Following up on #8 (comment), I was inspired to add a Next.js demo. While I was at it, I also added a Remix demo and updated the React Router demo to CRA v5 and react-router v6.
Working across the 3 apps, I then tried to standardize the various directory structures and READMEs for better predictability/comparability:
.gitignoreentries to minimuze clutter in the demos themselves (also deleted optional files likejsconfig.jsonwhere possible for the same reason)Also attempted to reach a uniform code style based on your lint rules and other code (function expressions over declarations, 2 import groups, etc) without adding linting. Each of these frameworks would like to do their own linting which made things a little weird (CRA could see the root package.json's
eslintConfigfor instance). Added a.prettierrcwith the 2 major settings to align with your established patterns and make things easier for those with Prettier configured, but happy to remove it as well.Next app running:

Remix app running:

Updated CRA+RR app running:
