Google Closure Compiler does not support 'Wildcard export' #369
Closed
Description
opened on Dec 12, 2017
[REQUIRED] Describe your environment
- Operating System version: Windows 10
- Firebase SDK version: 4.8.0
- Firebase Product: All (auth, database, storage, etc)
[REQUIRED] Describe the problem
Closure compiler does not support ES6 Wildcard export.
The file at /node_modules/@firebase/util/dist/esm/index.js, does at the moment use Wildcard export.
As a Google product, it may be a good ideer to support the Google Closure Compiler.
This could maybe be solved easily by using the angular/tsickle project, when compiling TS to JS.
Another quick fix could be to declare alle the export manually.
index.ts
export { assert, assertionError } from './src/assert';
export { base64, base64Decode, base64Encode } from './src/crypt';
export { CONSTANTS } from './src/constants';
export { deepCopy, deepExtend, patchProperty } from './src/deepCopy';
export { Deferred } from './src/deferred';
export { getUA, isMobileCordova, isNodeSdk, isReactNative } from './src/environment';
export { ErrorFactory, ErrorList, FirebaseError, patchCapture, StringLike } from './src/errors';
export { jsonEval, stringify } from './src/json';
export { decode, isAdmin, issuedAtTime, isValidFormat, isValidTimestamp } from './src/jwt';
export {
clone,
contains,
every,
extend,
findKey,
findValue,
forEach,
getAnyKey,
getCount,
getValues,
isEmpty,
isNonNullObject,
map,
safeGet
} from './src/obj';
export { querystring, querystringDecode } from './src/query';
export { Sha1 } from './src/sha1';
export {
async,
CompleteFn,
createSubscribe,
ErrorFn,
Executor,
NextFn,
Observable,
Observer,
PartialObserver,
Subscribe,
Unsubscribe
} from './src/subscribe';
export { errorPrefix, validateArgCount, validateCallback, validateContextObject, validateNamespace } from './src/validation';
export { stringLength, stringToByteArray } from './src/utf8';
Closure Compiler output message:
./node_modules/@firebase/util/dist/esm/index.js:30:
Originally at:
node_modules/@firebase/util/dist/index.ts:31: ERROR - ES6 transpilation of 'Wildcard export' is not yet implemented.
Steps to reproduce:
All I have done in my Angular project is to import 'firebase/app' and initialize.
import { initializeApp } from 'firebase/app';
------
const app = initializeApp(
{
apiKey: /* apiKey */,
authDomain: /* authDomain*/,
databaseURL: /* databaseURL*/,
projectId: /* projectId*/,
storageBucket: /* storageBucket*/,
messagingSenderId: /* messagingSenderId*/
}
);
In Closure Compiler config have I added all the needed files (package.json and js).
See: #370 for possible fix
Activity