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

♻️ Reorg type defs and remove compiler type stubs #37240

Merged
merged 17 commits into from
Dec 17, 2021

Conversation

rcebulko
Copy link
Contributor

@rcebulko rcebulko commented Dec 16, 2021

image
Removes twice as much as it adds

@rcebulko rcebulko requested review from samouri and removed request for kristoferbaxter December 16, 2021 20:30
@amp-owners-bot
Copy link

amp-owners-bot bot commented Dec 16, 2021

Hey @jridgewell! These files were changed:

src/core/3p-frame-messaging.js
src/core/amp-globals.d.ts
src/core/amp-mode.d.ts
src/core/assert/amp-globals.d.ts
src/core/assert/error.d.ts
src/core/assert/globals.d.ts
src/core/constants/async-input.d.ts
src/core/data-structures/amp-globals.d.ts
src/core/data-structures/globals.d.ts
src/core/data-structures/observable.js
src/core/dom/amp-globals.d.ts
src/core/dom/css-escape.third-party.d.ts
+18 more

Hey @ampproject/wg-performance! These files were changed:

tsconfig.base.json
tsconfig.json

@@ -21,7 +21,7 @@ const versionedBuilderMap = {
*/
function wrap(buildDom) {
return function wrapper(element) {
applyStaticLayout(element);
applyStaticLayout(/** @type {AmpElement} */ (element));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samouri This is a "new" type error. When we use the real #core types instead of your stubs, it comes up that this has to be an AMP element. That will obv not always be the case, ideally. Casting for now, but currently this would mask bugs with non-AMP elements.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should only function on AMP or Bento elements. Can tweak in the future.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I think applyStaticLayout could work on any Element

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO(you)

src/compiler/compile.js Show resolved Hide resolved
"exclude": ["node_modules"]
"extends": "../../tsconfig.base.json",
"compilerOptions": {"baseUrl": "../.."},
"include": ["**/*.js", "**/*.d.ts", "../core/**/globals.d.ts"],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tsconfig can/should look identical to this in every subfolder of src, which is very satisfying

Copy link
Member

@samouri samouri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fantastic.

src/compiler/compile.js Show resolved Hide resolved
src/compiler/tsconfig.json Outdated Show resolved Hide resolved
src/core/amp-globals.d.ts Show resolved Hide resolved
src/core/assert/globals.d.ts Outdated Show resolved Hide resolved
@rcebulko
Copy link
Contributor Author

@jridgewell for OWNERS approval of third_party/css-escape.d.ts

src/core/data-structures/globals.d.ts Show resolved Hide resolved
src/core/globals.d.ts Show resolved Hide resolved
@rcebulko rcebulko enabled auto-merge (squash) December 16, 2021 22:34
@rcebulko rcebulko merged commit 38e5023 into ampproject:main Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants