Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: rax-pwa upgrade #1452

Merged
merged 13 commits into from
Nov 7, 2019
Merged

feat: rax-pwa upgrade #1452

merged 13 commits into from
Nov 7, 2019

Conversation

fyangstudio
Copy link
Collaborator

@fyangstudio fyangstudio commented Oct 29, 2019

Add rax-pwa@1.1.0

Page keepAlive

SPA support keep the switched-out pages in memory, make alivepage keep it's state, input, scroll position and so on.

Usage:

// app.json
{
  "routes": [
    {
      "path": "/",
      "keepAlive": true,
      "source": "pages/Home/index"
    }
  ]
}

TabBar

Web projects support Tabbar generation. rax-pwa provides components for rendering pages for runApp in rax-app.

It works in web and weex app!

Usage:

// app.json
{
  "tabBar": {
    "textColor": "#999999",
    "selectedColor": "#666",
    "backgroundColor": "#f8f8f8",
    "items": [
      {
        "name": "home",
        "pagePath": "/"
      },
      {
        "name": "page1",
        "pagePath": "/page1",
      }
    ]
  }
}

preload and prerender

Add preload and presender methods.

// page home
import { createElement, useEffect } from 'rax';
import { preload, prerender } from 'rax-pwa';
import Text from 'rax-text';

export default function Home(props) {
  useEffect(() => {
    preload({path: '/page1'});
    prerender({path: '/page2'});
  }, []
  return (
     <Text style={styles.title}>Welcome to Your Rax App</Text>
  );
}

@fyangstudio fyangstudio changed the title feat: rax-pwa upgrade [WIP]feat: rax-pwa upgrade Oct 30, 2019
@fyangstudio fyangstudio changed the title [WIP]feat: rax-pwa upgrade feat: rax-pwa upgrade Oct 31, 2019
@fyangstudio
Copy link
Collaborator Author

raxjs/rax-app#45

@fyangstudio fyangstudio merged commit c029530 into master Nov 7, 2019
@fyangstudio fyangstudio deleted the feat-pwa-v2 branch November 7, 2019 06:18
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants