Juicy / juicy-ace-editor

Custom Element with the Ace code editor
http://juicy.github.io/juicy-ace-editor/
MIT License
93 stars 34 forks source link

add es module, add missing dependency #41

Closed lastmjs closed 6 years ago

lastmjs commented 6 years ago

I want to start pushing es modules forward for juicy-ace-editor, I need this for my own project. As is, this should mostly work. I do not have the tests passing yet, and loading themes and modes through attributes does not work, and keep in mind that the element will now need to be served with something like Polyserve or Zwitterion, as bare specifiers are not native. I'm hoping the latest versions of web-component-tester will provide bare specifier support. I want to get feedback and see what else is necessary to get this going.

alshakero commented 6 years ago

Hi! Thank your for the PR.

Can you use node_js: 8 in .travis.yml please?

lastmjs commented 6 years ago

I've got the Chrome test passing, I should be able to get the Firefox test passing soon

lastmjs commented 6 years ago

I'm removing the Firefox test for now, it can be added back in next week when Firefox 60 ships. Firefox 60 will add support for ES Modules. All tests should pass after that

lastmjs commented 6 years ago

I've added the html file back. The caveat is that it still depends on ES Modules, so it can be imported using HTML imports, but the browser must support ES Modules still. If that isn't what you wanted (it probably isn't), just let me know and I can add back the original html file.

lastmjs commented 6 years ago

I should probably add a separate test for loading through es modules as well. Just let me know.

lastmjs commented 6 years ago

Also, just received word that Polymer 3 will be officially released next week, perfect timing to get this element switched to ES Modules: https://www.polymer-project.org/blog/2018-05-02-roadmap-update.html

tomalec commented 6 years ago

Thanks a lot, @lastmjs!

Speaking of

I'm removing the Firefox test for now, it can be added back in next week when Firefox 60 ships. Firefox 60 will add support for ES Modules. All tests should pass after that

To keep continuous browser support, and merge your PR sooner, I think we can keep a redundant source in juicy-ace-editor.html for this week and remove it after.

Or write a simple script that translates import .. to <script src= and wraps the rest in <script></script> to produce a legacy file. So we could give a chance for Samsung Internet and UC Browser (however, I have never tested juicy-ace-editor there)

alshakero commented 6 years ago

I'm merging to my branch and I'll continue from there.

lastmjs commented 6 years ago

@alshakero Does that mean you're taking over these proposed features? Just want to make sure I don't leave anything hanging

alshakero commented 6 years ago

Yes exactly. I'll continue from here thank you so much for the great effort.