bolt icon indicating copy to clipboard operation
bolt copied to clipboard

Type imports

Open brewsoftware opened this issue 8 years ago • 2 comments

The following PR is designed to allow for splitting bolt rule definitions into multiple files. This should enable a few extra features in the bolt ecosystem including:

  • Allow for re-usable types such as simple validation through publicly available bolt modules.
  • Code which is easier to read.

This has been requested by the community for some time (https://github.com/firebase/bolt/issues/63) and this is a second re-write of the original gulp-firebase-bolt plugin with a more ES6 spec. It is a complete end-to-end integration covering the parse & compiler.

I have explicitly left functions and paths out of this release as I'm running out of time to implement all of that. Not withstanding this there is value in the PR as is.

Example usages include:

import * from './module' // import everything from sub module. import * as types from './module' // import everything under the 'types' namespace import {Foo} from './module' // only import specific types import * from 'module' // global imports

type Bar is Foo {

}

Example usages include:

import * from './module' // import everything from sub module. import * as types from './module' // import everything under the 'types' namespace import {Foo} from './module' // only import specific types import * from 'module' // global imports

type Bar is Foo {

}

Documentation has been updated to include the new spec, tests should be parsing and a sample has been added. An additional fix to the master branch has been cherry picked from https://github.com/firebase/bolt/pull/209

Comments are welcome:

Cheers, Jason Brew Software.

brewsoftware avatar Sep 12 '17 05:09 brewsoftware

Please guys merge this. My current workflow concatenates files :/

ThadeuLuz avatar Sep 16 '17 14:09 ThadeuLuz

I could really use this feature as well

wcandillon avatar Sep 27 '17 13:09 wcandillon