Commit Graph

98 Commits

Author SHA1 Message Date
Russell Bicknell
5d6f34f5b1 Remove unused TemplateInfo properties from types. 2019-08-27 17:25:00 -07:00
Russell Bicknell
9385436491 Add other used TemplateInfo property types. 2019-08-27 17:11:16 -07:00
Russell Bicknell
2697cf10b6 Add type for TemplateInfo#parent. 2019-08-27 16:55:04 -07:00
Daniel Freedman
a9c756e8a5 Merge branch 'master' into legacy-undefined-noBatch 2019-07-30 21:31:16 -07:00
Peter Burns
69ee4688af Add additional externs (#5575)
Upstreaming cl/259031976
2019-07-19 18:13:36 -07:00
Kevin Schaaf
42dd361f94 Fix closure issues 2019-03-07 18:12:26 -08:00
Daniel Freedman
2ed3bfac0e Add more externs
Add legacyWarnings and legacyNotifyOrder to externs
2019-02-20 20:03:44 -08:00
Daniel Freedman
cc7d4cc834 Add legacyUndefined and legacyNoBatch to externs 2019-02-20 17:04:01 -08:00
Daniel Freedman
e35a1a7cfc Update externs from internal 2019-02-07 11:45:13 -08:00
Kevin Schaaf
19dd467450 Merge branch 'strict-no-warnings' into sync-externs 2019-02-05 12:02:35 -08:00
Kevin Schaaf
77ac3ec2b4 Merge branch 'master' into strict-no-warnings 2019-02-05 11:56:53 -08:00
Peter Burns
7745d431ac Externs should use var instead of let
Multiple externs may declare the same symbol and that's ok. That doesn't work if an extern is declared with `let` instead of `var`, you get errors like: Duplicate let / const / class / function declaration in the same scope is not allowed.
2019-01-14 16:52:20 -08:00
Peter Burns
566dcfaefe Get Polymer compiling clean under closure recommended flags
With these changes we have zero errors and zero warnings with `RECOMMENDED_FLAGS`!

Most of the changes were adding `@override` for methods and properties in mixins. Apparently if you implement an interface you need to say `@override` for each method or property on the interface. This combines with our mixin strategy to the tune of needing to add `@override` on every non-private method and property.

I'm not sure this is intended behavior of the compiler. Filed https://github.com/google/closure-compiler/issues/3137 to see if it is.
2018-11-04 13:29:04 -08:00
Alexander Marks
b8e3002162 Hybrid compatibility for PolymerDomApi and Polymer.Iconset types.
Polymer V1 applications are compiled with hand-written externs at
https://github.com/google/closure-compiler/blob/master/contrib/externs/polymer-1.0.js.
These externs contain some types that do not exist in the V2 code.

PolymerDomApi is the type returned by the V1 Polymer.dom API, but in V2
it returns Polymer.DomApi. This adds the PolymerDomApi interface to the
V2 externs, and annotates that Polymer.DomApi implements it. This allows
both V1 and V2 code to use the PolymerDomApi type. Similar story for
PolymerDomApi.ObserveCallback.

Polymer.Iconset would ideally live in the iron-iconset repo, but many
packages reference the type without actually depending on that library,
so its simpler to just include it here, similar to how it worked for
Polymer V1.
2018-10-31 14:55:54 -07:00
Peter Burns
0492390b4e Add beforeRegister callback to externs 2018-10-23 09:50:50 -07:00
Tim van der Lippe
9dbc87284d Update gen-closure-declarations to 0.5.0 (#5360)
* Update gen-closure-declarations to 0.5.0

This fixes the externs generation for our modules

* Generate closure types before publishing

* Actually remove closure-types.js from git

* Remove HTML Imports from webcomponents externs

* Add back externs/polymer-externs.js
2018-09-18 21:05:19 +01:00
Kevin Schaaf
83834aff18 Upstream changes to externs 2018-08-28 14:48:13 -04:00
Kevin Schaaf
438c8c40bc Merge pull request #5310 from simonfuhrmann/master
Upstream externs changes for DomRepeatEvent
2018-08-15 10:20:53 -07:00
Alexander Marks
6847cf4791 Make Polymer gestures library safe for Closure property renaming (take 2). (#5314)
Make Polymer gestures library safe for Closure property renaming.

The issue here was that we were assuming that the method for a given
gesture would always match the string name of that gesture, e.g. that if
the gesture name was "mousedown" that we could call
gestureDefinition.mousedown. In actuality, gestureDefinition.mousedown
could be renamed by Closure, which would throw with "undefined is not a
function".

The fix is to move the GesturesRecognizer type into our externs, which
prevents those methods from being renamed.
2018-08-02 14:58:07 -07:00
Simon Fuhrmann
e3b9d4e6a3 Upstream externs changes for DomRepeatEvent 2018-07-30 11:06:33 -07:00
Alexander Marks
536030acfa Generate typings for Polymer 3.
- Publishing (actually packing) will now generate the typings and fail
  if they don't compile.
- Travis will now generate the typings and fail if they don't compile.
- Some minor tweaks to get typings compiling.
2018-07-26 18:28:22 -07:00
Alexander Marks
ac6011e0e4 Revert Promise<void> changes. 2018-07-26 18:06:52 -07:00
Alexander Marks
8b1e793470 Restore some externs. 2018-07-26 16:21:37 -07:00
Alexander Marks
3b8171922f Upstream a bunch of g3 changes. 2018-07-26 16:15:32 -07:00
Daniel Freedman
4f0337a5da Fix gulp 4 issues 2018-07-18 12:06:56 -07:00
Daniel Freedman
3c23d673ca Closure extern update 2018-04-11 12:17:09 -07:00
Tim van der Lippe
8d97d1311e Merge branch 'master' into rewrite-expression-parser 2018-03-31 15:52:33 +02:00
Peter Burns
5357d64aef Update types. 2018-03-30 15:59:57 -07:00
Tim van der Lippe
211c223fb9 Update docs and types 2018-02-25 16:13:16 +01:00
Daniel Freedman
2d674e75b1 update types 2018-02-21 14:11:51 -08:00
Daniel Freedman
8f8135b2de fix typings 2018-02-21 12:52:00 -08:00
Daniel Freedman
7e74e363ff Ensure DisableUpgradeMixin extends PropertiesMixin 2018-02-21 12:45:18 -08:00
Steven Orvell
5bc45ce390 update types 2018-02-21 10:28:07 -08:00
Steven Orvell
5607a2d8c3 Lint and type fixes 2018-02-06 14:48:36 -08:00
Mike Samuel
b52ab81dff Added Polymer.version to polymer-externs (#5079) 2018-01-31 12:31:18 -08:00
Steven Orvell
5521e43e69 update types 2018-01-30 15:19:58 -08:00
James Garbutt
589684a5a4 add void return type annotations (#5000)
* add void return type annotations

* define dom api prototype members as functions

* fix renderstatus optional parameters

* fix style-gatherer types

* fix templatize types

* fix event listener remove types

* use generics in mixinBehaviors

* update gen-typescript-declarations

* add memberof annotation to domapi methods

* add domapi types

* move dom methods to correct place

* use parameterless NodeList for the dom API
2018-01-09 15:10:12 -08:00
Alexander Marks
7b581de9a2 Address latest round of comments. 2017-12-18 16:47:20 -08:00
Tim van der Lippe
e872982269 Tighten more types for TypeScript and Closure (#4998) 2017-12-18 14:03:02 -08:00
Alexander Marks
f0e31f2d4f Fix compilation errors. 2017-12-13 14:17:58 -08:00
Daniel Freedman
986fb3e9fd re-add AsyncInterface definition, fix comment 2017-12-08 10:58:36 -08:00
Kevin Schaaf
40d47f24d1 Avoid _setPendingProperty warning due to types not understanding deduping mixin. 2017-12-08 10:55:33 -08:00
Kevin Schaaf
a12934c578 Fix most closure warnings. 2017-12-05 17:34:14 -08:00
Kevin Schaaf
b158e082d0 Merge with master 2017-12-05 15:49:07 -08:00
Steven Orvell
d3e1bae48a Merge branch 'master' into basic-element 2017-11-29 16:49:07 -08:00
Daniel Freedman
15d8c6af41 Merge branch 'master' into 2.x-shady-unscoped-style 2017-11-17 17:33:16 -08:00
Steven Orvell
d331c673fc Merge branch 'master' into basic-element 2017-11-10 17:04:15 -08:00
Daniel Freedman
cda62d5fd3 Implement type change in Polymer.ElementMixin 2017-11-02 15:01:05 -07:00
Peter Burns
4837e4a825 instance.$.foo should only give Elements
You need to be at least an `Element` to have an id attribute, and you need to have an id attribute to be in the `$` map.
2017-11-02 14:21:06 -07:00
Steven Orvell
1c5b731ffb Update externs again. 2017-10-19 14:57:51 -07:00