-
Notifications
You must be signed in to change notification settings - Fork 111
feat(react, plugin-history-sync): Default history setup option for rich deep link experiences #610
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
Merged
Merged
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
8faf5ad
feat(plugin-history-sync): Default history setup option for rich deep…
ENvironmentSet c5d841a
feat(plugin-history-sync): Let base history setup be cancelled when o…
ENvironmentSet 92fc07d
fix(future): Remove reduant resume event
ENvironmentSet 7c42db1
feat(core): Emit activity pop effect even if it was popped immediately
ENvironmentSet c1bf18a
chore: remove unused imports
ENvironmentSet 98b9f9c
feat: Drop step support
103deba
fix
0d994c9
Revert "fix"
951f0aa
Revert "feat: Drop step support"
cab9ee8
support step
6f33fbb
feat: Lazy load activity component support
f96e2f0
polish interface
a357660
fix loading
e1166bf
fix
b2fd581
Revert "feat(core): Emit activity pop effect even if it was popped im…
0bf3f7c
fix type
0e4f70f
format
80f62d6
refactor
606a0e6
simpl
8b41197
add changesets
f1b42e5
demo update
31f162a
revert
ce419a3
prevent jaggering transition
bc778d3
fix
3336488
shell
24fcaa8
fix
4955f92
remove unused file
7640fbe
Revert "remove unused file"
e567ce6
structured activity
18fb62a
types
befc6cf
refactor
54ea05c
update demo
bd21f3b
update changesets
590c363
update demo
7d020c8
update demo
18ca614
use tokens
ca0b682
fix typo
0503c0c
Fix
b41e76d
improts
dacdc83
fix order
3f4d962
fix
97f143b
add cs
5881665
ove
f85871e
fix
1e09b70
fix
8a29a8b
fix
793f1f9
fix
b174cd9
fix
462eae9
Merge branch 'main' into deep-link-default-nav-context
ENvironmentSet 658ccd5
fix
9e66305
with constructors
e547585
check on init
6bb8ccd
add links
1b9ea70
fix
9d4b11a
lol
d65e0c6
yayay
881d470
reorder
180da10
rr
4711c2e
memo
da7bcd1
Merge branch 'main' into deep-link-default-nav-context
ENvironmentSet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| "@stackflow/react": minor | ||
| --- | ||
|
|
||
| `StructuredActivityComponentType` is added. | ||
|
|
||
| Structured activity components are components modeling activity view while exposing major features of an activity. | ||
| Allowing developers easily customize user experience of an activity view, it even allow stackflow to perform various kinds of optimizations. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@stackflow/plugin-preload": patch | ||
| --- | ||
|
|
||
| Sync with type constraint changes in stackflow/react |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@stackflow/plugin-history-sync": minor | ||
| --- | ||
|
|
||
| Add `defaultHistory` route option to pre-seed stack for better deep link experiences |
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
demo/src/activities/Article.css.ts → ...activities/Article/Article.content.css.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| import { | ||
| content, | ||
| useActivityParams, | ||
| useLoaderData, | ||
| } from "@stackflow/react/future"; | ||
| import { LazyLoadImage } from "react-lazy-load-image-component"; | ||
| import ArticleCard from "../../components/ArticleCard"; | ||
| import ArticleProfile from "../../components/ArticleProfile"; | ||
| import * as css from "./Article.content.css"; | ||
ENvironmentSet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| import type { articleLoader } from "./Article.loader"; | ||
|
|
||
| const ArticleContent = content<"Article">(() => { | ||
| const { title } = useActivityParams<"Article">(); | ||
| const { imageUrl, recommenderCards } = useLoaderData<typeof articleLoader>(); | ||
|
|
||
| return ( | ||
| <div className={css.container}> | ||
| <div className={css.image}> | ||
| <div className={css.imageInner}> | ||
| <LazyLoadImage | ||
| src={imageUrl} | ||
| effect="opacity" | ||
| width="100%" | ||
| height="100%" | ||
| /> | ||
| </div> | ||
| </div> | ||
| <ArticleProfile /> | ||
| <div className={css.content}> | ||
| <div className={css.title}>{title}</div> | ||
| <div className={css.subtitle}>Baby & Kids ∙ 3 days ago</div> | ||
| <div className={css.body}> | ||
| Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean | ||
| elementum sit sem ullamcorper urna, lacinia eu tortor, mattis. | ||
| Venenatis ut cursus amet in. | ||
| </div> | ||
| <div className={css.subtitle}>1 chats ∙ 2 favorites ∙ 212 views</div> | ||
| </div> | ||
| <div className={css.section}> | ||
| <div className={css.sectionTitle}>Other Items by Emila </div> | ||
| <div className={css.recommenderGrid}> | ||
| {recommenderCards.map((card) => ( | ||
| <ArticleCard key={card.articleId} {...card} /> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }); | ||
|
|
||
| export default ArticleContent; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { layout } from "@stackflow/react/future"; | ||
| import Layout from "../../components/Layout"; | ||
|
|
||
| const ArticleLayout = layout<"Article">(({ params: { title }, children }) => { | ||
| return <Layout appBar={{ title }}>{children}</Layout>; | ||
| }); | ||
|
|
||
| export default ArticleLayout; |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import { style } from "@vanilla-extract/css"; | ||
|
|
||
| export const container = style({ | ||
| display: "flex", | ||
| alignItems: "center", | ||
| justifyContent: "center", | ||
| height: "100%", | ||
| width: "100%", | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { loading } from "@stackflow/react/future"; | ||
| import LoadingSpinner from "../../components/LoadingSpinner"; | ||
|
|
||
| import * as css from "./Article.loading.css"; | ||
|
|
||
| const ArticleLoading = loading<"Article">(() => { | ||
| return ( | ||
| <div className={css.container}> | ||
| <LoadingSpinner /> | ||
| </div> | ||
| ); | ||
| }); | ||
|
|
||
| export default ArticleLoading; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { structuredActivityComponent } from "@stackflow/react/future"; | ||
| import ArticleLayout from "./Article.layout"; | ||
| import ArticleLoading from "./Article.loading"; | ||
|
|
||
| declare module "@stackflow/config" { | ||
| interface Register { | ||
| Article: { | ||
| articleId: number; | ||
| title?: string; | ||
| }; | ||
| } | ||
| } | ||
|
|
||
| export const Article = structuredActivityComponent<"Article">({ | ||
| content: () => import("./Article.content"), | ||
| layout: ArticleLayout, | ||
| loading: ArticleLoading, | ||
| }); | ||
ENvironmentSet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
2 changes: 1 addition & 1 deletion
2
demo/src/activities/Main.css.ts → demo/src/activities/Main/Main.css.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
12 changes: 6 additions & 6 deletions
12
demo/src/activities/Main.tsx → demo/src/activities/Main/Main.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import { vars } from "@seed-design/design-token"; | ||
| import { keyframes, style } from "@vanilla-extract/css"; | ||
|
|
||
| const spin = keyframes({ | ||
| "0%": { transform: "rotate(0deg)" }, | ||
| "100%": { transform: "rotate(360deg)" }, | ||
| }); | ||
|
|
||
| export const spinner = style({ | ||
| width: 48, | ||
| height: 48, | ||
ENvironmentSet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| border: `4px solid ${vars.$scale.color.gray600}`, | ||
| borderTop: `4px solid ${vars.$scale.color.gray900}`, | ||
| borderRadius: "50%", | ||
| animation: `${spin} 1s linear infinite`, | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import type { FC } from "react"; | ||
|
|
||
| import * as css from "./LoadingSpinner.css"; | ||
|
|
||
| const LoadingSpinner: FC = () => { | ||
| return <div className={css.spinner} />; | ||
| }; | ||
|
|
||
| export default LoadingSpinner; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.