-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Conversation
Hey @jridgewell! These files were changed:
Hey @ampproject/wg-performance! These files were changed:
|
@@ -21,7 +21,7 @@ const versionedBuilderMap = { | |||
*/ | |||
function wrap(buildDom) { | |||
return function wrapper(element) { | |||
applyStaticLayout(element); | |||
applyStaticLayout(/** @type {AmpElement} */ (element)); |
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.
@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.
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 should only function on AMP or Bento elements. Can tweak in the future.
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.
Actually, I think applyStaticLayout could work on any Element
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.
TODO(you)
src/compiler/tsconfig.json
Outdated
"exclude": ["node_modules"] | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": {"baseUrl": "../.."}, | ||
"include": ["**/*.js", "**/*.d.ts", "../core/**/globals.d.ts"], |
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.
tsconfig
can/should look identical to this in every subfolder of src
, which is very satisfying
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 looks fantastic.
@jridgewell for OWNERS approval of |
Removes twice as much as it adds