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

Shopify turbograft with Slate #178

Open
Bek81 opened this issue Sep 5, 2017 · 5 comments
Open

Shopify turbograft with Slate #178

Bek81 opened this issue Sep 5, 2017 · 5 comments

Comments

@Bek81
Copy link

Bek81 commented Sep 5, 2017

Hi,
I'm developing a customize shopify theme, using slate (https://www.shopify.com/partners/blog/introducing-slate-a-shopify-theme-scaffold-and-command-line-tool).
I would use turbograft, So I started at the beginning trying to use temporarily turbolinks.

I've included turbolinks (installed via npm) in my "src/scripts/theme.js":

/*!
 * Turbolinks
 */
// =require ../../node_modules/turbolinks/dist/turbolinks.js

and this way "navigation" seems to work properly.

But to use turobagraft I have to install it via "gem", so I tried to configure a Gemfile and replace the code with:

/*!
 * Turbolinks
 */
// =require turbolinks

"bundle install" command seems to work properly, but when i run "slate start -e development", an error occurs:

WARN: gulp-include - no files "......turbolinks".

Obviously once resolved this issue I would replace turbolinks with turbograft.

Can you help me to implement a proper scaffolding and project configuration, please?

Tnx a lot.

@Bek81
Copy link
Author

Bek81 commented Sep 7, 2017

UP:
alternately, can turbograft be installed via npm? Or at least have the JS files directly?

Tnx.

@qq99
Copy link
Contributor

qq99 commented Sep 7, 2017

Hi @Bek81, thanks for your interest!

At this time, we don't plan to offer any pre-compiled turbobraft.js or offer it via NPM, so, sorry to say, you'd have to build it yourself :) You could perhaps do this either manually using the coffee binary, or making a throwaway scaffold rails app, installing the turbograft gem, having rails do that compilation, and visiting the scaffold site to download the JS.

One thing to note: there are also some HTTP headers set by the ruby code in this library, but I think you will find they are not present when you go to deploy your theme. Depending on your usage of TurboGraft (e.g. simple partial page replacements), you may find that everything still mostly works as expected-- but your mileage may vary!

We're curious to hear where you get with this, so please feel free to continue to update us and/or link to your shop/theme :)

@Bek81
Copy link
Author

Bek81 commented Sep 7, 2017

Hi @qq99 , thanks.
No problem about NPM, but I tried installing via GEM and I didn't succeed. Where should the file be generated? Can you tell me the correct procedure (scaffolding and commands), please?

Thanks again.

Benedetto

@qq99
Copy link
Contributor

qq99 commented Sep 7, 2017

Mainly these steps @ https://github.com/Shopify/turbograft#installation

Alternatively, if you want to skip the rails infrastructure, and are OK with a bit quicker/hackier process, you could start at https://github.com/Shopify/turbograft/blob/master/lib/assets/javascripts/turbograft.coffee, copy&paste from the various *.coffee files into 1 mega coffee file, and run that through a coffee compiler (can find some web versions) to get some JS

@Bek81
Copy link
Author

Bek81 commented Sep 7, 2017

Ok, thn again. I tried with the first option. I'll try with the second one.

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

No branches or pull requests

2 participants