Skip to content

Offline dev kit based on import maps and htm jsx factory. No node_modules need anymore! Full material-ui lib without bundlers!

Notifications You must be signed in to change notification settings

react-declarative/offline-dev-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

offline-dev-kit

Offline dev kit based on import maps and htm jsx factory. No node_modules need anymore! Full material-ui lib without bundlers!

Contribute

Important

Made by using react-declarative to solve your problems. ⭐Star and 💻Fork It on github will be appreciated

Usage

Run in command line

npm install
npm run build
npm start

Code sample

Import map

<script type="importmap">
  {
    "imports": {
      "react": "/dist/react.esm.js",
      ...
    }
  }
</script>

ES6 modules in modern browser

<script type="module">
import React from 'react';
import ReactDOM from 'react-dom';

import { Scaffold, Switch } from 'react-declarative';
import { createMemoryHistory } from 'history';

import options from '../config/navbar.js';
import routes from '../config/routes.js';

const history = createMemoryHistory();

const App = () => {

    const handleNavClick = (name) => {
        if (name === 'home-page') {
            history.push('/');
        } else if (name === 'profiles-page') {
            history.push('/profiles');
        }
    };

    return htm`
        <${Scaffold} 
            title="InfoLink CRM"
            onOptionClick=${handleNavClick}
            options=${options}
        >
            <${Switch}
                Loading=${() => htm`<p>Checking permissions (mock)</p>`}
                NotFound=${() => htm`<p>Not found(</p>`}
                history=${history}
                items=${routes}
            />
        <//>
    `;
};

ReactDOM.render(htm`<App />`, document.getElementById('root'));
</script>

Check the full source code in example folder

About

Offline dev kit based on import maps and htm jsx factory. No node_modules need anymore! Full material-ui lib without bundlers!

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages