3.1.1 • Published 3 years ago

modular-views.macro v3.1.1

Weekly downloads
7
License
Apache-2.0
Repository
-
Last release
3 years ago

modular-views.macro

When used in a modular repository, this macro will scan all the available packages, find the ones marked as 'views', and generates a map of names to the views, each wrapped in React.lazy.

usage

Suppose you have a modular repository, with a directory structure like so -

my-modular-repo
  packages
    app
    pkg-1
    pkg-2
    view-1
    view-2
    view-3
    view-4
    ...
    view-n

Then you can write code like this -

import views from 'modular-views.macro';

console.log(views);

/* 
The above call would log this object - 

{
  'view-1': React.lazy(() => import('view-1')),
  'view-2': React.lazy(() => import('view-2')),
  'view-3': React.lazy(() => import('view-3')),
  'view-4': React.lazy(() => import('view-4')),
  // ...
  'view-n': React.lazy(() => import('view-n')),
}

Like magic!
*/
3.1.1

3 years ago

3.1.0

3 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.0

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.4-next.0

4 years ago

1.2.5

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago