Are we ready for JS modules in the browser?

72 views
Skip to first unread message

Marco Mansilla

unread,
Feb 26, 2018, 4:12:52 PM2/26/18
to web2py-develop.
Hello everyone, it's been a long time since we starting talking about getting rid of NodeJS.

Let's be honest, javascript features are really useful now a days, and it would be great if we can take advantage of some tools built with it, frameworks, libraries, etc. sometime ago was somehow painful because for most of the mentioned libraries and frameworks somehow ended up relying on Node, but now there is this "ES6 Modules in the Browser" feature, I'm guessing this is still on an early stage for browser support, but isn't this something web2py can take advantage of?.

https://jakearchibald.com/2017/es-modules-in-browsers/
https://medium.com/js-dojo/vue-js-single-file-javascript-components-in-the-browser-c03a0a1f13b8

Regards.
--
-----BEGIN GEEK CODE BLOCK-----
version 3.1
GCS/GTW/| d? s+:+>+++ a-- C+++(+++++) UL++++>$ P++>+++ L+++>+$ E->+ W++>+ N>+++ o K- w---(++++)
O(--) M>-- V-- PS++ PE++>+ Y-->+ PGP+>+++ t-(?) 5? X++ R+ !tv b+++>++++ DI+++ D--- G+++>+++++
e+++>++++ h* r++>+++ y++
------END GEEK CODE BLOCK------

Massimo DiPierro

unread,
Feb 26, 2018, 4:21:37 PM2/26/18
to web2py-d...@googlegroups.com
I did not know this was possible. We should definitively take advantage of this. I was thiking of including in web2py a new scaffolding vue.js app.

BTW. I do not like single file components in Vue. This is how I handle them:

// in file components/component1.js
Vue.component(‘component1', function (resolve, reject) {
  axios.get('components/component1.html’).then(function(data) {
    resolve(function(data){
      return {
        props: [],           
        data: function() {},
        methods: {}
      };
    });
  });
});

So the js is one file and the html in another.

--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-develop...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marco Mansilla

unread,
Feb 26, 2018, 6:41:22 PM2/26/18
to web2py-d...@googlegroups.com
This should make easier the possibility to have multiple components talking to each other. 

Please let me know if you have plans to apply this in the scaffold app. Would be happy to test


details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-developers+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
-- mail from:GoogleGroups "web2py-developers" mailing list

details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-developers+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages