profile
viewpoint
Lucas Cordeiro lucasecdb VTEX Brazil Web enthusiast, working as a Software Engineer at @vtex.

lucasecdb/cramkle 5

Flashcard-based studying app

lucasecdb/convideo 3

Simple web-based video converter tool

lucasecdb/dotvim 2

Personal vim config and plugins

lucasecdb/react-tab-controller 1

Roving tabIndex utility for React components

lucasecdb/apollo-client 0

:rocket: A fully-featured, production ready caching GraphQL client for every UI framework and GraphQL server

lucasecdb/DefinitelyTyped 0

The repository for high quality TypeScript type definitions.

lucasecdb/dotfiles 0

Personal configuration files

lucasecdb/draft-js 0

A React framework for building text editors.

lucasecdb/emacs.d 0

Emacs config files

push eventlucasecdb/dotfiles

Lucas Cordeiro

commit sha abedaede186160734e85c8bcb35818688b42d926

migrate install script to python

view details

push time in 3 hours

push eventlucasecdb/dotfiles

Lucas Cordeiro

commit sha 90d6f813f9f88fbe0c867083b569a52fa4efae62

add iterm config

view details

push time in 4 hours

push eventvtex-apps/checkout-step-group

Lucas Cordeiro

commit sha 99026778fd222f6e507c9284d3005d1bed30ec31

add missing assets builder

view details

push time in a day

create barnchvtex-apps/checkout-step-group

branch : feat/identification-page

created branch time in a day

create barnchvtex-apps/checkout

branch : feat/identification

created branch time in a day

PR opened vtex-apps/checkout-step-group

Add components for default steps

What problem is this solving?

Adds the necessary components for the default steps included in the standard checkout experience: Profile, Shipping and Payment. Currently they just render default values, and do not include a form and any logic to interact with the orderForm, but the idea is to evolve them to do this. :-)

How should this be manually tested?

Workspace

Checklist/Reminders

  • [ ] Updated README.md.
  • [x] Updated CHANGELOG.md.
  • [ ] Linked this PR to a Clubhouse story (if applicable).
  • [ ] Updated/created tests (important for bug fixes).
  • [ ] Deleted the workspace after merging this PR (if applicable).

Type of changes

<!--- Add a ✔️ where applicable -->

✔️ Type of Change
_ Bug fix <!-- a non-breaking change which fixes an issue -->
✔️ New feature <!-- a non-breaking change which adds functionality -->
_ Breaking change <!-- fix or feature that would cause existing functionality to change -->
_ Technical improvements <!-- chores, refactors and overall reduction of technical debt -->
+179 -0

0 comment

7 changed files

pr created time in a day

create barnchvtex-apps/checkout-step-group

branch : feat/default-steps

created branch time in a day

push eventvtex-apps/checkout

nandoacoelho

commit sha 283ba4f1380b19ca5a5428a945f73bbb92392b54

Add github templates

view details

nandoacoelho

commit sha 35dfa60eec1485e64e8d1391fc6040507e8672d7

Add new checkout setup files

view details

nandoacoelho

commit sha e9e85765cd69884cfe58c4ec1ade787c5740b0b8

Update node dependencies

view details

Fernando Coelho

commit sha 6695acd2904ca50ada8a595793ec68532dbea5b0

Merge pull request #15 from vtex-apps/feature/checkout-major Change this repository to be the new store checkout main app

view details

omninando

commit sha b21bdf3da99486381f260fb093d276b799c1756c

Release v1.0.1

view details

Darlene

commit sha 3da6e12fcb8f2f9470cdc1f058425ff7e9e9861e

Add project architecture to README

view details

Darlene

commit sha 9becef052ed28c2560b405a06d366cadbb955abe

Add repo links to README

view details

Marcos Kawakami

commit sha 3264461e06bcdda97c6c7e0b954710b98766e0e8

Update readme

view details

Marcos Kawakami

commit sha 401e017c5df2bc092445a5d923834c7e42affd18

Merge pull request #17 from vtex-apps/chore/readme Update readme

view details

Marcos Kawakami

commit sha 5241ebd7d699001ddc8f5178f98df13e1dc34673

Update readme

view details

Marcos Kawakami

commit sha 0622cee9dbac9d0c6dfb844e9c17e1330c30a340

Merge pull request #18 from vtex-apps/marcoskwkm-patch-1 Update readme

view details

Sávio Muniz

commit sha 155f11e6cd9faecd8c557b823513ca1b221fbdaa

Migration to VTEX IO docs expected format

view details

Sávio Muniz

commit sha 09276e4f11817bad9a3ef57d03a007f946b96259

Added docs builder to manifest

view details

Darlene

commit sha faf9914e7ceaef290a7e677925f396a97d4e02cb

Remove README from root since it was moved to /docs

view details

Darlene Medeiros

commit sha 78ec642bf0efbcb604cae7647b9235ae35f11261

Merge pull request #16 from vtex-apps/feature/docs-migration Docs structure migration

view details

nandoacoelho

commit sha e809692e25460d4386961aa07acb6181ecf6358b

Added settings schema for v6 to identify checkout io is installed

view details

Fernando Coelho

commit sha aa62e9c7a73a3d016a7e03755f18449e0128201b

Merge pull request #19 from vtex-apps/feature/checkout-io-cart Added settings schema for v6 to identify checkout io is installed

view details

omninando

commit sha 3248d868983e008bbf84f3e1f760ce097c512786

Release v1.0.2

view details

Marcos Kawakami

commit sha 7edfa37267ea6c99f7a9efd83c93fcc9809f1c58

Add route /cart/add/ that allows adding items via query string

view details

Marcos Kawakami

commit sha a34f4243c68638ca2a490cc0ef2e618a28c58e73

Merge pull request #20 from vtex-apps/feature/add-url Add route /cart/add/ that allows adding items via query string

view details

push time in a day

push eventvtex-apps/checkout

Lucas Cordeiro

commit sha c7ab00f34222e105c7af13a401b98604cbee550f

update dependencies

view details

Lucas Cordeiro

commit sha 8239d754f23fe437015e89c1a0e644d65cbe2deb

remove messages builder

view details

Lucas Cordeiro

commit sha 15abcb065cb438611c8878c6699779a440dd97bf

add checkout-container route and interfaces

view details

Lucas Cordeiro

commit sha 81e59354bf2c11a38cc1d635deabf841e427fa7d

add empty header and footer

view details

Lucas Cordeiro

commit sha 8a199dc60374e702788830ee22a8f3390ad02f2e

outline some changes in the README

view details

Lucas Cordeiro

commit sha 3a9f37842202a299b6c9e39c3fd9fb4e7ac9da8f

update changelog

view details

Lucas Cordeiro

commit sha 40f2f43b77c15425160893bb13c68b262c4ec0ff

Merge pull request #21 from vtex-apps/feat/new-checkout Add route for the new Checkout

view details

push time in a day

delete branch vtex-apps/checkout

delete branch : feat/new-checkout

delete time in a day

PR merged vtex-apps/checkout

Add route for the new Checkout

What problem is this solving?

Adds the route to point to the new Checkout implementation.

Related clubhouse epic.

How should this be manually tested?

Workspace

Checklist/Reminders

  • [x] Updated README.md.
  • [x] Updated CHANGELOG.md.
  • [x] Linked this PR to a Clubhouse story (if applicable).
  • [ ] Updated/created tests (important for bug fixes).
  • [ ] Deleted the workspace after merging this PR (if applicable).

Type of changes

<!--- Add a ✔️ where applicable -->

✔️ Type of Change
_ Bug fix <!-- a non-breaking change which fixes an issue -->
✔️ New feature <!-- a non-breaking change which adds functionality -->
_ Breaking change <!-- fix or feature that would cause existing functionality to change -->
_ Technical improvements <!-- chores, refactors and overall reduction of technical debt -->
+77 -19

2 comments

12 changed files

lucasecdb

pr closed time in a day

push eventvtex-apps/checkout

Lucas Cordeiro

commit sha 3a9f37842202a299b6c9e39c3fd9fb4e7ac9da8f

update changelog

view details

push time in a day

delete branch vtex-apps/checkout-step-group

delete branch : feat/add-components

delete time in a day

push eventvtex-apps/checkout-step-group

Lucas Cordeiro

commit sha f879f47ce25fee3961470f43c3c8a2c44f5a385b

add step and step-group components

view details

Lucas Cordeiro

commit sha 2b2bd46df18836258f163faf45d19c84cefbaeea

update changelog

view details

Lucas Cordeiro

commit sha 7d8149bbca5385117ad08c3f645748f3b789671b

add docs builder

view details

Lucas Cordeiro

commit sha dafbd2027dd75e744d387dc77cc5761003363d45

add component blocks interfaces

view details

Lucas Cordeiro

commit sha dff5deed208d4ad3103e4b90e693306d7f38f9cc

add pr template

view details

Lucas Cordeiro

commit sha 8d5abd4c61331512e2c4b7ddac2f8bc947478baf

add css handles and update lint config

view details

Lucas Cordeiro

commit sha 3b45f2258fee0bfde15664d86edd371560bb6c13

add nodejs typings

view details

Lucas Cordeiro

commit sha bf07dcb100e1e45240389ddd2d997bbd84a8f637

add composition children to interfaces

view details

Lucas Cordeiro

commit sha 4dda265c10df335ce0f4c5c56b0cdc8d5d697352

add more config files

view details

Lucas Cordeiro

commit sha 8a1ae03b1ff86f19350785dd698d5736fdc16242

center step number correctly

view details

Lucas Cordeiro

commit sha 2a5592e36cf8d5b541720f3957f28bfacc4aa40a

add unregister callback and call on cleanup phase

view details

Lucas Cordeiro

commit sha 3ed302996008c81ec93abaced7d86a5afbfdb18a

use descendants pattern for step component and add checkout label

view details

Lucas Cordeiro

commit sha 51aefa1414c0450fec4f5d7e1401fc2acc00d9c3

update steps styles

view details

Lucas Cordeiro

commit sha 05ff9bf1c2e352fbaf2ea9bec4199d0fe6ddc21a

update parent on child update and add active prop to step

view details

Lucas Cordeiro

commit sha 4b007d299b7ff93a16fe4b4ed7893eb71a21f804

add classnames dependency

view details

Lucas Cordeiro

commit sha 339fbd5af162c4e39e4456aac3fc2e6477ba1434

update typings

view details

Lucas Cordeiro

commit sha a2f0b97c04471a852ec5e378fa067414b69ef431

update comments

view details

Lucas Cordeiro

commit sha e30cf7be9707e1a7ccb0b675ff65ca62591dc385

Merge pull request #1 from vtex-apps/feat/add-components Add StepGroup and Step components

view details

push time in a day

PR merged vtex-apps/checkout-step-group

Reviewers
Add StepGroup and Step components

What problem is this solving?

Adds the initial version of the StepGroup and Step components, and their respective blocks interfaces.

Related clubhouse story

How should this be manually tested?

Workspace

Checklist/Reminders

  • [ ] Updated README.md.
  • [x] Updated CHANGELOG.md.
  • [x] Linked this PR to a Clubhouse story (if applicable).
  • [ ] Updated/created tests (important for bug fixes).
  • [ ] Deleted the workspace after merging this PR (if applicable).

Screenshots or example usage

image

Type of changes

<!--- Add a ✔️ where applicable -->

✔️ Type of Change
_ Bug fix <!-- a non-breaking change which fixes an issue -->
✔️ New feature <!-- a non-breaking change which adds functionality -->
_ Breaking change <!-- fix or feature that would cause existing functionality to change -->
_ Technical improvements <!-- chores, refactors and overall reduction of technical debt -->
+1761 -10484

4 comments

17 changed files

lucasecdb

pr closed time in a day

push eventvtex-apps/checkout-step-group

Lucas Cordeiro

commit sha a2f0b97c04471a852ec5e378fa067414b69ef431

update comments

view details

push time in a day

Pull request review commentvtex-apps/checkout-step-group

Add StepGroup and Step components

+import classNames from 'classnames'+import React, { useEffect, useLayoutEffect, useRef } from 'react'++import { useStepContext } from './StepGroup'++const useStepIndicator = (elementRef: React.RefObject<HTMLLIElement>) => {+  const indexRef = useRef<number>(-1)+  const { assigning, items, updateParent, ...context } = useStepContext()++  useLayoutEffect(() => {+    if (!assigning.current) {+      return+    }++    indexRef.current = items.current.push(elementRef.current!) - 1+    updateParent()+  })++  return {+    // first render its wrong, after a forceUpdate in parent useLayoutEffect it's+    // right, and its all synchronous so we don't get any flashing

nice

lucasecdb

comment created time in a day

Pull request review commentvtex-apps/checkout-step-group

Add StepGroup and Step components

+import React, {+  useMemo,+  useRef,+  useContext,+  useLayoutEffect,+  useCallback,+  useState,+} from 'react'+import { useCssHandles } from 'vtex.css-handles'++/**+ * The component below is implemented following the "guidelines" of+ * this [1] gist. It is known that creating compound components in React+ * that have a strong relation of parent-child (like a select and their+ * option's) is hard, and there is currently no good way to implement this+ * because of the lack of primitives in the library.+ *+ * [1] https://gist.github.com/ryanflorence/10e9387f633f9d2e6f444a9bddaabf6e+ */++interface StepContext {+  items: React.MutableRefObject<HTMLLIElement[]>+  assigning: React.MutableRefObject<boolean>+}++const ctx = React.createContext<StepContext | undefined>(undefined)++const useForceUpdate = (): [object, () => void] => {+  const [sentinel, setSentinel] = useState<object>({})++  return [+    sentinel,+    useCallback(() => {+      setSentinel({})+    }, []),+  ]+}++export const useStepContext = () => {+  const value = useContext(ctx)++  if (!value) {+    throw new Error('useStepContext must be used inside a <StepGroup />')+  }++  return value+}++const classes = ['stepGroupWrapper', 'stepGroupList']++const StepGroup: React.FC = ({ children }) => {+  const assigning = useRef(true)++  const [sentinel, forceUpdate] = useForceUpdate()+  const stepListRef = useRef<HTMLLIElement[]>([])++  const cssHandles = useCssHandles(classes)++  useLayoutEffect(() => {+    if (assigning.current) {+      // At this point all of the children have pushed into the array so we set+      // assigning to false and force an update. Since we're in+      // useLayoutEffect, we won't get a flash of rendered content, it will all+      // happen synchronously. And now that this is false, children won't push+      // into the array on the forceUpdate      assigning.current = false

ohhhh, so there it were..

lucasecdb

comment created time in a day

push eventvtex-apps/checkout-step-group

Lucas Cordeiro

commit sha 339fbd5af162c4e39e4456aac3fc2e6477ba1434

update typings

view details

push time in a day

Pull request review commentvtex-apps/checkout-payment

Feature/internationalization

 const Payment: React.FC = () => {   }    return (-    <div>-      <iframe-        title="card-form-ui"-        width="400px"-        height="300px"-        src={iframeURL}-        onLoad={() => setupIframe()}-        ref={iframeRef}-      />-      {cardData && <p>{JSON.stringify(cardData)}</p>}+    <div className="relative">+      {iframeLoading && (+        <div className="absolute top-0 left-0 right-0 bottom-0 bg-white-70 z-1 flex items-center justify-center">+          <Spinner />+        </div>+      )}+      <div className="flex-none">+        <div className="">

is this className needed?

        <div>
pedromtec

comment created time in a day

push eventvtex-apps/checkout

Lucas Cordeiro

commit sha 8a199dc60374e702788830ee22a8f3390ad02f2e

outline some changes in the README

view details

push time in a day

PR opened vtex-apps/checkout

Add route for the new Checkout

What problem is this solving?

Adds the route to point to the new Checkout implementation.

Related clubhouse epic.

How should this be manually tested?

Workspace

Checklist/Reminders

  • [x] Updated README.md.
  • [x] Updated CHANGELOG.md.
  • [x] Linked this PR to a Clubhouse story (if applicable).
  • [ ] Updated/created tests (important for bug fixes).
  • [ ] Deleted the workspace after merging this PR (if applicable).

Type of changes

<!--- Add a ✔️ where applicable -->

✔️ Type of Change
_ Bug fix <!-- a non-breaking change which fixes an issue -->
✔️ New feature <!-- a non-breaking change which adds functionality -->
_ Breaking change <!-- fix or feature that would cause existing functionality to change -->
_ Technical improvements <!-- chores, refactors and overall reduction of technical debt -->
+59 -12

0 comment

10 changed files

pr created time in a day

push eventvtex-apps/order-manager

Lucas Cordeiro

commit sha 5a519f3ba83c0fa51b3d9d8a1b031fb9c2d9f703

remove duplicate eslint config files

view details

Lucas Cordeiro

commit sha cce8899d167740941f1ed068a5e2d3f4914fc538

add back check for local orderform id

view details

push time in a day

Pull request review commentvtex-apps/order-manager

Update local orderForm when ids differ from server

 export const OrderFormProvider: FC = ({ children }) => {     const localOrderFormString = localStorage.getItem('orderform')      if (localOrderFormString != null) {-      const localOrderForm = JSON.parse(localOrderFormString)--      if (localOrderForm.value !== UNSYNC_ORDER_FORM_VALUE) {+      const localOrderForm = JSON.parse(localOrderFormString) as OrderForm++      if (+        localOrderForm.value !== UNSYNC_ORDER_FORM_VALUE &&+        (!data ||+          data.orderForm.id === localOrderForm.id ||+          localOrderForm.id === DEFAULT_ORDER_FORM.id)

I was trying to write a test to cover this case but the logic for adding the item and creating the task to insert in the queue is in order-items :-(

lucasecdb

comment created time in a day

Pull request review commentvtex-apps/order-manager

Update local orderForm when ids differ from server

 export const OrderFormProvider: FC = ({ children }) => {     const localOrderFormString = localStorage.getItem('orderform')      if (localOrderFormString != null) {-      const localOrderForm = JSON.parse(localOrderFormString)--      if (localOrderForm.value !== UNSYNC_ORDER_FORM_VALUE) {+      const localOrderForm = JSON.parse(localOrderFormString) as OrderForm++      if (+        localOrderForm.value !== UNSYNC_ORDER_FORM_VALUE &&+        (!data ||+          data.orderForm.id === localOrderForm.id ||+          localOrderForm.id === DEFAULT_ORDER_FORM.id)

confirmed, it doesn't work if you add items when offline and go back online with a page refresh. it briefly removes all the items of the cart

lucasecdb

comment created time in a day

push eventvtex-apps/order-manager

Lucas Cordeiro

commit sha 94169478a3a6416f9d07a19343e4e6334422cbf8

remove check with default order form id

view details

push time in a day

push eventvtex-apps/order-manager

Lucas Cordeiro

commit sha 0696a38a4e824b6322ca6dcaf9bf1d2cd9ca188f

swap conditions around

view details

push time in a day

push eventvtex-apps/order-manager

Lucas Cordeiro

commit sha 8eb9dfacdebaac65332e0d228f408384d511ed4d

update tests comparison

view details

Lucas Cordeiro

commit sha 26b1a33d9272382706215a451d062ad8810efc43

switch conditions around

view details

push time in a day

Pull request review commentvtex-apps/order-manager

Update local orderForm when ids differ from server

 export const OrderFormProvider: FC = ({ children }) => {     const localOrderFormString = localStorage.getItem('orderform')      if (localOrderFormString != null) {-      const localOrderForm = JSON.parse(localOrderFormString)--      if (localOrderForm.value !== UNSYNC_ORDER_FORM_VALUE) {+      const localOrderForm = JSON.parse(localOrderFormString) as OrderForm++      if (+        localOrderForm.value !== UNSYNC_ORDER_FORM_VALUE &&+        (!data ||+          data.orderForm.id === localOrderForm.id ||+          localOrderForm.id === DEFAULT_ORDER_FORM.id)

if you add an item while offline and it didn't synchronize with the server yet, but maybe in this case it doesn't make much sense.

lucasecdb

comment created time in a day

Pull request review commentvtex-apps/order-manager

Update local orderForm when ids differ from server

 describe('OrderForm', () => {     })     expect(getByText('Mirai zura!')).toBeTruthy()   })++  it('should replace local order form if their ids differ', async () => {+    localStorage.setItem('orderform', JSON.stringify(mockOrderForm))++    const orderFormMockQuery = {+      request: {+        query: OrderForm,+      },+      result: {+        data: {+          orderForm: {+            id: 'new-order-form',+            items: [],+            value: 0,+          },+        },+      },+    }++    const Component: FunctionComponent = () => {+      const { orderForm } = useOrderForm()++      return (+        <ul>+          {orderForm.items?.map(item => (+            <li key={item.id}>{item.name}</li>+          ))}+        </ul>+      )+    }++    // we're testing the side effect, so we won't need+    // to query the document+    render(+      <OrderFormProvider>+        <Component />+      </OrderFormProvider>,+      { graphql: { mocks: [orderFormMockQuery] } }+    )++    await wait(() => jest.runAllTimers())++    expect(JSON.parse(localStorage.getItem('orderform')!).id).not.toBe(

makes sense! I'll update

lucasecdb

comment created time in a day

PR opened vtex-apps/order-manager

Update local orderForm when ids differ from server

What problem is this solving?

After you finish your order, the local orderForm won't be updated to use a "new" one, since the we were giving priority to using the local one instead of the OF sent from the API, resulting in the user having the same cart as they had before they finished the order even though it shouldn't.

To fix this, we will now replace the local orderForm with the value from the server if the id from the local OF is different from the one sent from the server.

Related Clubhouse story.

How should this be manually tested?

Workspace.

  • Add some items to your cart.
  • Proceed to checkout and finish your order.
  • On the order placed screen, your cart should change from the number of items added to zero.

Checklist/Reminders

  • [ ] Updated README.md.
  • [x] Updated CHANGELOG.md.
  • [x] Linked this PR to a Clubhouse story (if applicable).
  • [x] Updated/created tests (important for bug fixes).
  • [ ] Deleted the workspace after merging this PR (if applicable).

Type of changes

<!--- Add a ✔️ where applicable -->

✔️ Type of Change
✔️ Bug fix <!-- a non-breaking change which fixes an issue -->
_ New feature <!-- a non-breaking change which adds functionality -->
_ Breaking change <!-- fix or feature that would cause existing functionality to change -->
_ Technical improvements <!-- chores, refactors and overall reduction of technical debt -->
+58 -3

0 comment

5 changed files

pr created time in a day

create barnchvtex-apps/order-manager

branch : fix/renew-orderform

created branch time in a day

delete branch vtex-apps/add-to-cart-button

delete branch : chore/update-changelog

delete time in 2 days

push eventvtex-apps/add-to-cart-button

Lucas Cordeiro

commit sha 4dcac0aa6196e8276232f8a6739a87626d3ce95a

update changelog

view details

Lucas Cordeiro

commit sha 0a2dc9e5c8a3c3a375a5635b9943970b53b86b28

Merge pull request #10 from vtex-apps/chore/update-changelog Update changelog for version 0.5.0

view details

push time in 2 days

PR merged vtex-apps/add-to-cart-button

Reviewers
Update changelog for version 0.5.0

I forgot to update the CHANGELOG for version 0.5.0

:shame: ~on me~

+2 -0

2 comments

1 changed file

lucasecdb

pr closed time in 2 days

create barnchvtex-apps/checkout-resources

branch : feat/profile-query

created branch time in 2 days

push eventvtex/address-form

Lucas Cordeiro

commit sha 65d101729d9f49ef248b551bfc1a075ec52b550d

fix stale address not updated on componentDidUpdate

view details

Lucas Cordeiro

commit sha 7f781177af39edf283b63a9f581570bfdee70298

revert react-intl upgrade by toolbelt

view details

Lucas Cordeiro

commit sha 5d32eb1042f681c698b6c5b961c8659e321707e1

add unit test

view details

Lucas Cordeiro

commit sha 9a4a708f22b4936778a61f430975dc636e6ec9c5

Release v4.5.1

view details

Lucas Cordeiro

commit sha 5376e2e452c406f03aae925d30c01d92977342f5

Merge pull request #239 from vtex/chore/address-update-4-x 4.x: Update address on component update

view details

push time in 2 days

delete branch vtex/address-form

delete branch : chore/address-update-4-x

delete time in 2 days

PR merged vtex/address-form

4.x: Update address on component update

What is the purpose of this pull request?

Update branch 4.x with the changes from #237.

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Requires change to documentation, which has been updated accordingly.
+73 -14

1 comment

7 changed files

lucasecdb

pr closed time in 2 days

created tagvtex/address-form

tagv4.5.1

A React component that renders VTEX's address forms

created time in 2 days

push eventvtex/address-form

Lucas Cordeiro

commit sha 9a4a708f22b4936778a61f430975dc636e6ec9c5

Release v4.5.1

view details

push time in 2 days

PR opened vtex-apps/add-to-cart-button

Update changelog for version 0.5.0

I forgot to update the CHANGELOG for version 0.5.0

:shame: ~on me~

+2 -0

0 comment

1 changed file

pr created time in 2 days

create barnchvtex-apps/add-to-cart-button

branch : chore/update-changelog

created branch time in 2 days

delete branch vtex-apps/add-to-cart-button

delete branch : feat/offline

delete time in 2 days

push eventvtex-apps/add-to-cart-button

Lucas Cordeiro

commit sha a9f81a4b532918695447b9a65f0fa5557a8a3f50

add eslint and typings setup

view details

Lucas Cordeiro

commit sha b397f34c784cf3c383a776f8d09b9e32617f7d13

use addItem from order items context instead of mutation

view details

Lucas Cordeiro

commit sha b7eb654e0d6e8b53aa9f617f65171be9489b39ff

remove custom typings

view details

Lucas Cordeiro

commit sha 532f7c4183d1742337adc2effdad2a151a6060d1

upgrade react-intl lib

view details

Lucas Cordeiro

commit sha 6814ecbe26c2e5ba71eda7529732e984a955a416

use return value of addItem to change toast message

view details

Lucas Cordeiro

commit sha 39ddffca40bff11d020f888ba2dfede5424fdf6f

Merge pull request #9 from vtex-apps/feat/offline Update to use addItem function from order items

view details

push time in 2 days

PR merged vtex-apps/add-to-cart-button

Update to use addItem function from order items

What does this PR do?

Updates the component to use the addItem function from the OrderItems context, so it will have all offline functionality related to it.

How to test it?

Workspace

Related to / Depends on

vtex-apps/order-manager#26 vtex-apps/order-items#15

+280 -208

3 comments

11 changed files

lucasecdb

pr closed time in 2 days

push eventvtex-apps/order-items

Lucas Cordeiro

commit sha 192bd927e426526225a50a036c80126f2e962443

add config and typings from 'vtex setup'

view details

Lucas Cordeiro

commit sha e5c9f42eb7b2663ceab30f479d28093bbc071702

add 'addItem' function to context

view details

Lucas Cordeiro

commit sha 8fa5de20c43c81a7ce2e0d16dcc833bed130019b

add eslint and typings config

view details

Lucas Cordeiro

commit sha ba81755fdd1585bd232c1783d2f84648f1b51fce

add addItem function to context and support for offline

view details

Lucas Cordeiro

commit sha ad263958d4c887c44c6715caa7079d85796a9ddc

update changelog

view details

Lucas Cordeiro

commit sha dc3bd7c4bb17e06a85fd480a44c0f60611b0bab8

update uniqueId from items after mutation success

view details

Lucas Cordeiro

commit sha 06b054ec15d227329dd9fc687b2c896dce59ff28

fix item quantity not being updated

view details

Lucas Cordeiro

commit sha 3a3bef9eb986503d55e53d8f20cde4cc95c5afa2

propagate uniqueId update to local queue

view details

Lucas Cordeiro

commit sha d3ea5d8ca7ddc44b5251dab0d66577c31e71290d

read uniqueId value from ref to get latest value

view details

Lucas Cordeiro

commit sha 15181efe07d3341ad5ae3ceebf8b5268285fb376

fix removing item when offline

view details

Lucas Cordeiro

commit sha 6c6059d9ccde6fe111225653a6410bdbd9e54a20

remove custom typings

view details

Lucas Cordeiro

commit sha f0b6561ee6aca02a4e0939803e6914b29ea2edcf

fix prettier

view details

Lucas Cordeiro

commit sha d088b2e2455192054e6af266044d85d224b75518

upgrade vtex test-tools

view details

Lucas Cordeiro

commit sha 285bc3a98f75c8433dc5edb4bf1b96c4c87d6231

fix tests

view details

Lucas Cordeiro

commit sha 5f6b14c20e1b7ffaf75571702030fdc3166c3843

update wording on changelog

view details

Lucas Cordeiro

commit sha 11ece3283b77ebca020b445a1c5534d2eb8eb5c3

use negative value for discount variables

view details

Lucas Cordeiro

commit sha f449ef2b209821da589895eacaab862e94f41a17

flip logic when filtering operations during uniqueId updates

view details

Lucas Cordeiro

commit sha 14340fa23f413cb8bd5fe4a8fe64af01575c6392

update comment wording and add more info to error message

view details

Lucas Cordeiro

commit sha 4eea16e44d07a9c5a343bef1718251ace44edf88

pop operation from queue on error

view details

Lucas Cordeiro

commit sha abc4046b089362bc81def51696cc507c3b3800f5

update setup

view details

push time in 2 days

delete branch vtex-apps/order-items

delete branch : feat/offline

delete time in 2 days

PR merged vtex-apps/order-items

Add support for offline and addItem function

What problem is this solving?

This pull request adds support for offline operations on the functions of OrderItemsContext. We are using the same strategy of a "task queue" to handle the operations sequentially, but we will also update and save the order form locally.

To enable instant feedback, we will calculate the next state of the order form given the current operation being executed (add item, update or remove) and save to the current state of the component (OrderFormContext in vtex.order-manager). Then, we will create a task and enqueue it to the Task Queue, and save the queue on local storage (in case the user closes the tab before our mutation finishes, or they go offline). When the mutation finishes, and the queue has no operations left, we will use the order form value from the response to update the state, so it matches our server (this is the current behaviour).

Related clubhouse story.

How should this be manually tested?

Workspace

Checklist/Reminders

  • [ ] Updated README.md.
  • [x] Updated CHANGELOG.md.
  • [x] Linked this PR to a Clubhouse story (if applicable).
  • [ ] Updated/created tests (important for bug fixes).
  • [ ] Deleted the workspace after merging this PR (if applicable).

Type of changes

<!--- Add a ✔️ where applicable -->

✔️ Type of Change
_ Bug fix <!-- a non-breaking change which fixes an issue -->
✔️ New feature <!-- a non-breaking change which adds functionality -->
_ Breaking change <!-- fix or feature that would cause existing functionality to change -->
_ Technical improvements <!-- chores, refactors and overall reduction of technical debt -->
+4049 -1447

22 comments

20 changed files

lucasecdb

pr closed time in 2 days

push eventvtex-apps/order-items

Lucas Cordeiro

commit sha 8e965f16a6d89ebfbac552878eb428fd0da2b75b

fix typo and update mock

view details

push time in 2 days

push eventvtex-apps/checkout-step-group

Lucas Cordeiro

commit sha 4b007d299b7ff93a16fe4b4ed7893eb71a21f804

add classnames dependency

view details

push time in 2 days

push eventvtex-apps/checkout-step-group

Lucas Cordeiro

commit sha 05ff9bf1c2e352fbaf2ea9bec4199d0fe6ddc21a

update parent on child update and add active prop to step

view details

push time in 3 days

push eventvtex-apps/checkout

Lucas Cordeiro

commit sha 81e59354bf2c11a38cc1d635deabf841e427fa7d

add empty header and footer

view details

push time in 3 days

push eventvtex-apps/checkout-step-group

Lucas Cordeiro

commit sha 51aefa1414c0450fec4f5d7e1401fc2acc00d9c3

update steps styles

view details

push time in 3 days

push eventvtex-apps/checkout-step-group

Lucas Cordeiro

commit sha 3ed302996008c81ec93abaced7d86a5afbfdb18a

use descendants pattern for step component and add checkout label

view details

push time in 3 days

create barnchvtex-apps/checkout

branch : feat/new-checkout

created branch time in 3 days

push eventvtex-apps/order-items

Lucas Cordeiro

commit sha f63a3f1d4d915b173ef9846818027060b9c9dc98

setup with new order-manager version

view details

push time in 3 days

push eventvtex-apps/order-manager

Lucas Cordeiro

commit sha c9880b6c1273295fc99f6bd58fc0db24f3ffe5a9

update lint config and remove unused packages

view details

Lucas Cordeiro

commit sha df47c9207d6a6f3250d34bfd4d941bc654339da8

save order form locally

view details

Lucas Cordeiro

commit sha 7f388e586101ac675e5fb9648d9eb1aa6d49100c

update changelog

view details

Lucas Cordeiro

commit sha 3c93b1a69c4765d31d6f331018c08cbd47e87616

wip: add some tests

view details

Lucas Cordeiro

commit sha e5d9474da6b403ce859fba70a9f51d83203c504b

add id to default order form

view details

Lucas Cordeiro

commit sha 4b88281726423fa697dc2858a9b9dfe143726572

fix tests

view details

Lucas Cordeiro

commit sha 71d39103c4cce4f8c397738c848de9bea2419dce

fix lint and typings

view details

Lucas Cordeiro

commit sha fd9f508d38650d0408f1c47e99350dbd5a9e5f8b

fix typo

view details

Lucas Cordeiro

commit sha 13a8f64363d504d0c73baa750e566b8ed8a71f52

update apollo cache on order form update

view details

Lucas Cordeiro

commit sha 9d69fb61a310a5257cf76c0b7c11542d2958cf7a

fix read from apollo cache

view details

Lucas Cordeiro

commit sha 55ad0a8f570cff7381387e60482e1d0bd1a000dd

update queue to be network-aware

view details

Lucas Cordeiro

commit sha 92a642560ac73352cf29bb764f2d3a6dfc88e3e9

remove update cache call on order form update

view details

Lucas Cordeiro

commit sha d24b9c034f08f87232caab10a088c1981020fb2c

update types

view details

Lucas Cordeiro

commit sha 1f995a0614e598da6f35dd3959841565e97b1914

remove update apollo cache function

view details

Lucas Cordeiro

commit sha 986742bc702c223d0b1a6a8562af90eb5eee5616

replace try-catch block with useSSR hook

view details

Lucas Cordeiro

commit sha 6b7be5a0aaa3dabb0631c7c3234fee11b69f7dde

setup

view details

Lucas Cordeiro

commit sha 1636e419d29dc9dd44fa3d0a76b7bd4a4365c91a

add render-runtime mock

view details

Lucas Cordeiro

commit sha afa8ed545ce769ace0649e24c590bd0f97d45eb2

replace useSSR with "typeof document"

view details

Lucas Cordeiro

commit sha a1166d611fbf7b821621b2a2a971765f5e0b95ab

Merge pull request #26 from vtex-apps/feat/offline Add offline support in order form

view details

push time in 3 days

delete branch vtex-apps/order-manager

delete branch : feat/offline

delete time in 3 days

PR merged vtex-apps/order-manager

Add offline support in order form

What problem is this solving?

This is the foundation for some offline features that existed in the previous version of the Minicart. We will now store the order form state in localStorage with the latest value from the API, and will always serve this value through the context.

The TaskQueue#enqueue method was also updated to only execute when the user has an active internet connection by checking navigator.onLine (this isn't reliable). When we receive an error when the request is in-flight, we will check if the user is still online, and if they aren't we will wait for a connection before trying again.

Although the usage of navigator.onLine isn't really reliable, it is the only indicator the platform gives us. We could improve this logic later on.

Related Clubhouse story.

How should this be manually tested?

Workspace.

Checklist/Reminders

  • [ ] Updated README.md.
  • [x] Updated CHANGELOG.md.
  • [x] Linked this PR to a Clubhouse story (if applicable).
  • [ ] Updated/created tests (important for bug fixes).
  • [ ] Deleted the workspace after merging this PR (if applicable).

Type of changes

<!--- Add a ✔️ where applicable -->

✔️ Type of Change
_ Bug fix <!-- a non-breaking change which fixes an issue -->
✔️ New feature <!-- a non-breaking change which adds functionality -->
_ Breaking change <!-- fix or feature that would cause existing functionality to change -->
_ Technical improvements <!-- chores, refactors and overall reduction of technical debt -->
+517 -369

2 comments

13 changed files

lucasecdb

pr closed time in 3 days

push eventvtex-apps/order-items

Marcos Kawakami

commit sha f1fc91a5e5441f6726139ad5c783318416dd2729

Use new entrypoint for updateItems mutation

view details

Marcos Kawakami

commit sha 67ed8f3a163b8e92e9486c6333a711ac86511225

Update changelog

view details

Marcos Kawakami

commit sha 1665ac1b3314730acfe534919163983af25a907f

Merge pull request #16 from vtex-apps/chore/split-queries Use new entrypoint for updateItems mutation

view details

marcoskwkm

commit sha 844679dee937a9c6a17e03af46cb8916822c6863

Release v0.5.2

view details

Lucas Cordeiro

commit sha 192bd927e426526225a50a036c80126f2e962443

add config and typings from 'vtex setup'

view details

Lucas Cordeiro

commit sha e5c9f42eb7b2663ceab30f479d28093bbc071702

add 'addItem' function to context

view details

Lucas Cordeiro

commit sha 8fa5de20c43c81a7ce2e0d16dcc833bed130019b

add eslint and typings config

view details

Lucas Cordeiro

commit sha ba81755fdd1585bd232c1783d2f84648f1b51fce

add addItem function to context and support for offline

view details

Lucas Cordeiro

commit sha ad263958d4c887c44c6715caa7079d85796a9ddc

update changelog

view details

Lucas Cordeiro

commit sha dc3bd7c4bb17e06a85fd480a44c0f60611b0bab8

update uniqueId from items after mutation success

view details

Lucas Cordeiro

commit sha 06b054ec15d227329dd9fc687b2c896dce59ff28

fix item quantity not being updated

view details

Lucas Cordeiro

commit sha 3a3bef9eb986503d55e53d8f20cde4cc95c5afa2

propagate uniqueId update to local queue

view details

Lucas Cordeiro

commit sha d3ea5d8ca7ddc44b5251dab0d66577c31e71290d

read uniqueId value from ref to get latest value

view details

Lucas Cordeiro

commit sha 15181efe07d3341ad5ae3ceebf8b5268285fb376

fix removing item when offline

view details

Lucas Cordeiro

commit sha 6c6059d9ccde6fe111225653a6410bdbd9e54a20

remove custom typings

view details

Lucas Cordeiro

commit sha f0b6561ee6aca02a4e0939803e6914b29ea2edcf

fix prettier

view details

Lucas Cordeiro

commit sha d088b2e2455192054e6af266044d85d224b75518

upgrade vtex test-tools

view details

Lucas Cordeiro

commit sha 285bc3a98f75c8433dc5edb4bf1b96c4c87d6231

fix tests

view details

Lucas Cordeiro

commit sha 5f6b14c20e1b7ffaf75571702030fdc3166c3843

update wording on changelog

view details

Lucas Cordeiro

commit sha 11ece3283b77ebca020b445a1c5534d2eb8eb5c3

use negative value for discount variables

view details

push time in 3 days

push eventvtex-apps/order-manager

Marcos Kawakami

commit sha bee3a52d9db60a84dbe82441db4b7463a2360c13

Use new entrypoint for orderform query

view details

Marcos Kawakami

commit sha 82592b77c5ac7ae489aaddc00843716517d5a9b1

Update changelog

view details

Marcos Kawakami

commit sha 1b27ff5d94a667afceea3263bd18905aaeb04d76

Merge pull request #30 from vtex-apps/chore/split-queries Use new entrypoint for orderform query

view details

marcoskwkm

commit sha dfb854651d7721be18e71cb0c664de4f1b4930a9

Release v0.7.2

view details

Lucas Cordeiro

commit sha c9880b6c1273295fc99f6bd58fc0db24f3ffe5a9

update lint config and remove unused packages

view details

Lucas Cordeiro

commit sha df47c9207d6a6f3250d34bfd4d941bc654339da8

save order form locally

view details

Lucas Cordeiro

commit sha 7f388e586101ac675e5fb9648d9eb1aa6d49100c

update changelog

view details

Lucas Cordeiro

commit sha 3c93b1a69c4765d31d6f331018c08cbd47e87616

wip: add some tests

view details

Lucas Cordeiro

commit sha e5d9474da6b403ce859fba70a9f51d83203c504b

add id to default order form

view details

Lucas Cordeiro

commit sha 4b88281726423fa697dc2858a9b9dfe143726572

fix tests

view details

Lucas Cordeiro

commit sha 71d39103c4cce4f8c397738c848de9bea2419dce

fix lint and typings

view details

Lucas Cordeiro

commit sha fd9f508d38650d0408f1c47e99350dbd5a9e5f8b

fix typo

view details

Lucas Cordeiro

commit sha 13a8f64363d504d0c73baa750e566b8ed8a71f52

update apollo cache on order form update

view details

Lucas Cordeiro

commit sha 9d69fb61a310a5257cf76c0b7c11542d2958cf7a

fix read from apollo cache

view details

Lucas Cordeiro

commit sha 55ad0a8f570cff7381387e60482e1d0bd1a000dd

update queue to be network-aware

view details

Lucas Cordeiro

commit sha 92a642560ac73352cf29bb764f2d3a6dfc88e3e9

remove update cache call on order form update

view details

Lucas Cordeiro

commit sha d24b9c034f08f87232caab10a088c1981020fb2c

update types

view details

Lucas Cordeiro

commit sha 1f995a0614e598da6f35dd3959841565e97b1914

remove update apollo cache function

view details

Lucas Cordeiro

commit sha 986742bc702c223d0b1a6a8562af90eb5eee5616

replace try-catch block with useSSR hook

view details

Lucas Cordeiro

commit sha 6b7be5a0aaa3dabb0631c7c3234fee11b69f7dde

setup

view details

push time in 3 days

pull request commentvtex-apps/checkout-step-group

Add StepGroup and Step components

sure! just a second

lucasecdb

comment created time in 3 days

push eventvtex-apps/checkout-step-group

Lucas Cordeiro

commit sha 3b45f2258fee0bfde15664d86edd371560bb6c13

add nodejs typings

view details

Lucas Cordeiro

commit sha bf07dcb100e1e45240389ddd2d997bbd84a8f637

add composition children to interfaces

view details

Lucas Cordeiro

commit sha 4dda265c10df335ce0f4c5c56b0cdc8d5d697352

add more config files

view details

Lucas Cordeiro

commit sha 8a1ae03b1ff86f19350785dd698d5736fdc16242

center step number correctly

view details

Lucas Cordeiro

commit sha 2a5592e36cf8d5b541720f3957f28bfacc4aa40a

add unregister callback and call on cleanup phase

view details

push time in 3 days

push eventvtex/styleguide

Lucas Cordeiro

commit sha 7e471174bc66e83086402208e987834de68f3510

add --prod flag to postinstall script

view details

Lucas Cordeiro

commit sha 040fea1ce1538ce926ca030fce5f42fad4bb7af6

move script to prepare

view details

Lucas Cordeiro

commit sha e9accbaec949bf2bb11888bd1d188f43ea4228e1

Release v9.111.6

view details

Lucas Cordeiro

commit sha d856b9df9f9a6a935dc8dc6fdf9c81ffdc83eb4a

Merge pull request #1049 from vtex/chore/update-postinstall Move postinstall script to prepare script

view details

push time in 3 days

delete branch vtex/styleguide

delete branch : chore/update-postinstall

delete time in 3 days

PR merged vtex/styleguide

Reviewers
Move postinstall script to prepare script

What is the purpose of this pull request?

Moves the postinstall script to the prepare script, since it's more appropriate.

What problem is this solving?

This is to avoid adding the dev dependencies of this package in production environments, which also breaks React Hooks because styleguide will be using it's own version of React, which will be different than the one used in the application importing it.

How should this be manually tested?

Create a sample react project with

yarn create react-app styleguide-test
cd styleguide-test

Then, add this version of styleguide and verify if any component that uses hooks is rendering correctly. It is important to not run yarn on the styleguide directory, as it will always bring the node_modules folder when you locally yarn add it.

yarn add ../path/to/styleguide
yarn start
// in App.js
import React from 'react'
import ButtonPlain from '@vtex/styleguide/lib/ButtonPlain'

export default function App() {
  return <ButtonPlain>Click me</ButtonPlain>
}

Types of changes

  • [x] Bug fix (a non-breaking change which fixes an issue)
  • [ ] New feature (a non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Requires change to documentation, which has been updated accordingly.
+20 -192

4 comments

4 changed files

lucasecdb

pr closed time in 3 days

push eventvtex/styleguide

Lucas Cordeiro

commit sha 39af6c3e85dbcf88d5849c8c6648b7a6660a6930

Updates

view details

push time in 3 days

created tagvtex/styleguide

tagv9.111.6

The VTEX Design System and React component library.

created time in 3 days

push eventvtex/styleguide

Lucas Cordeiro

commit sha e9accbaec949bf2bb11888bd1d188f43ea4228e1

Release v9.111.6

view details

push time in 3 days

push eventvtex-apps/checkout-step-group

Lucas Cordeiro

commit sha 8d5abd4c61331512e2c4b7ddac2f8bc947478baf

add css handles and update lint config

view details

push time in 4 days

push eventvtex-apps/checkout-step-group

Lucas Cordeiro

commit sha dff5deed208d4ad3103e4b90e693306d7f38f9cc

add pr template

view details

push time in 4 days

create barnchvtex-apps/checkout-step-group

branch : feat/add-components

created branch time in 4 days

create barnchvtex-apps/checkout-step-group

branch : master

created branch time in 4 days

created repositoryvtex-apps/checkout-step-group

created time in 4 days

issue commentvtex/styleguide

Using Monorepo

can I suggest to rename the site package to docs?

emersonlaurentino

comment created time in 4 days

pull request commentvtex/styleguide

Move postinstall script to prepare script

no, the issue was that the react in the devDependencies of the root package.json was being installed on the styleguide directory inside node_modules when used with NPM, not VTEX IO. I don't think removing react from the react/package.json file would make much difference, because that file is compiled away when pushing the assets to the NPM registry.

lucasecdb

comment created time in 4 days

pull request commentvtex/styleguide

Move postinstall script to prepare script

@emersonlaurentino The issue was that with the postinstall script, the package manager (either yarn or npm) was executing this when the styleguide package was installed (i.e. when you yarn added @vtex/styleguide), which then triggered the yarn install inside the node_modules/@vtex/styleguide. This installed all of styleguide's dependencies, including their dev dependencies, which caused all the issues seen with duplicate React copies, etc.

Moving it from postinstall to prepare, the script will only execute now on the dev which is working on styleguide, instead of the dev who is using styleguide. The postinstall script is used on packages like node-sass to compile the sass binaries to the CPU architecture of who is using it, which makes sense for them, but isn't really the case for us.

hope this clarifies more the intent of this PR :-)

lucasecdb

comment created time in 4 days

push eventvtex/styleguide

Lucas Cordeiro

commit sha 040fea1ce1538ce926ca030fce5f42fad4bb7af6

move script to prepare

view details

push time in 4 days

PR opened vtex/styleguide

Reviewers
Add prod flag to postinstall script

What is the purpose of this pull request?

Updates the postinstall script and adds the --prod flag.

What problem is this solving?

This is to avoid adding the dev dependencies of this package in production environments, which also breaks React Hooks because styleguide will be using it's own version of React, which will be different than the one used in the application using it.

How should this be manually tested?

Create a sample react project with

yarn create react-app styleguide-test
cd styleguide-test

Then, add this version of styleguide and verify if any component that uses hooks is rendering correctly.

yarn add ../path/to/styleguide
yarn start
// in App.js
import React from 'react'
import ButtonPlain from '@vtex/styleguide/lib/ButtonPlain'

export default function App() {
  return <ButtonPlain>Click me</ButtonPlain>
}

Types of changes

  • [x] Bug fix (a non-breaking change which fixes an issue)
  • [ ] New feature (a non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Requires change to documentation, which has been updated accordingly.
+5 -1

0 comment

2 changed files

pr created time in 4 days

push eventvtex/styleguide

Emerson Laurentino

commit sha 2cee6c95660de6121779a9bc2538ec0d71c2dd2c

Fix/recharts (#1048) * chore: put recharts to peer dependencies * add: changelog * Release v9.111.5-beta * Release v9.111.5

view details

Lucas Cordeiro

commit sha 7e471174bc66e83086402208e987834de68f3510

add --prod flag to postinstall script

view details

push time in 4 days

create barnchvtex/styleguide

branch : chore/update-postinstall

created branch time in 4 days

delete branch vtex/styleguide

delete branch : chore/react-peer

delete time in 5 days

push eventvtex/styleguide

Lucas Cordeiro

commit sha 4134976f83b3e8cf552777121196165ba13fcd77

add react as a peerDependency

view details

Lucas Cordeiro

commit sha 3151cf81e902090c046e1afd48558ae0e8d3fccd

update changelog

view details

Lucas Cordeiro

commit sha 4fb819367a7d930ebc63225bbe5031723de3fed4

Release v9.111.4

view details

Lucas Cordeiro

commit sha b56e52c9a857938a1ea8c91928dfb26b1c2e335d

Merge pull request #1046 from vtex/chore/react-peer Update react dependency and add as peer

view details

push time in 5 days

PR merged vtex/styleguide

Update react dependency and add as peer

What is the purpose of this pull request?

Updates the react and react-dom dependency (for development) and adds them as peerDependencies.

What problem is this solving?

When you import styleguide in a normal react app, you may get the following error:

Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.

I believe this is due to react not being present in the peerDependencies, so when webpack compiles this to publish on NPM it insert it's own copy of React in the package, making any usage of hooks throw when using any component. This does not happen on IO because we build the app in a different way (not using the webpack config in this repo, but one in builder-hub).

How should this be manually tested?

Create a react app with yarn create react-app styleguide-test. Add styleguide as a dependency and try to use any of it's components.

Types of changes

  • [x] Bug fix (a non-breaking change which fixes an issue)
  • [ ] New feature (a non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Requires change to documentation, which has been updated accordingly.
+26 -18

6 comments

4 changed files

lucasecdb

pr closed time in 5 days

push eventvtex/styleguide

Lucas Cordeiro

commit sha ce59565f9228424998b99726cd27aaa829c863fc

Updates

view details

push time in 5 days

created tagvtex/styleguide

tagv9.111.4

The VTEX Design System and React component library.

created time in 5 days

push eventvtex/styleguide

Lucas Cordeiro

commit sha 4fb819367a7d930ebc63225bbe5031723de3fed4

Release v9.111.4

view details

push time in 5 days

push eventvtex/styleguide

push time in 5 days

pull request commentvtex/styleguide

Update react dependency and add as peer

@lucasecdb do you need these modifications to react and react-dom urgently?

Yes, because this is blocking for some tasks that are on hold since last week, and we need to update them.

lucasecdb

comment created time in 5 days

pull request commentvtex/styleguide

Update react dependency and add as peer

don't you think it's better to do this update in a separate PR then? This is blocking some tasks and I don't wan't to wait.

lucasecdb

comment created time in 5 days

push eventvtex/styleguide

Lucas Cordeiro

commit sha 3151cf81e902090c046e1afd48558ae0e8d3fccd

update changelog

view details

Lucas Cordeiro

commit sha 663fd2780a06ba08ad4df473561eb40f572b2908

move recharts to peer dependencies

view details

push time in 5 days

pull request commentvtex/styleguide

Update react dependency and add as peer

@emersonlaurentino my bad! I forgot to update the changelog

lucasecdb

comment created time in 5 days

PR opened vtex/styleguide

Update react dependency and add as peer

What is the purpose of this pull request?

Updates the react and react-dom dependency (for development) and adds them as peerDependencies.

What problem is this solving?

When you import styleguide in a normal react app, you may get the following error:

Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.

I believe this is due to react not being present in the peerDependencies, so when webpack compiles this to publish on NPM it insert it's own copy of React in the package, making any usage of hooks throw when using any component. This does not happen on IO because we build the app in a different way (not using the webpack config in this repo, but one in builder-hub).

How should this be manually tested?

Create a react app with yarn create react-app styleguide-test. Add styleguide as a dependency and try to use any of it's components.

Types of changes

  • [x] Bug fix (a non-breaking change which fixes an issue)
  • [ ] New feature (a non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Requires change to documentation, which has been updated accordingly.
+19 -16

0 comment

2 changed files

pr created time in 5 days

create barnchvtex/styleguide

branch : chore/react-peer

created branch time in 5 days

push eventvtex-apps/order-items

Lucas Cordeiro

commit sha 5247c020e7cb9b4ab5822befde21f82ce3422b35

add return value for addItem function

view details

Lucas Cordeiro

commit sha 87ce7ad57e6897d7a69f0d83308192264fb0ddab

extract properties of oldItem to local variables

view details

push time in 5 days

pull request commentvtex-apps/order-items

Add support for offline and addItem function

@marcoskwkm do you think I could just "extract" the price, quantity and sellingPrice to a local variable? If I have to add a default value for the oldItem I will need to specify all of the properties in the interface :-(

lucasecdb

comment created time in 5 days

delete branch vtex-apps/place-components

delete branch : release/0-1-0

delete time in 5 days

push eventvtex-apps/place-components

Lucas Cordeiro

commit sha 59e6ab67a09dc5aafd5bfac30924b4e9fcfae785

update yarn.lock

view details

Lucas Cordeiro

commit sha f461bc713699ee3f29e691028866f793641f2b3c

Release v0.1.0

view details

Lucas Cordeiro

commit sha af8c2b32d0e198ce6ce029167f6bf30387e085fe

update version

view details

Lucas Cordeiro

commit sha f395de0c2a50bd2397ea037c073ca0ab262bdc73

Merge pull request #8 from vtex-apps/release/0-1-0 Release 0.3.0

view details

push time in 5 days

more