ecomplus / storefront

Modern and high performant headless eCommerce Storefront. PWA & JAMstack architecture ready for E-Com Plus APIs. Built with Vue.js, extensible through widgets and editable with Netlify CMS.
https://developers.e-com.plus/storefront/
MIT License
101 stars 36 forks source link

[RFC] Customization #177

Closed leomp12 closed 4 years ago

leomp12 commented 4 years ago

How Storefront V2 may be customized (from easier to harder) and TODOs:

  1. Insert HTML, JS and CSS with specified files predefined at Storefront Starter:

    • Split views in new partials to make possible to insert HTML in more (any) places;
    • Update Storefront Starter pages with new insert partials and respective imports;

:no_entry_sign: Update: new (better) approach with Storefront Starter git update https://github.com/ecomplus/storefront-starter/issues/119

  1. Edit prerendered HTML through EJS or dynamically update DOM with custom JS (can use jQuery):

Update: tracked on https://github.com/ecomplus/storefront/issues/191

  1. Use Webpack aliases on storefront.webpack.js to make deeper edits on Vue component parts (HTML, JS or SCSS);
leomp12 commented 4 years ago

@matheusgnreis take a look here please

leomp12 commented 4 years ago

@thiagoabreudev @ThaisChaves just a note, it'll also be included to docs (https://github.com/ecomplus/storefront/issues/169)

matheusgnreis commented 4 years ago

Only one of them? I think they complete each other, with storefront.webpack.js we can do deeper edits, just like you said.

leomp12 commented 4 years ago

@matheusgnreis not only one, all of 3 ways, I've just listed sorted by easier to harder (in my vision), but idea is to support all those customization strategies with easy (as possible).

leomp12 commented 4 years ago

Related to EJS includes for our widgets and components customization (such as Vue slots) https://github.com/mde/ejs/issues/500

Edit: Using views EJS option (not documented)

leomp12 commented 4 years ago

Thinking about moving entire EJS (pages) to Storefront Starter and use Git programmatically to make updates, it would prevent needing to copy and paste EJS code to edit.

Show me the code:

I'm just not sure yet if it can be consistent without having to do lot of work to implement :thinking: