-
Notifications
You must be signed in to change notification settings - Fork 277
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
Analytics rfc #196
Analytics rfc #196
Conversation
```jsx | ||
return ( | ||
<Button onClick={() => { | ||
fetch('/events', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also leverage sendBeacon #usetheplatform ™️
}) | ||
} | ||
|
||
type AnalyticsEvent = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, I did an initial implementation on the new full-stack cart components.
Here's an example event for LinesAdd mutation. Let's sync on the final payload shape 🙏🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
* Initial commit from Create Turborepo * Save progress on migration * Get storefront api schema and graphql generation working * Update deps, add changeset, fix types with new version * Add turbo ci checks Add github workflows * create the 2022-7 branch * Change naming, update docs, move readme and contributing * Config alex and get checks passing * Add cla github action * Update actions versions, and run checks before build * Fix branch references to main * test to see if alex is breaking ci stuff (#1) * test to see if alex is breaking ci stuff * add alex back, and check changeset checker * downgrade alex, and add better words/docs on changeset reminder * revert alex downgrade * see if we can figure out where this is coming from * remove testing as it didn't find anything * remove diff command on alex * remove comment that tests changeset checker * add publish config * Fix readmes (#2) * Fix readmes * update terminology * Add CoC and update package description * Fix docs * Simplify the logic for external video urls (#3) * Remove unnecessary tsconfig items (#4) Add the variant source header for SFAPI calls. * Update README.md * Fix issues with formatting and filename * update dependencies (#5) * README updates for content type and pkg name (#6) * provide guidance on setting the header content type * language lint * change pkg name * Update README (#7) * update readme * fix links Co-authored-by: Elise Yang <[email protected]> * CI action for publishing the next version automatically (#8) * CI action for publishing the next version automatically * remove output to file * Publish next2 (#9) * CI action for publishing the next version automatically * remove output to file * Don't use the action to run these commands * Try manually doing the publish now (#10) * Go into dir so script can find package.json (#11) * Try this configs * Change ts moduleresolution (#13) * Change TS's module resolution to 'node' instead of nodenext * Include stories in TS checking now, and fix issues * Feat/cart provider (#12) * Copy CartProvider from hydrogen repo * Add worktop lib to use the cookies package for CartProvider * Modify CartProvider to fit hydrogen-ui * Add CartProvider story * add changeset * Cart provider updates (#14) * Change ts moduleresolution (#13) * Change TS's module resolution to 'node' instead of nodenext * Include stories in TS checking now, and fix issues * Starting work on simplifying the cart code in hui * Simply more cart-related files and remove a bunch of them * All CI checks are passing, and types are improved. * Better file names * Fix mock import filename * Remove any type * Improve release notes, update type names, fix typo * Correct alex config file and allow hooks Co-authored-by: Anthony Frehner <[email protected]> * udpate readmes (#18) * udpate readmes * format * update * Fix issue with file output not being correct (#16) * Fix issue with file output not being correct Also update deps, and move npmrc. * downgrade happy-dom to pass tests * fix publishing? * cleanup script * update naming for workflow * remove from npmrc and add to script * show an error when next publish doesn't work * fix cd script * Make the URLs a little more permanent. (#19) * Fix TS typings on moduleResolution: node (#20) * [ci] release 2022-7 (#15) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Update to 2022-10 Also, add documentation for next time. * Update package.json version * Fix output bundles, maybe. (#22) * Convert project to CJS with ESM files ending in .mjs (#23) * Convert project to CJS with ESM files ending in .mjs Helps fix issues with the build output + dependencies processed by Vite. * fix small typo in message * move script to .mjs * And update reference to mjs script * Initial release of 2022-10 (#24) * [ci] release 2022-10 (#25) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * externalize the deps (#29) * externalize the deps * Add changelog * wrap comments * Revert package updates as it causes issues still in nextjs (#31) * metafieldParser() (#45) * Save progress on a new metafield parser * Fix type issue, and get some generics passed in * Fix tests and add additional TS docs to the types * handle no 'type' field, and prep for list metafields * Save progress on metafield parser and tests * Finished the tests and docs * Deprecate parseMetafield; add changelog; export functions * fix bad variable name * Update packages/react/src/metafield-parser.test.ts Co-authored-by: Daniel Rios <[email protected]> * Clarify wording around naming and deprecation * remove todo Co-authored-by: Daniel Rios <[email protected]> * Create CartCost (#46) * Create CartCost * Add changeset * Update packages/react/src/CartCost.tsx Co-authored-by: Anthony Frehner <[email protected]> * Update packages/react/src/CartCost.tsx Co-authored-by: Anthony Frehner <[email protected]> * Fix lint * Fix lint Co-authored-by: Anthony Frehner <[email protected]> * Adding NextJS as an e2e testing point / app (#49) * save progress * Save progress and updates * Saving prettier output * Cleanup the repo and get dev scripts working across packages * Build before typecheck as nextjs relies on the output * fix linting setup for nextjs * add a todo note * Fix build issues with outputting a node_modules folder Always remove the dist folder as part of dev (and prod) to make sure that the dist folder looks accurate across starts Move unneeded ts-expect in sourcecode and move to test Fix some tsconfig issues with included files * Update issue templates * Update issue templates * format fixing :) * Update the types for MediaFile to allow className (#57) * Add <AddToCartButton /> component (#58) * Add component * Add tests * add changeset * fix typo * Update AddToCartButton.tsx * Move base button (#59) * Cart checkout button (#60) * Add CartCheckoutButton * Create curly-turtles-itch.md * use basebutton on checkoutbutton (#61) * Buy now button (#62) * buy now button * minor fixusps and change set * include xstate in builds (#64) * include xstate in builds * Fix NextJS issues by including files with sideeffects See vitejs/vite#10866 for more details * [ci] release 2022-10 (#47) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Add node-specific builds using Vite's --ssr flag (#66) * Add node-specific builds using Vite's --ssr flag Should help use the correct code for each environment in places where that's important, e.g. using node-specific stuff when in node. * add changeset * Fix additional issues with node builds (#68) * Fix additional issues with node builds Tested in the standalone nextjs app for sanity's sake, and this is working * comment update * Cart line provider (#48) * Initial thing * Make old tests pass * Adding stories * fix up test/stories more * remove unneeded fixtures * Update sharp-squids-accept.md * Update CartLineProvider.test.tsx * remove cartlines component * Add additional functions to ShopifyProvider (#71) * Added new functions to shopify provider * Update cart to use the new methods Add changeset * feedback updates * Add our scalars to the package for other developers (#69) * Add our scalars to the package for other developers * Update .changeset/swift-olives-beam.md Co-authored-by: Ren Chaturvedi <[email protected]> * Update .changeset/swift-olives-beam.md Co-authored-by: Ren Chaturvedi <[email protected]> * Update apps/nextjs/codegen.ts Co-authored-by: Ren Chaturvedi <[email protected]> * Update apps/nextjs/codegen.ts Co-authored-by: Ren Chaturvedi <[email protected]> * Update apps/nextjs/codegen.ts Co-authored-by: Ren Chaturvedi <[email protected]> * Update packages/react/codegen.ts Co-authored-by: Ren Chaturvedi <[email protected]> * Update packages/react/codegen.ts Co-authored-by: Ren Chaturvedi <[email protected]> * Update packages/react/README.md Co-authored-by: Ren Chaturvedi <[email protected]> * Update packages/react/README.md Co-authored-by: Ren Chaturvedi <[email protected]> * Update packages/react/codegen.ts Co-authored-by: Ren Chaturvedi <[email protected]> * Update packages/react/codegen.ts Co-authored-by: Ren Chaturvedi <[email protected]> * Update packages/react/codegen.ts Co-authored-by: Ren Chaturvedi <[email protected]> * Update packages/react/codegen.ts Co-authored-by: Ren Chaturvedi <[email protected]> * Update packages/react/src/codegen.helpers.ts Co-authored-by: Ren Chaturvedi <[email protected]> Co-authored-by: Ren Chaturvedi <[email protected]> * Add a new utility helper for getting the myshopify domain for the site (#70) * [ci] release 2022-10 (#67) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Update all deps except Vitest and ModelViewer (#74) Not vitest because of an issue with the latest version causing us to fail our tests. * Update MediaFile types (#76) * Update MediaFile types * Update packages/react/src/MediaFile.tsx Co-authored-by: Matt Seccafien <[email protected]> * Update packages/react/src/MediaFile.test.tsx Co-authored-by: Ren Chaturvedi <[email protected]> Co-authored-by: Matt Seccafien <[email protected]> Co-authored-by: Ren Chaturvedi <[email protected]> * Add stackblitz links and info to issue template (#72) * Add stackblitz links and info to issue template * Update .github/ISSUE_TEMPLATE/bug_report.md Co-authored-by: Matt Seccafien <[email protected]> * feedback Co-authored-by: Matt Seccafien <[email protected]> * Update ShopifyProvider to have storeDomain match (#78) Add tests, and add some small notes to the upgrade guide. * `CartLinePrice` component (#50) * Improve fixture mocks merging * Migrate `CartLineImage` component * Migrate `CartLinePrice` component * changesets * fix typescript * Update `CartLinePrice` to be consistent with `ProductPrice` * Revert "Migrate `CartLineImage` component" This reverts commit 096f6e57752d8bdfc1571c53856c0817dcc7d2e8. * Update changeset * [ci] release 2022-10 (#77) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Update the types for <Money/> (#80) * Update the types for <Money/> * fix test * Show development warnings only once (#85) * Show client warnings only once * Changeset * Double space * Fix main / module fields in package.json (#87) * update workflow files to not used deprecated apis (#88) * Saving progress (#90) * [ci] release 2022-10 (#81) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * remove file that prevents publishing * Fix/cart optimistic (#93) * fix optimistic UI for CartProvider * Add changeset * add graphql comments, remove duplicated query, add new field names (#94) * Fixes issues with require() calls in non-node envs (#99) Also remove unnecessary "production" conditions as it'll just use the default condition which is the same. * [ci] release 2022-10 (#96) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Add final changelog (#109) * [ci] release 2022-10 (#110) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Final for reals, but with readme updates now (#112) * [ci] release 2022-10 (#113) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Start work on 2023-01 * Update instances in code of 2022-10 * Update the schema and types * Update to shopifyDomain to only provide exactly what is passed in * Deprecated the old metafield parser and updated it to the new way * Update package.json version * Update readmes * Get flattenConnection return types better. (#118) * Readme cleanup a bit * Update all possible deps * [React Storefront Kit]: Rename product, `npm` package, and GitHub repo references (#98) * rename product and package * link * prettier * Update package.json Co-authored-by: Ren Chaturvedi <[email protected]> * Cleanup some naming things, and fix build names and repo names * Remove unneeded note Co-authored-by: Ren Chaturvedi <[email protected]> Co-authored-by: Anthony Frehner <[email protected]> * Documentation setup (#101) * npm script for new system and some test .doc.ts files * updated to v 0.2.7 generate-docs * New docs system (#75) * add ProductPrice doc * add ProductPrice example * add MediaFile doc * add MediaFile example * add Image example * Metafield and update to MediaFile * Add ModelViewer * Add Money * fix metafield and money * fix generation error * add ProductProvider and ShopifyProvider * ShopPayButton * fix ShopifyProvider * update ShopPayButton type and add Video * generate data * some cleanup * update data * Static page docs (#82) * use new folder structure for docs * move doc file * updated some types for landing pages * update to newer version of generate-docs and update content to React Storefront Kit * update to newer version of generate-docs and update content to React Storefront Kit * update to newer version of generate-docs and update content to React Storefront Kit * Update examples to have their own extension Config TS and ESLint so that there aren't any issues with some checks that will always fail in the example files * Update to latest and fix various issues * Updated docs with better names, types, and examples * Cleanup shoppaybutton Co-authored-by: John Collett <[email protected]> Co-authored-by: Ren Chaturvedi <[email protected]> Co-authored-by: John Collett <[email protected]> Co-authored-by: Alex Harvey <[email protected]> * Get publishing back on * update changelog name * Remove migration text * [ci] release 2023-01 (#123) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Small changelog updates * add additional note to contributing * Shopify analytics (#108) * working shopify analytics * add to cart analytics * workign all events * file renames * file paths * lint * lint * fix nextjs app lint * fix nextjs app lint * test for schemas * lint test * fix nextjs app * add analytic-utils tests and refactor (#117) * add analytic-utils tests and refactor * fix name * fix test * add test for coverage * fix no product payload test * @juanpprieto/fix-failing-tests (#120) * add support for parsing complex gids and fix failing test * shorten cond checks * remove incorrect complex id parsing * fix typo * sendShopifyAnalytics tests * better test naming * lint * some PR feedbacks * more PR feedbacks * lint * more test * more test * better name test * @juanpprieto/cookie util test (#121) * fix lint complains * fix weird ts complain * fix format * clean up constants * convert ShopifyCookie to a hook * ts clean up * ts clean up * more ts clean up * more feedback * update ShopPayButton * make sure monorail endpoint can be updated to the shop domain alternative * mock failed response * add doc * prettier * ci browser different? * return explicit type * see if this works * fix type prettier * fix package path * full cookie test * prettier * move shopify cookie constants back into cart constant * missed a return type * Update .changeset/plenty-moles-listen.md Co-authored-by: Anthony Frehner <[email protected]> * remove console log * update exposed methods, constants, and types * prettier * fix file name * fix file name again * Small updates Co-authored-by: Juan P. Prieto <[email protected]> Co-authored-by: Anthony Frehner <[email protected]> * [ci] release 2023-01 (#124) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Update README.md * Update README.md * Fix bug in storefront client. (#125) Update the nextjs app to reflect that Fix issue with latest graphql codegen needing ts-node Add tests * [ci] release 2023-01 (#126) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Update docs and cleanup references (#127) * update(packages): Updated Generate-docs package to solve errors from existing docs (#129) * Updating the docs links to work (#131) Cleaning up naming and editorial stuff. * Adding docs for AddToCart and BuyNow buttons (#132) * generate docs Cleanup package.json Update contributing.md * AddToCartButton * Add BuyNowButton * Update README.md * Adds CartLinePrice and CartCost components to index.ts (#134) * Add cart checkout docs and rearrange index.ts * Add cartcost component * Add CartLinePrice * format readme * Update README.md * Adding docs for cartlineprovider (#141) * getting cartprovider docs up (#142) * getting cartprovider docs up * update name * Graphql ts docs (#143) * Add some graphql and TypeScript related docs for utilities * Delete generated_docs_data.json * Add docs for flatten connection (#144) * Enforce alphabetical exports only in index.ts (#145) * Add parse-metafield docs (#149) * Add parse-metafield docs * Add storefront-client docs as well * fix ci for now * Adding analytics docs (#138) * Adding analytics docs basic setup * Fix doc typing to use the magic generated one * clean up eslint errors and ts errors * break functions into each own files for documentation * move fn back to analytics file and fix up doc * fix up test * add more docs * create doc for constants * more updates * add changeset * fix types * format * lint * rename to shopify constants * fix type again * add related docs * fix type in test * fix types * add type for other const * One more fix --------- Co-authored-by: Helen Lin <[email protected]> * Update the SFAPI docs to use satisfies (#151) * Add useMoney docs (#152) * Add useMoney docs * Revert Money.doc changes * remove ts error in jsx file * Update README.md * update reference landing page (#146) * update landing page (#153) * update landing page * edits * update examples * fix example * format * Update packages/react/docs/staticPages/hook.example.jsx Co-authored-by: Anthony Frehner <[email protected]> * Update packages/react/docs/staticPages/hydrogenReact.doc.ts --------- Co-authored-by: Anthony Frehner <[email protected]> * Fix some documentation issues (#154) * Cleanup some docs and how they're presented (#155) * Update ShopifyProvider with flattened props (#156) * Renaming it again to hydrogen-react (#157) Hopefully the last time... :) * [ci] release 2023-01 (#135) * [ci] release 2023-01 * [ci] release 2023-01 * Add release notes documentation * fix link text * Update packages/react/CHANGELOG.md Co-authored-by: Bret Little <[email protected]> * Update packages/react/CHANGELOG.md Co-authored-by: Bret Little <[email protected]> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Anthony Frehner <[email protected]> Co-authored-by: Bret Little <[email protected]> * remove duplicated info * Update the umd global variable name (#159) * Update the umd global variable name * add changeset * Tweak docs (#161) * Make better button docs (#164) * Tweak docs 2 (#163) * Update the docs for any Money-related components (#165) * Last bit of small cleanup (#166) * Fix flattenConnection doc (#168) * Landing page fixes (#167) * new landing page for react hydrogen * more changes to the landing page * undo changes to generated_docs_data * updated generated content with new version * fixed some rogue commas * updated generation * fix links to storefront schema (#169) * fix links to storefront schema * update generated file * storefront-api-types link * landing page typo (#170) * Update README.md * Deprecate CartLinePrice (#173) * Deprecate CartLinePrice * cleanup changelog * Fix some docs (#175) * Lint updates (#174) * migrate to just be in the package alone * Ignore or fix lint errors * Add explicit return types on functions only for source code * Configure turbo to run eslint in each package * Get linting working on the react package * Get tests to pass by preserving the act behavior as it was before * Migrate cartlinequantityadjustbutton (#180) * Start migration of CartLineQuantityAdjustButton Co-Authored-By: Jason Kurian <[email protected]> * Get CartLineQuantity typescript tests passing * Update tests for CartLineQuantityAdjustButton to use RTL Fix a couple instances of unnecessary "data-testId" camel casing. Update BuyNowButton tests to use a shared utility Co-Authored-By: Jason Kurian <[email protected]> * Add attributes to linesUpdate() so that they're not lost When adjusting the quantity. * Add documentation for the components * Update docs icons * Small update to PR template * Allow dev to disable manually if they want. * Make the typing DX better for these keys --------- Co-authored-by: Jason Kurian <[email protected]> * [ci] release 2023-01 (#160) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Updating the readmes to use the official docs more (#182) * Fix two small docs issues (#183) * Fix two small docs issues * fix the source and run the build-docs command * Fix UMD builds by defining process.env.NODE_ENV (#188) * Fix bug in storefront-client checking on the server (#195) * Fix issue with props on cartlinequantityadjustbutton (#196) * Update all the deps besides model-viewer (#199) * Update all the deps besides model-viewer * Create lazy-dolphins-develop.md * Npm migration (#201) * use package-lock * Migrate tooling to use npm * Fix some commands to use npx; add changelog * [ci] release 2023-01 (#197) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * prep for migration and renaming to hydrogen-react * step 1: migrated hydrogen-react source code Updated package.json Verified that most of the package scripts in hydrogen-react work. * Get the dev command working from monorepo root * dev scripts working with reloads * CI checks are passing locally for the most part Waiting on Matt's updates to the hydrogen tests to work in other timezones before this is 100% done. * Get ci:checks script working * Update docs and readme for new repo location * Update issue templates to better include hydrogen-react And other tools, too! * Update Hydrogen readme to make room for multiple packages Graham did most of the work here 😄 Co-Authored-By: Graham F. Scott <[email protected]> * Add a versioning section * update entry.server.tsx based on new remix template * Revert "update entry.server.tsx based on new remix template" This reverts commit 7ef939e. * Update README.md Co-authored-by: Daniel Rios <[email protected]> * PR feedback * remove npm version * triggering a revalidation maybe? * Revert "triggering a revalidation maybe?" This reverts commit d85ba01. * try with turbo platform workaround? --------- Co-authored-by: Ren Chaturvedi <[email protected]> Co-authored-by: Elise Yang <[email protected]> Co-authored-by: Elise Yang <[email protected]> Co-authored-by: Daniel Rios <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Elise Yang <[email protected]> Co-authored-by: Matt Seccafien <[email protected]> Co-authored-by: Bret Little <[email protected]> Co-authored-by: Daniel Rios <[email protected]> Co-authored-by: Fran Dios <[email protected]> Co-authored-by: Michelle Vinci <[email protected]> Co-authored-by: John Collett <[email protected]> Co-authored-by: John Collett <[email protected]> Co-authored-by: Alex Harvey <[email protected]> Co-authored-by: Helen Lin <[email protected]> Co-authored-by: Juan P. Prieto <[email protected]> Co-authored-by: Jason Kurian <[email protected]> Co-authored-by: Graham F. Scott <[email protected]>
No description provided.