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

Request: separate version of the plugin that is just the grammar #64

Closed
bolinfest opened this issue Sep 11, 2015 · 11 comments
Closed

Request: separate version of the plugin that is just the grammar #64

bolinfest opened this issue Sep 11, 2015 · 11 comments

Comments

@bolinfest
Copy link

On Nuclide, we have a whole process for all things transpilation, so we really just want proper syntax highlighting for ES6+ files. Trying to navigate the settings that come with this package is intimidating/confusing.

Specifically, looking at the Settings, I don't know what "Transpile on Save" means. Transpile to where? Is this package writing files? If so, where are these files being written?

Basically, my out of the box experience with this package was: "Wow this syntax highlighting is great...Wait, how do I get rid of that popup?"

I'm sure that the transpilation stuff is valuable for a lot of workflows, but I was under the impression that most langauge-XXX packages for Atom were syntax highlighters for XXX.

@bolinfest
Copy link
Author

Or how about just changing transpileOnSave to default to false?

https://github.com/gandm/language-babel/blob/master/lib/config.coffee#L4

@bolinfest
Copy link
Author

After looking through the code, I see that I can just uncheck the "Transpile On Save" checkbox to get what I want. However, I don't feel comfortable encouraging others en masse (say anyone who works on Nuclide) to use this if I know they're all going to hit this speedbump with the popup.

@gandm
Copy link
Owner

gandm commented Sep 11, 2015

I thought the readme was quite explanatory but I'm sorry if it is confusing. If you want nuclide to do everything then as you rightly say just disable 'transpile on save' which in fact just runs the transpiler as a check for syntax but does nothing else. This was written before Nuclide and I just needed a quick way to get ES2015 running. The problem I have is that I have no idea if anyone is using this package nor what bits they use. Some people have asked me to disable the grammar for JSX, others want to extend the language-babel setting to a project file directory level.

I could change the default to disable 'transpile on save' and I don't think that would cause any existing users a problem. I may well do this on the next publish.

@bolinfest
Copy link
Author

@gandm Thanks for the quick reply: defaulting to disable 'transpile on save' would certainly do it for me. Then no one encounters unexpected pop-ups after installing this package for the first time. Those who need functionality beyond syntax highlighting can easily dig into the settings to find it.

@gandm
Copy link
Owner

gandm commented Sep 11, 2015

Relevant part of readme is
Use Cases

Pure JavaScript with no EcmaScript 2015 requirements.
Just use the Grammar to color code the scripts and turn off the package setting Transpile On Save .

@gandm gandm closed this as completed in 43243a9 Sep 12, 2015
@bolinfest
Copy link
Author

Perfect -- thank you so much!

@bolinfest
Copy link
Author

Can we reopen this? It seems like more code is being added to this package to add more support for the transpiler. This is adversely affecting the load time for this package, which is a problem for those of us who just want syntax highlighting.

If things were refactored so that anything the transpilation needs were lazy-loaded, that would also help, but the eager loading is a killer.

@gandm
Copy link
Owner

gandm commented Sep 22, 2015

As I mentioned I will split the grammar so I'll reopen this. I don't think the time taken to load the app is much to do with eager vs. lazy loading of dependencies; although that would help. I just made my app have an en empty activate and deactivate and removed all requires from all coffeescripts and it was still slow. Removing the grammar helps a lot - as shown in the second shot!

Provided the cache is up to date the grammar seems to be about 70% of the overall load time. Third screen shot group.

Empty activate/deactivate & no requires
image

image

No Grammar
image

App back to normal and with grammar
image

@bolinfest
Copy link
Author

#85 explains it all.

If you're still serious about publishing a version of this package that is only the grammar, then that's great and I'll drop the issue. If not, I'll create my own internal fork that does this.

@zertosh
Copy link
Contributor

zertosh commented Sep 23, 2015

Hey @gandm and @bolinfest, I just had a quick chat with @sebmck, and we think there's a place under the babel org for the grammar only. How about we open up babel/babel-atom (a sibling to babel/babel-sublime) to host & promote the grammar (without the transpile stuff) as the official babel one? What do you think @gandm?

@gandm
Copy link
Owner

gandm commented Sep 23, 2015

@zertosh , @bolinfest , @sebmck I don't have a problem, anyone can take the grammar and do with it whatever they want. If it meets your needs; at least until the AST can be used as grammar; then fine.
You may want to check out subtleGradients grammar, language-javascript-jsx, reading one of his issues he indicates he has a new grammar but hasn't released it yet. It may be better than mine.

Let me know if you proceed so that I don't create my own separate grammar.

@gandm gandm closed this as completed Sep 30, 2015
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

3 participants