Skip to content

🏗 Add "wrapper": "bento" option to Bento components#34838

Merged
caroqliu merged 1 commit intoampproject:mainfrom
caroqliu:bento-bundle
Jun 11, 2021
Merged

🏗 Add "wrapper": "bento" option to Bento components#34838
caroqliu merged 1 commit intoampproject:mainfrom
caroqliu:bento-bundle

Conversation

@caroqliu
Copy link
Copy Markdown
Contributor

@caroqliu caroqliu commented Jun 11, 2021

This PR establishes build-system/compile/bundles.config.extensions.json as the file to be utilized as the ground truth for all components which have a Bento version and what that version is, while configuring all current Bento components with options: { "wrapper": "bento" }. This change does not impact the bundling/build process.

Notes:

  • options: {wrapper: "bento"} is a temporary state that is being introduced immediately for ease of reference by publishers wanting to use Bento components and easily identify which these are. It is preferred to bento: true or bentoVersion: "1.0" because the wrapper piece will be utilized by the auto-envelope effort (see below).
  • The final state is expected to be options: {wrapper: wrappers.bento} once [WIP] Bento Auto-Envelope #30275 🏗♻️ Bento Auto-Envelope #34820 is finalized.
  • The option is made distinct from the npm: true option because the set of Bento components is not equal to the set of components that publish to npm (though it is true that these heavily overlap.)

Copy link
Copy Markdown
Member

@alanorozco alanorozco left a comment

Choose a reason for hiding this comment

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

LGTM.

@caroqliu caroqliu merged commit 3547e62 into ampproject:main Jun 11, 2021
westonruter added a commit to westonruter/amphtml that referenced this pull request Jun 11, 2021
…ebook-like-bento-version

* 'main' of github.com:ampproject/amphtml:
  minor updates + fix broken links (ampproject#34840)
  Add "wrapper": "bento" option to Bento components (ampproject#34838)
  ♻️ Move src/layout into core to unblock buildDOM for amp-layout (ampproject#34818)
  ♿ Apply `lang="en"` to relevant snippets in `test/` (ampproject#34768)
  Bento: Enable `npm` for `amp-video` (ampproject#34822)
  ✨[story-ads] Introduce new yellow segment progress bar v2 (ampproject#34804)
  SwG Release (ampproject#34825)
  📦 Update build-system devDependencies to v7.14.5 (ampproject#34802)
  Disable viewport warnings in experiment. (ampproject#34809)
  Apply lang="en" to examples/ (ampproject#34759)
  ✨ [Amp story] Scaffold desktop one panel experiment (ampproject#34755)
  ♻️ Migrate Style and DOM helpers into core/DOM + type-checking (ampproject#34681)
  🏗 Don't pull all externs into experiments (ampproject#34800)
  typechecking: remove pride as not compatible with rest of strategy (ampproject#34787)
  Fix forbidden terms to unblock `main` (ampproject#34799)
alanorozco added a commit that referenced this pull request Jun 11, 2021
`amp make-extension --bento` now adds property to bundle config like in #34838
@caroqliu caroqliu mentioned this pull request Jun 11, 2021
7 tasks
AnuragVasanwala added a commit to rtCamp/amphtml that referenced this pull request Jun 14, 2021
ampproject#34838

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>
alanorozco added a commit that referenced this pull request Jun 14, 2021
`amp make-extension --bento` now adds property to bundle config like in #34838
caroqliu added a commit that referenced this pull request Jun 24, 2021
* Initial Commit

* Property mappings and Cleanup

* Minor fixes, Formatting and Comments

* More readable variable name

* Test Cases for Bento

* Updated test-cases and Storybook

* Added base CSS File

* Bug Fix: Layout System and Unit

* Parent element changed from <div> to <>

* Type correction for 'visual' parameter

* Bug fix for color parameter in storybook

* Update extensions/amp-soundcloud/1.0/base-element.js

Bento components are required to be R1. We have an equivalent static getPreconnects(element) in R1 designed to take care of this.

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>

* ♻️ Add 'wrapper' designation to bento

#34838

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* 🚮 Delete init/constructor of `amp-soundcloud`

No need to override `init` if no changes were made to it except calling parent class's `init`.

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* ♻️ Use `passthroughNonEmpty` which only give `<slot>` for non empty `children`

Since `passthrough` gives a `<slot>` reference to the children prop in all cases, let's make this passthroughNonEmpty -- which will only give a `<slot>` if there are children in the given markup.

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* ♻️ Warning for required props when not present

* ♻️ Warning for required pros when not present

* ♻️ Warning for required props when not present

* ♻️ `trackId` and `playlistId` order chek

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* ♻️ `trackId` and `playlistId` order check

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* ♻️ Removed explicitly specify boolean `true` for conditional block

No need to explicitly specify boolean `true` for conditional block.

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* ♻️ Added default value for `visual` prop in Preact component

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* 🚮 Removed props handled by AMP's layout system

`height`, `heights`, `media`, `sizes`, and `width` are not needed to pass through as these attributes are specific to AMP's layout system and handled by the runtime.

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* 🚮 Removed unnecessary typedef

`height`, `heights`, `media`, `sizes`, and `width` are not needed to pass through as these attributes are specific to AMP's layout system and handled by the runtime. Thus they do not need to be specify in typedef.

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* 🚮 Removed interface as no API exposed

* ♻️ Moved `converter.js` into storybook

* 🚮 Removed `layout` from Preact example, ♻️ Added `height` into style

* 🚮 Removed empty CSS and `hasCss` from `bundles.config.extensions.json`

* 🐛 `htmlFor` import fix for test case, ♻️ added `data-trackid` attribute

* ♻️ Replaced `<iframe>` with `<IframeEmbed>`

* ♻️ Updated specification for validation

* 🏗 Added `npm` to `bundles.config.extensions.json`

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* ♻️ New line at EOF in `validator-amp-soundcloud.out`

* Added 'loadable' to indicate a resource intensive component

* 🏗 Fixes reported by 'amp lint' for CI

* 🏗 Fixes for aliased imports for CI

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>
antiphoton pushed a commit to antiphoton/amphtml that referenced this pull request Jun 25, 2021
* Initial Commit

* Property mappings and Cleanup

* Minor fixes, Formatting and Comments

* More readable variable name

* Test Cases for Bento

* Updated test-cases and Storybook

* Added base CSS File

* Bug Fix: Layout System and Unit

* Parent element changed from <div> to <>

* Type correction for 'visual' parameter

* Bug fix for color parameter in storybook

* Update extensions/amp-soundcloud/1.0/base-element.js

Bento components are required to be R1. We have an equivalent static getPreconnects(element) in R1 designed to take care of this.

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>

* ♻️ Add 'wrapper' designation to bento

ampproject#34838

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* 🚮 Delete init/constructor of `amp-soundcloud`

No need to override `init` if no changes were made to it except calling parent class's `init`.

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* ♻️ Use `passthroughNonEmpty` which only give `<slot>` for non empty `children`

Since `passthrough` gives a `<slot>` reference to the children prop in all cases, let's make this passthroughNonEmpty -- which will only give a `<slot>` if there are children in the given markup.

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* ♻️ Warning for required props when not present

* ♻️ Warning for required pros when not present

* ♻️ Warning for required props when not present

* ♻️ `trackId` and `playlistId` order chek

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* ♻️ `trackId` and `playlistId` order check

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* ♻️ Removed explicitly specify boolean `true` for conditional block

No need to explicitly specify boolean `true` for conditional block.

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* ♻️ Added default value for `visual` prop in Preact component

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* 🚮 Removed props handled by AMP's layout system

`height`, `heights`, `media`, `sizes`, and `width` are not needed to pass through as these attributes are specific to AMP's layout system and handled by the runtime.

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* 🚮 Removed unnecessary typedef

`height`, `heights`, `media`, `sizes`, and `width` are not needed to pass through as these attributes are specific to AMP's layout system and handled by the runtime. Thus they do not need to be specify in typedef.

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* 🚮 Removed interface as no API exposed

* ♻️ Moved `converter.js` into storybook

* 🚮 Removed `layout` from Preact example, ♻️ Added `height` into style

* 🚮 Removed empty CSS and `hasCss` from `bundles.config.extensions.json`

* 🐛 `htmlFor` import fix for test case, ♻️ added `data-trackid` attribute

* ♻️ Replaced `<iframe>` with `<IframeEmbed>`

* ♻️ Updated specification for validation

* 🏗 Added `npm` to `bundles.config.extensions.json`

Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>

* ♻️ New line at EOF in `validator-amp-soundcloud.out`

* Added 'loadable' to indicate a resource intensive component

* 🏗 Fixes reported by 'amp lint' for CI

* 🏗 Fixes for aliased imports for CI

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
Co-authored-by: Caroline Liu <10456171+caroqliu@users.noreply.github.com>
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.

3 participants