[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Closure Compiler does not support 'Wildcard export' #369

Closed
Doehl opened this issue Dec 12, 2017 · 7 comments
Closed

Google Closure Compiler does not support 'Wildcard export' #369

Doehl opened this issue Dec 12, 2017 · 7 comments

Comments

@Doehl
Copy link
Contributor
Doehl commented 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

@google-oss-bot
Copy link
Contributor

Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight.

@jshcrowthe
Copy link
Contributor

Hey @Doehl thanks so much for the issue (and the associated fix) If you can get me a gist or something small to repro this then let's get your fix implemented.

@Doehl
Copy link
Contributor Author
Doehl commented Dec 19, 2017

Great!

I will put together a repo asap.

@Doehl
Copy link
Contributor Author
Doehl commented Jan 2, 2018

Here you have a repo:
https://github.com/Doehl/firebase-js-sdk-issue-369

@jshcrowthe
Copy link
Contributor

Perfect, thanks @Doehl! I'll take a look.

@jshcrowthe
Copy link
Contributor

Sorry for the delay @Doehl. Confirmed the issue and the fix.

@jshcrowthe
Copy link
Contributor

Fixed in #370

@firebase firebase locked and limited conversation to collaborators Oct 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants