Framework7

repository·master·Indexed 12 days ago

https://github.com/framework7io/framework7

A comprehensive mobile HTML framework for building native-looking iOS and Android applications using HTML, CSS, and JavaScript. It provides a suite of mobile-optimized UI components and layouts with official integrations for React, Vue.js, and Svelte.

Tokens
3.4K
Snippets
11
Records
18
Agent score
97%

What's inside Framework7

  1. Overview of Framework7 Vue

    master
    Framework7 Vue is a combination of the Vue.js framework and the Framework7 mobile UI framework. It is designed to allow developers to build mobile applications more quickly by leveraging the power and simplicity of Vue.js alongside the flexible mobile UI components provided by Framework7.
  2. Getting started with Framework7

    master

    To begin building with Framework7, follow these core steps:

    1. Read the Introduction: Understand the core concepts and capabilities.
    2. Follow the Installation Guide: Set up the framework in your development environment.
    3. Define your App Layout: Plan the structure of your mobile application.
    4. Initialize your App: Use the Framework7 API to boot your application instance.

    Detailed guides are available at the official documentation site.

  3. Getting started with Framework7 Vue

    master

    To begin building with Framework7 Vue, you should follow these core implementation steps:

    1. Installation: Follow the official installation guide to add the necessary dependencies to your project.
    2. App Layout: Define your application's structural layout.
    3. Initialize App: Set up the Framework7 instance within your Vue application.
    4. Navigation Router: Configure the router to handle page transitions and mobile-style navigation.

    You can also jumpstart your development using official Starter App Templates.

  4. Get started with Framework7 React

    master

    Framework7 React allows you to build mobile applications by combining the React framework with the Framework7 mobile UI components. To begin building, you should follow these core implementation steps:

    1. Installation: Follow the official installation guide to add the necessary dependencies to your project.
    2. App Layout: Define your application's structure using Framework7's layout components.
    3. Initialize App: Set up the Framework7 instance to manage the application lifecycle.
    4. Navigation Router: Configure the router to handle page transitions and navigation within your mobile app.

    For pre-configured setups, you can use the Starter App Templates to jumpstart your development.

  5. Get started with Framework7 Svelte

    master

    To begin building a mobile app with Framework7 and Svelte, follow these key steps:

    1. Installation: Follow the official Installation Guide to set up your environment.
    2. Templates: Use Starter App Templates to jumpstart your project with a pre-configured structure.
    3. App Layout: Define your application's structure using the App Layout patterns.
    4. Initialization: Use the Initialize App process to boot up the Framework7 instance within your Svelte application.
    5. Navigation: Implement page transitions and routing using the Navigation Router.
  6. Run Framework7 Kitchen Sink examples

    master

    The Kitchen Sink allows you to run and explore the Framework7 components in a development environment. These commands build the required development version of the package before running the corresponding Kitchen Sink.

    • core: Builds Core (vanilla JS) and runs the Core Kitchen Sink.
    • react: Builds the Framework7 React package and runs the React Kitchen Sink.
    • vue: Builds the Framework7 Vue package and runs the Vue Kitchen Sink.
    • svelte: Builds the Framework7 Svelte package and runs the Svelte Kitchen Sink.
    # Example: Run the Vue Kitchen Sink
    npm run vue
  7. Configure Babel for Svelte in Framework7

    master

    The babel-svelte.config.js file defines the Babel presets used when compiling Svelte components within the Framework7 ecosystem. It primarily controls the module transformation behavior via the MODULES environment variable.

    To control whether Babel transforms ES modules, set the MODULES environment variable:

    • If MODULES is set to 'esm', module transformation is disabled (set to false).
    • If MODULES is set to 'false', module transformation is disabled.
    • Otherwise, the value of MODULES is passed directly to @babel/preset-env to determine the module transformation strategy.
    // Example: Disabling module transformation via environment variable
    MODULES=esm npx framework7-cli build
  8. Configure Babel for Framework7 Vue via MODULES environment variable

    master

    The Babel configuration for Framework7 Vue projects uses the MODULES environment variable to control how modules are transformed.

    • If MODULES is set to 'esm', the configuration forces modules: false to preserve ES modules (useful for tree-shaking in bundlers like Webpack or Rollup).
    • If MODULES is set to 'false', it also forces modules: false.
    • Otherwise, the value of MODULES is passed directly to @babel/preset-env.

    The configuration also enables loose: true mode in @babel/preset-env to produce faster, more lightweight code.

    # Example: Preserving ES modules for tree-shaking
    MODULES=esm npm run build
  9. Configure Babel for React with Framework7

    master

    The babel-react.config.js file defines the Babel configuration used for React-based Framework7 projects. It utilizes @babel/preset-react for JSX transformation and @babel/preset-env for environment-specific transpilation.

    Transpilation behavior for ES modules is controlled via the MODULES environment variable:

    • If process.env.MODULES is set to 'esm', module transformation is disabled (set to false).
    • If process.env.MODULES is set to 'false', module transformation is disabled.
    • Otherwise, the value of process.env.MODULES is passed to @babel/preset-env to determine how modules are handled.
    // Example: Setting the MODULES env var to control transpilation
    // To disable module transformation (equivalent to 'esm' or 'false'):
    // MODULES=esm npm run build
    
    module.exports = {
      presets: ['@babel/preset-react', ['@babel/preset-env', { modules: process.env.MODULES || false, loose: true }]],
    };