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

Theme Watch/Upload Ace Editor Cloud9 IDE #416

Closed
me3design opened this issue Jun 20, 2017 · 7 comments

Comments

@me3design
Copy link

commented Jun 20, 2017

We are trying to use a Cloud9 workspace for collaborative editing on a Shopify Theme. Installing themekit, generating the api password, configuring the existing theme all worked perfectly.

The issue has to do with running theme watch or theme upload. For some strange reason, the edited code is sending several versions of the saved page to Shopify. One version with the correct code, and then a second later another version with a lot of garbled code regarding the Ace editor. You can see these older versions using the Shopify admin html editor.

Is there anything you can do on your end to help us trouble shoot this?

Not sure what can be done to properly use Cloud9 to push updates without this happening. We will reach out to C9 and see if they have any insight as to why this is occurring.

Thanks in advance.

@tanema

This comment has been minimized.

Copy link
Contributor

commented Jun 21, 2017

Hey @me3design I am not really familiar with cloud9, it would definitely have to do with the OS file events within the environment. I am not sure how the environments are setup entirely on cloud9 so I am not sure how much I can do to debug this issue.

@me3design

This comment has been minimized.

Copy link
Author

commented Jun 21, 2017

Hey @tanema thanks for the prompt reply. C9 is a Linux environment and we ran the automatic install script to install themekit:
curl -s https://raw.githubusercontent.com/Shopify/themekit/master/scripts/install | sudo python

I'll reach out to C9 to see if they have any suggestions as to why or how the Ace Editor could be causing the issue. If you are willing C9 has a free user level, so it would be easy for you or someone on the team to set up an account and test themekit in that environment. No worries, if that is something you are not interested in. If a Cloud based IDE would work with themekit it would open up a lot of possibilities for collaborative development. So, we are hopeful we can find a solution.

I'll write back if I hear anything from C9.

@tanema

This comment has been minimized.

Copy link
Contributor

commented Jun 26, 2017

I have tested this out and at first I couldn't get it to work but then I deleted the file contents and saved and in the online editor it had these contents:

{"filter":false,"title":"app.js.liquid","tooltip":"/assets/app.js.liquid","undoManager":{"mark":54,"position":54,"stack":[[{"start":{"row":0,"column":0},"end":{"row":1,"column":0},"action":"insert","lines":["",""],"id":2}],[{"start":{"row":0,"column":0},"end":{"row":0,"column":1},"action":"insert","lines":["/"],"id":3}],[{"start":{"row":0,"column":1},"end":{"row":0,"column":2},"action":"insert","lines":["/"],"id":4}],[{"start":{"row":0,"column":2},"end":{"row":0,"column":3},"action":"insert","lines":[" "],"id":5}],[{"start":{"row":0,"column":3},"end":{"row":0,"column":4},"action":"insert","lines":["T"],"id":6}],[{"start":{"row":0,"column":4},"end":{"row":0,"column":5},"action":"insert","lines":["h"],"id":7}],[{"start":{"row":0,"column":5},"end":{"row":0,"column":6},"action":"insert","lines":["i"],"id":8}],[{"start":{"row":0,"column":6},"end":{"row":0,"column":7},"action":"insert","lines":["s"],"id":9}],[{"start":{"row":0,"column":7},"end":{"row":0,"column":8},"action":"insert","lines":[" "],"id":10}],[{"start":{"row":0,"column":8},"end":{"row":0,"column":9},"action":"insert","lines":["i"],"id":11}],[{"start":{"row":0,"column":9},"end":{"row":0,"column":10},"action":"insert","lines":["s"],"id":12}],[{"start":{"row":0,"column":10},"end":{"row":0,"column":11},"action":"insert","lines":[" "],"id":13}],[{"start":{"row":0,"column":11},"end":{"row":0,"column":12},"action":"insert","lines":["a"],"id":14}],[{"start":{"row":0,"column":12},"end":{"row":0,"column":13},"action":"insert","lines":[" "],"id":15}],[{"start":{"row":0,"column":13},"end":{"row":0,"column":14},"action":"insert","lines":["t"],"id":16}],[{"start":{"row":0,"column":14},"end":{"row":0,"column":15},"action":"insert","lines":["e"],"id":17}],[{"start":{"row":0,"column":15},"end":{"row":0,"column":16},"action":"insert","lines":["s"],"id":18}],[{"start":{"row":0,"column":16},"end":{"row":0,"column":17},"action":"insert","lines":["t"],"id":19}],[{"start":{"row":0,"column":17},"end":{"row":0,"column":18},"action":"insert","lines":[" "],"id":20}],[{"start":{"row":0,"column":18},"end":{"row":1,"column":0},"action":"insert","lines":["",""],"id":21}],[{"start":{"row":1,"column":0},"end":{"row":1,"column":1},"action":"insert","lines":["/"],"id":22}],[{"start":{"row":1,"column":1},"end":{"row":1,"column":2},"action":"insert","lines":["/"],"id":23}],[{"start":{"row":1,"column":2},"end":{"row":1,"column":3},"action":"insert","lines":[" "],"id":24}],[{"start":{"row":1,"column":3},"end":{"row":1,"column":4},"action":"insert","lines":["T"],"id":25}],[{"start":{"row":1,"column":4},"end":{"row":1,"column":5},"action":"insert","lines":["h"],"id":26}],[{"start":{"row":1,"column":5},"end":{"row":1,"column":6},"action":"insert","lines":["i"],"id":27}],[{"start":{"row":1,"column":6},"end":{"row":1,"column":7},"action":"insert","lines":["s"],"id":28}],[{"start":{"row":1,"column":7},"end":{"row":1,"column":8},"action":"insert","lines":[" "],"id":29}],[{"start":{"row":1,"column":8},"end":{"row":1,"column":9},"action":"insert","lines":["i"],"id":30}],[{"start":{"row":1,"column":9},"end":{"row":1,"column":10},"action":"insert","lines":["s"],"id":31}],[{"start":{"row":1,"column":10},"end":{"row":1,"column":11},"action":"insert","lines":[" "],"id":32}],[{"start":{"row":1,"column":11},"end":{"row":1,"column":12},"action":"insert","lines":["m"],"id":33}],[{"start":{"row":1,"column":12},"end":{"row":1,"column":13},"action":"insert","lines":["o"],"id":34}],[{"start":{"row":1,"column":13},"end":{"row":1,"column":14},"action":"insert","lines":["r"],"id":35}],[{"start":{"row":1,"column":14},"end":{"row":1,"column":15},"action":"insert","lines":["e"],"id":36}],[{"start":{"row":1,"column":15},"end":{"row":1,"column":16},"action":"insert","lines":[" "],"id":37}],[{"start":{"row":1,"column":16},"end":{"row":1,"column":17},"action":"insert","lines":["u"],"id":38}],[{"start":{"row":1,"column":17},"end":{"row":1,"column":18},"action":"insert","lines":["p"],"id":39}],[{"start":{"row":1,"column":18},"end":{"row":1,"column":19},"action":"insert","lines":["s"],"id":40}],[{"start":{"row":1,"column":19},"end":{"row":1,"column":20},"action":"insert","lines":["t"],"id":41}],[{"start":{"row":1,"column":20},"end":{"row":1,"column":21},"action":"insert","lines":["a"],"id":42}],[{"start":{"row":1,"column":21},"end":{"row":1,"column":22},"action":"insert","lines":["t"],"id":43}],[{"start":{"row":1,"column":22},"end":{"row":1,"column":23},"action":"insert","lines":["e"],"id":44}],[{"start":{"row":1,"column":22},"end":{"row":1,"column":23},"action":"remove","lines":["e"],"id":45}],[{"start":{"row":1,"column":21},"end":{"row":1,"column":22},"action":"remove","lines":["t"],"id":46}],[{"start":{"row":1,"column":20},"end":{"row":1,"column":21},"action":"remove","lines":["a"],"id":47}],[{"start":{"row":1,"column":19},"end":{"row":1,"column":20},"action":"remove","lines":["t"],"id":48}],[{"start":{"row":1,"column":18},"end":{"row":1,"column":19},"action":"remove","lines":["s"],"id":49}],[{"start":{"row":1,"column":18},"end":{"row":1,"column":19},"action":"insert","lines":["d"],"id":50}],[{"start":{"row":1,"column":19},"end":{"row":1,"column":20},"action":"insert","lines":["a"],"id":51}],[{"start":{"row":1,"column":20},"end":{"row":1,"column":21},"action":"insert","lines":["t"],"id":52}],[{"start":{"row":1,"column":21},"end":{"row":1,"column":22},"action":"insert","lines":["e"],"id":53}],[{"start":{"row":1,"column":22},"end":{"row":1,"column":23},"action":"insert","lines":["s"],"id":54}],[{"start":{"row":1,"column":23},"end":{"row":1,"column":24},"action":"insert","lines":[" "],"id":55}],[{"start":{"row":0,"column":0},"end":{"row":1848,"column":0},"action":"remove","lines":["// This is a test ","// This is more updates 
...

This all looks like data from their editor which is very weird. When themekit gets a notification of a file change, it reads that file from disk. I am not sure why that files contents would equal the above contents when I just deleted the contents. This is definitely something that cloud 9 is doing with system events.

@me3design

This comment has been minimized.

Copy link
Author

commented Jun 26, 2017

Hey @tanema thanks for taking the time to test themekit out on c9. That was really nice of you.
I got the same results as you and agree that the Ace editor they are using is somehow causing the issue. It is strange that theme watch correctly sends the updated file and then follows it with another updated file and the addtional injected code you indicated above.

I logged into codeanywhere and tested theme kit out there to verify the issue is unique to c9. I'm happy to report that it works perfectly on codeanywhere. I'll reach back out to c9 with this new information and see if they can determine what is causing the issue on their platform. I'll report back if they are able to find a fix.

@me3design

This comment has been minimized.

Copy link
Author

commented Jun 27, 2017

Hey @tanema I heard back from c9 and they offered a workaround to the issue. Here's what they had to say:

Cloud9 saves metadata about edited files in .c9 folder in workspace root. Sounds like the watch task you use uploads files from it too. One workaround is to put all the files of your theme in a folder in your workspace, so that .c9 folder is outside of the watched directory.

I moved the theme and config file into a root level folder and cd to that folder to run theme watch and now it works perfectly. Hopefully this support thread will save someone else significant time if they want to use c9 and theme kit to work collaboratively on a shopify site.

@tanema

This comment has been minimized.

Copy link
Contributor

commented Jun 27, 2017

@me3design That is great news. I will add this to the FAQ on the documentation website.

@tanema

This comment has been minimized.

Copy link
Contributor

commented Jun 27, 2017

I have now added it to the FAQ

@tanema tanema closed this Jun 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.