-
Notifications
You must be signed in to change notification settings - Fork 437
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
Do not rename .gs files to .js before pushing #51
Comments
@JeanRemiDelteil Is there a specific reason you want to use the |
Historically *.gs files are Google appsScript server side javascript.
Appart from these reasons, having the CLI changing files for no real reasons is not a good practice if it's not an intended feature (like : "clasp renametoJS" could do). |
I guess renaming to .js makes sense if we look at standard IDE support. By
renaming we get syntax highlighting and some code completion out of the
box.
…On Mon, Feb 26, 2018, 10:59 PM JeanRemiDelteil ***@***.***> wrote:
Historically *.gs files are Google appsScript server side javascript.
There are various reason to keep the 'gs' part:
- AppsScript is actually javascript 1.5 with some feature taken from
ES6 (destructuration for example)
- We can have *.js files in our local project that will be embedded as
*.js.html files later for client side javascript, in the same project.
- server side javascript and client javascript really do not behave in
the same way, it's clearer to keep the gs extension.
Appart from these reasons, having the CLI changing files for not real
reason is not a good practice if it's not an intended feature (like :
"clasp renametoJS" could do).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#51 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AF2bX1jkOMOKsS5CNsK_4zqxciVkQR5eks5tYunwgaJpZM4STmax>
.
|
All standard IDE support aliases for javascript files so that is not much of an issue. But the main issue is that the renaming is done when you upload the files to the remote AppsScript project, not when you are working on it. We are working with lots of different files and projects, and really appreciate having the clear difference between *.gs et *.js |
I can understand why keeping *.gs is attractive. For most users using *.js is fine or even preferred. In reply to the reasons:
.gs is also not recognized by many tools (linters, GitHub search) Using .js should be the default and is important for future language and tooling development. If you want to add a Using multiple extensions is a pain as can be seen with react |
I'm still pondering the use of gs / js. Also about the client javascript, we currently have this sort of typical structure (locally): ─ main.gs So you can't really regroup those files in a folder. I'm also wondering why would the "clasp push" command change the name of my files at all ? |
|
It seems that Google Apps Scripts only recognizes This seems like a serious enough issue to address now because when I push my addon to Google Apps Scripts my code doesn't get there. Even if it were an option in |
+1 to this issue, clasp shouldn't rename files. The I'd rather see:
|
@erickoledadevrel After
This is what would happen to all of my projects after I first implemented the above bullets. I too believe that This issue also gets a lot more complicated when introducing I support optional file extension support, #51 (comment), or any proposal that supports |
@grant After One point that is really important here, is that a PUSH operation on the server should not alter the local file system. Main issue with this is that we (and certainly others) are using CLASP to manage the pushing to GAS, (never really PULL by the way, as it's not needed after original old project import), but we have other tools in the pipeline, that takes care of the rest. |
@grant - Yes, I'm fine with that as a result. As long as we warn the developer, they can deal with the repercussions. Trying to match up existing To your |
This is also an issue when using gulp. If it renames .gs to .js and I ignore the .js file it will not upload. But if I don't ignore the .js file the gulp file gets renamed also. Which causes more issues to run gulp and have it watch and update the file. Will there be fix for using the just the .gs files without it renameing or is there a way to stop the renaming. I just started using this and need it to create gas files. |
What about adding a field to the |
Implementing #51 (comment) seems like a good choice. After this discussion, following Eric's comment I'll implement this:
@erickoledadevrel Last thing, after the |
This "feature" has become something of a pain point for me and has tempered much of my initial enthusiasm for this tool. I made a suggestion before (#27) similar to @erickoledadevrel. I'll reiterate it here. It may be a good idea to allow developers to opt-in or opt-out of this feature on a per project basis by allowing them to set a config option. Say:
Where |
@DimuDesigns @JeanRemiDelteil I've removed this feature that renames In the future we can support custom file extensions with clasp. Currently, as @erickoledadevrel stated above with #51 (comment) (and I totally agree with), clasp should not implicitly change the local filesystem. I pardon the delay with fixing this issue. |
much appreciated 👍 fixed by #27 |
Expected Behavior
When using : clasp push
a file named: Code.gs is still named Code.gs (locally, i'm not talking about remote)
Actual Behavior
When using : clasp push
a file named: Code.gs is renamed to Code.js
The project files should not be changed by the pushing operation.
Any preparation to the push operation should be done by the tool, without affecting project files.
Steps to Reproduce the Problem
Specifications
npm list | grep clasp
): 1.1.5The text was updated successfully, but these errors were encountered: