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

Stencil AMP ⚡ #946

Merged
merged 1 commit into from
Mar 9, 2017
Merged

Stencil AMP ⚡ #946

merged 1 commit into from
Mar 9, 2017

Conversation

mcampa
Copy link
Contributor

@mcampa mcampa commented Mar 3, 2017

What?

Stencil AMP support for product and category pages

Tickets / Documentation

Screenshots (if appropriate)

image

@bigcommerce/stencil-team

@mcampa mcampa changed the title Stencil AMP Stencil AMP ⚡ Mar 3, 2017
@nickdengler
Copy link
Contributor

I'm getting the following error when I try to compile this locally:

Validating theme...
/Users/nick.dengler/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/lib/stencil-bundle.js:252
            throw err;
            ^

Error: Your theme's config.json has errors:
config.meta.features[20] is not one of enum values: fully_responsive,mega_navigation,multi_tiered_sidebar_menu,masonry_design,frontpage_slideshow,quick_add_to_cart,switchable_product_view,product_comparison_table,complex_search_filtering,customizable_product_selector,cart_suggested_products,free_customer_support,free_theme_upgrades,high_res_product_images,product_filtering,advanced_quick_view,product_showcase,persistent_cart,one_page_check_out,product_videos
    at BundleValidator.validateThemeConfiguration (/Users/nick.dengler/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/lib/bundle-validator.js:104:25)
    at /Users/nick.dengler/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/async/lib/async.js:718:13
    at iterate (/Users/nick.dengler/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/async/lib/async.js:262:13)
    at async.forEachOfSeries.async.eachOfSeries (/Users/nick.dengler/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/async/lib/async.js:281:9)
    at _parallel (/Users/nick.dengler/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/async/lib/async.js:717:9)
    at Object.async.series (/Users/nick.dengler/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/async/lib/async.js:739:9)
    at BundleValidator.validateTheme (/Users/nick.dengler/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/lib/bundle-validator.js:56:11)
    at validateTheme (/Users/nick.dengler/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/lib/stencil-bundle.js:250:15)
    at /Users/nick.dengler/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/async/lib/async.js:718:13
    at iterate (/Users/nick.dengler/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/async/lib/async.js:262:13)

Are there additional compile steps needed?

@junedkazi
Copy link
Contributor

@nickdengler you need to update stencil-cli

@bookernath
Copy link
Contributor

@mjschock would love your eyes on this

assets/js/app.js Outdated
if (PageTypeFn) {
const pageType = new PageTypeFn(context);
if (loadGlobal) {
globalClass = new Global;
Copy link
Contributor

Choose a reason for hiding this comment

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

can we invoke it like new Global() here? it just looks strange.

}

load() {
async.series([
Copy link
Contributor

Choose a reason for hiding this comment

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

nice - i like that it's here rather than in app.js

{{#each settings.add_this.buttons}}
{{#if service '!==' 'google'}}
{{#if service '!==' 'print'}}
{{#if service '!==' 'facebook'}}
Copy link
Contributor

Choose a reason for hiding this comment

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

wondering if we could use #all here with subexpressions:

{{#all (if service '!==' 'google') (if service '!==' print') (if service '!==' 'facebook')}}...

Copy link

Choose a reason for hiding this comment

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

Actually, maybe it would be better to put this logic into a helper and just return the computed html to the template. Easier to read, and likely less typing. Would that work?

@@ -0,0 +1,20 @@
<div class="form-field" data-product-attribute="input-checkbox">
<label class="form-label form-label--alternate form-label--inlineSmall">
{{display_name}}:
Copy link
Contributor

Choose a reason for hiding this comment

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

🍹 just looks odd to me with the empty line. maybe one of the following instead?

{{display_name}}&colon;
{{#if required}}
  <small>{{lang 'common.required'}}</small>
{{/if}}
{{display_name}}<span>&colon;</span>
{{#if required}}
  <small>{{lang 'common.required'}}</small>
{{/if}}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we are using : all over the templates, not using the entity &colon;

value="{{id}}"
{{#if selected}}checked{{/if}}
{{#if ../required}}required{{/if}}>

Copy link
Contributor

Choose a reason for hiding this comment

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

remove empty line (like in set-radio.html)

{{#block "amp-style"}} {{/block}}


{{{head.rsslinks}}}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit; do we need these empty lines

@mjschock
Copy link
Contributor

mjschock commented Mar 7, 2017

overall, LGTM 👍 a few minor nitpickings though

@mcampa mcampa force-pushed the amp branch 5 times, most recently from 2cd94f2 to 6e48f10 Compare March 9, 2017 02:30
@nickdengler
Copy link
Contributor

LGTM 💚 Awesome work all around!

@mcampa
Copy link
Contributor Author

mcampa commented Mar 9, 2017

Squeezing commits and rebasing before merging

@junedkazi
Copy link
Contributor

We need a change log entry for this. Also since this is going to get merged first can we also add a new line at the end of last entry since if you don't the last release title wraps up.

@mcampa mcampa merged commit 0d95be5 into bigcommerce:master Mar 9, 2017
@mcampa mcampa deleted the amp branch March 9, 2017 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants