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

feat: Implement FlagshipLink #1505

Merged
merged 3 commits into from
Sep 9, 2024
Merged

Conversation

Ldoppea
Copy link
Member

@Ldoppea Ldoppea commented Jul 26, 2024

When hosted in the Flagship app, we want the cozy-apps to be able to forward their queries to the native code

This will allow the native code to have control on the data lifecycle and chose between the cozy-stack or a local Pouch database as the source for executing the query

For now we use cozy-intent in order to communicate through post messages as it is the fastest implementation possible but this may change in the future if we encounter performances issues (i.e. using a local HTTP server)


TODO:


Related PRs:

@Ldoppea Ldoppea force-pushed the feat/make_replication_work branch from adf578d to 1ef1168 Compare July 26, 2024 15:04
Ldoppea added a commit to cozy/cozy-flagship-app that referenced this pull request Jul 30, 2024
In previous commits we configured the application's cozy-client to use
CozyPouchLink

This link is configured for all react-native side queries, but not for
cozy-app queries as they are served inside of WebViews and use a
different cozy-client instance

We want cozy-apps to benefits from the CozyPouchLink by redirecting
their queries to the react-native side using the new FlagshipLink
interface

With this interface, all cozy-apps queries can be redirected to the
react-native side using cozy-intent/post-me

In order to intercept them, then we should declare
`FlagshipLinkRequest()` method `localMethods`

Related PR: cozy/cozy-client#1505
'Using options.client is deprecated, prefer options.stackClient'
)
}
this.stackClient = stackClient || client
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have a stackClient here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed in #1524

Ldoppea added a commit to cozy/cozy-flagship-app that referenced this pull request Aug 26, 2024
In previous commits we configured the application's cozy-client to use
CozyPouchLink

This link is configured for all react-native side queries, but not for
cozy-app queries as they are served inside of WebViews and use a
different cozy-client instance

We want cozy-apps to benefits from the CozyPouchLink by redirecting
their queries to the react-native side using the new FlagshipLink
interface

With this interface, all cozy-apps queries can be redirected to the
react-native side using cozy-intent/post-me

In order to intercept them, then we should declare
`FlagshipLinkRequest()` method `localMethods`

Related PR: cozy/cozy-client#1505
Ldoppea added a commit to cozy/cozy-flagship-app that referenced this pull request Aug 26, 2024
In previous commits we configured the application's cozy-client to use
CozyPouchLink

This link is configured for all react-native side queries, but not for
cozy-app queries as they are served inside of WebViews and use a
different cozy-client instance

We want cozy-apps to benefits from the CozyPouchLink by redirecting
their queries to the react-native side using the new FlagshipLink
interface

With this interface, all cozy-apps queries can be redirected to the
react-native side using cozy-intent/post-me

In order to intercept them, then we should declare
`FlagshipLinkRequest()` method `localMethods`

Related PR: cozy/cozy-client#1505
Base automatically changed from feat/make_replication_work to feat/meta_offline September 9, 2024 10:30
`cozy-intent` has been upgraded to `2.23.0` to retrieve
`flagshipLinkRequest` new intent

Related PR: cozy/cozy-libs#2562
When hosted in the Flagship app, we want the cozy-apps to be able to
forward their queries to the native code

This will allow the native code to have control on the data lifecycle
and chose between the cozy-stack or a local Pouch database as the
source for executing the query

For now we use cozy-intent in order to communicate through post
messages as it is the fastest implementation possible but this may
change in the future if we encounter performances issues (i.e. using a
local HTTP server)
@Ldoppea Ldoppea merged commit d844054 into feat/meta_offline Sep 9, 2024
2 checks passed
@Ldoppea Ldoppea deleted the feat/add_flagshiplink branch September 9, 2024 13:14
Ldoppea added a commit to cozy/cozy-flagship-app that referenced this pull request Sep 24, 2024
In previous commits we configured the application's cozy-client to use
CozyPouchLink

This link is configured for all react-native side queries, but not for
cozy-app queries as they are served inside of WebViews and use a
different cozy-client instance

We want cozy-apps to benefits from the CozyPouchLink by redirecting
their queries to the react-native side using the new FlagshipLink
interface

With this interface, all cozy-apps queries can be redirected to the
react-native side using cozy-intent/post-me

In order to intercept them, then we should declare
`FlagshipLinkRequest()` method `localMethods`

Related PR: cozy/cozy-client#1505
Ldoppea added a commit to cozy/cozy-flagship-app that referenced this pull request Sep 24, 2024
In previous commits we configured the application's cozy-client to use
CozyPouchLink

This link is configured for all react-native side queries, but not for
cozy-app queries as they are served inside of WebViews and use a
different cozy-client instance

We want cozy-apps to benefits from the CozyPouchLink by redirecting
their queries to the react-native side using the new FlagshipLink
interface

With this interface, all cozy-apps queries can be redirected to the
react-native side using cozy-intent/post-me

In order to intercept them, then we should declare
`FlagshipLinkRequest()` method `localMethods`

Related PR: cozy/cozy-client#1505
Ldoppea added a commit to cozy/cozy-flagship-app that referenced this pull request Sep 25, 2024
In previous commits we configured the application's cozy-client to use
CozyPouchLink

This link is configured for all react-native side queries, but not for
cozy-app queries as they are served inside of WebViews and use a
different cozy-client instance

We want cozy-apps to benefits from the CozyPouchLink by redirecting
their queries to the react-native side using the new FlagshipLink
interface

With this interface, all cozy-apps queries can be redirected to the
react-native side using cozy-intent/post-me

In order to intercept them, then we should declare
`FlagshipLinkRequest()` method `localMethods`

Related PR: cozy/cozy-client#1505
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants