-
Notifications
You must be signed in to change notification settings - Fork 942
Firestore Standalone Build #293
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Copyright 2017 Google Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
// Local console build for | ||
declare var firebase; | ||
|
||
import './src/platform_browser/browser_init'; | ||
import { Firestore } from './src/api/database'; | ||
import { configureForFirebase } from './src/platform/config'; | ||
|
||
export function registerFirestore(instance) { | ||
configureForFirebase(instance); | ||
} | ||
|
||
registerFirestore(firebase); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems to be identical to index.ts except it expects
So unless I'm confused, this isn't going to work for console folks. If you haven't already, I'd work with the console folks to get an end-to-end solution working before sending this out before trying to get this checked in... and it would be great if you could document how the integration works somewhere (how to trigger this build, what it exposes, how console consumes it, etc.). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was up working with @samhorlbeck and was under the impression that FB existed and that this was all that was needed. I'll sync back up w/ him and @tstirrat. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could be confused. As long as we have a (manual) end-to-end "build from github => integrate into console => console still works" validation, then I'll be happy. :-) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/** | ||
* Copyright 2017 Google Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
const { CheckerPlugin } = require('awesome-typescript-loader'); | ||
const { resolve } = require('path'); | ||
const webpack = require('webpack'); | ||
|
||
const baseConfig = { | ||
devtool: 'source-map', | ||
entry: resolve(__dirname, 'console.ts'), | ||
output: { | ||
filename: 'firestore-standalone.js', | ||
path: resolve(__dirname, 'dist') | ||
}, | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.tsx?$/, | ||
loader: 'awesome-typescript-loader' | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new CheckerPlugin(), | ||
new webpack.optimize.ModuleConcatenationPlugin(), | ||
new webpack.optimize.UglifyJsPlugin({ | ||
sourceMap: true, | ||
mangle: { | ||
props: { | ||
ignore_quoted: true, | ||
/** | ||
* This regex will trigger minification of subproperties that match | ||
* any of the following use cases: | ||
* | ||
* - Prefixed with an underscore (i.e. _) | ||
* - Suffixed with an underscore (i.e. _) | ||
* | ||
* Exceptions: | ||
* - Double underscore prefix/suffix (we have some props that rely on | ||
* this naming convention) | ||
* - `_lat` (we have a property in auth that depends on this name) | ||
* | ||
* This will be kept up to date as this changes | ||
*/ | ||
regex: /^_[^_][^lat]|[^_]_$/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This regex doesn't do what you say. You probably broke the The first branches matches underscore followed by not underscore followed any single character that is none of "l", "a", or "t". Better to treat Alternatively, you can phrase this with a negative lookahead, something like:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Turns out they don't need the minification. So this will be pulled. |
||
} | ||
}, | ||
compress: { | ||
passes: 3, | ||
unsafe: true, | ||
warnings: false | ||
} | ||
}) | ||
], | ||
resolve: { | ||
modules: ['node_modules', resolve(__dirname, '../../node_modules')], | ||
extensions: ['.js', '.ts'] | ||
} | ||
}; | ||
|
||
module.exports = baseConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment seems incomplete. Could you explain how this file works (i.e. what it plugs into, etc)?