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

Switch to ES6 #173

Closed
oparoz opened this issue Jun 20, 2015 · 8 comments
Closed

Switch to ES6 #173

oparoz opened this issue Jun 20, 2015 · 8 comments
Milestone

Comments

@oparoz
Copy link
Contributor

oparoz commented Jun 20, 2015

Now that ES 6 is official, we can begin to think about switching to it, but none of the browsers or transpilers support all the features, so it's probably a task for 2016.

https://kangax.github.io/compat-table/es6/

We currently support ES5 in strict mode.

It would be a great opportunity to add testing (#344) as we go along

Sponsorship

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@oparoz oparoz added this to the backlog milestone Jun 20, 2015
@Siddharth11
Copy link

Hi @oparoz!
How should we proceed with this task. I was thinking to make a new folder and transpiling (using grunt and babel) all files in js folder one by one.

@oparoz
Copy link
Contributor Author

oparoz commented Mar 2, 2016

I think you're on the right path. We would keep all source files in /js and have generated files in /js/dist perhaps?
The project has to be divided in several sub-projects, aiming to convert individual classes or group of classes, maing it easier to test for regressions.

Also, it would be a great opportunity to add testing (#344) as we go along

@Siddharth11
Copy link

@oparoz that sounds great!
Also, are we planning to implement all ES6 features? Honestly, I'm not a big fan of ES6 classes, it's like we're trying to make javascript into something else just for the ease of developers coming from different community. I still prefer normal prototypal inheritance (for efficiency) + a bit of functional programming approach (for readability) as seen in this tiny JS library I recently made using ES6.

Ultimately it's your call :)

@oparoz
Copy link
Contributor Author

oparoz commented Mar 2, 2016

Also, are we planning to implement all ES6 features?

I don't think that's necessary. I simply would like for the code to be more robust, easier to understand and testable.

Regarding ES6 classes, I'd like to hear what @BernhardPosselt, @icewind1991 and maybe @PVince81 have to say about it.

When reading es6 code, I find import/export statements useful per example.

@BernhardPosselt
Copy link

I'm unsure if this is a well defined GSOC task (mechanical turk work :D) and if its a benefit to do this right now. FYI Modules are not implemented in any browser yet and you also dont see them listed on kangax' es6 table which means that you will have to transpile no matter what.

The transpiling experience itself is quite horrible IMHO, there are too many choices (typescript, es6, coffeescript) too many tools (gulp, webpack, browserify) and too much configuration and headaches (karma). I've given up and will gradually enhance newer code so I won't have to transpile.

@BernhardPosselt
Copy link

Another addition to ES6 modules: the current wrapper logic (in whatever module loader) is vastly different from the actual spec, so this has potential to break when you don't use the wrapper anymore.

@oparoz
Copy link
Contributor Author

oparoz commented Mar 3, 2016

Thank you for your valuable input @BernhardPosselt .

I created the issue last year as a long term goal to modernize and better organize the app. That's the reason I wanted to focus on classes and modules first and didn't mind having to transpile everything. Having said that, there will probably be an issue with debugging, because the end result in the browser will not match what we wrote. This makes it even harder for people not familiar with the project.

If we drop transpiling then it becomes, as you've mentioned, only about migrating methods and I doubt students will find this project interesting.

What do you think @Siddharth11? Have you looked at the code in Gallery and do you see some opportunities to improve the overall architecture? Have you worked on projects of similar size using ES6 + transpiling?
Don't forget that you can come up with your own projects, so don't hesitate to come up with new ideas.

@oparoz
Copy link
Contributor Author

oparoz commented Sep 4, 2016

This issue was moved to nextcloud/gallery#34

@oparoz oparoz closed this as completed Sep 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants