Skip to content

Run prettier #2672

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

Merged
merged 1 commit into from
Feb 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/firestore/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const transformers = [

const terserOptions = {
output: {
comments: "all",
comments: 'all',
beautify: true
},
mangle: {
Expand Down Expand Up @@ -89,20 +89,20 @@ const es5Builds = [
},
/**
* Browser CJS Build
*
* The Browser CJS build is not mangled as Terser's property name mangling
*
* The Browser CJS build is not mangled as Terser's property name mangling
* does not work well with CommonJS-style files.
*/
{
input: 'index.ts',
output:{ file: pkg.browser, format: 'cjs', sourcemap: true },
output: { file: pkg.browser, format: 'cjs', sourcemap: true },
plugins: [
typescriptPlugin({
typescript,
cacheRoot: './.cache/cjs/'
}),
json()
],
]
},
/**
* Browser ESM Build
Expand Down
10 changes: 6 additions & 4 deletions packages/messaging/src/controllers/window-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,14 @@ export class WindowController implements FirebaseMessaging, FirebaseService {
scope: DEFAULT_SW_SCOPE
}
);
// The timing when browser updates sw when sw has an update is unreliable by my experiment.
// It leads to version conflict when the SDK upgrades to a newer version in the main page, but

// The timing when browser updates sw when sw has an update is unreliable by my experiment.
// It leads to version conflict when the SDK upgrades to a newer version in the main page, but
// sw is stuck with the old version. For example, https://github.com/firebase/firebase-js-sdk/issues/2590
// The following line reliably updates sw if there was an update.
this.swRegistration.update().catch(() => { /* it is non blocking and we don't care if it failed */ });
this.swRegistration.update().catch(() => {
/* it is non blocking and we don't care if it failed */
});
} catch (e) {
throw ERROR_FACTORY.create(ErrorCode.FAILED_DEFAULT_REGISTRATION, {
browserErrorMessage: e.message
Expand Down
24 changes: 15 additions & 9 deletions scripts/run_changed.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,16 @@ const alwaysRunTestPaths = [
* These files trigger tests in other dirs
*/
const specialPaths = {
'scripts/emulator-testing/emulators/firestore-emulator.ts': ['packages/firestore'],
'scripts/emulator-testing/emulators/database-emulator.ts': ['packages/database'],
'scripts/emulator-testing/emulators/emulator.ts': ['packages/firestore', 'packages/database'],
'scripts/emulator-testing/emulators/firestore-emulator.ts': [
'packages/firestore'
],
'scripts/emulator-testing/emulators/database-emulator.ts': [
'packages/database'
],
'scripts/emulator-testing/emulators/emulator.ts': [
'packages/firestore',
'packages/database'
],
'scripts/emulator-testing/firestore-test-runner.ts': ['packages/firestore'],
'scripts/emulator-testing/database-test-runner.ts': ['packages/database']
};
Expand Down Expand Up @@ -152,20 +159,19 @@ async function runTests(pathList) {

async function main() {
try {
const {
testAll,
changedPackages = {}
} = await getChangedPackages();
const { testAll, changedPackages = {} } = await getChangedPackages();
if (testAll) {
await spawn('yarn', ['test'], {
stdio: 'inherit'
});
} else {
console.log(chalk`{blue Running tests in:}`);
for (const filename of alwaysRunTestPaths) { // array
for (const filename of alwaysRunTestPaths) {
// array
console.log(chalk`{green ${filename} (always runs)}`);
}
for (const filename in changedPackages) { // obj
for (const filename in changedPackages) {
// obj
if (changedPackages[filename] === 'direct') {
console.log(chalk`{yellow ${filename} (contains modified files)}`);
} else {
Expand Down