Automattic / happychat-client

Happychat customer client code
13 stars 5 forks source link

Reuse Happychat in Calypso #152

Open oandregal opened 6 years ago

oandregal commented 6 years ago

These are the approaches I was thinking of:

Use the available dist target

We could take the target/dist/happychat.js and use it in Calypso by building a React/Redux wrapper on top of that. This is the approach we've followed to integrate the directly library in Calypso see.

Create a new target that reuses the full library

This is the approach followed by the notifications-panel component in Calypso. See calypso and notifications-panel.

This approach requires some tweaks to integrate the CSS and teach webpack to process the React components from the npm package.

The component initializes its own internal store that is separated from the target (Calypso). But it also uses the Calypso Redux store to pass some props and action dispatchers.

Create a new target that imports the separate components

The way this may work is:

This may have the advantage to only import the components needed (no pulling of the contact form, for example).

oandregal commented 6 years ago

For the record, this thread p7OimR-wc-p2 contains some valuable conversations.

oandregal commented 6 years ago

cc @unDemian and @mattwondra

mattwondra commented 6 years ago

@nosolosw In p7OimR-m0-p2 we expected to see "Happychat in a panel" by about now — I just wanted to confirm whether work on this has been started or not? That's really what we need to make this work in Calypso, so if work hasn't been started on that yet, that's likely where we'll need to begin.

oandregal commented 6 years ago

@mattwondra that changed mid-project: although that was scheduled for v2, it wasn't a priority for woo and they preferred v2 to be focused on other things (tickets and so).

oandregal commented 6 years ago

An issue that's relevant to this: https://github.com/Automattic/happychat-client/issues/50