Jonkman Microblog
  • Login
Show Navigation
  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. Alex (avolkov@mastodon.xyz)'s status on Monday, 24-Sep-2018 13:05:00 EDT Alex Alex

    Something is wrong with node config and webpack doesn't traspile js file using es6. ES6 is slightly better than JS but I'm not sure how many hours I can dedicate to fixing this issue.

    Compared to Python every bit of Node infrastructure is so complex that it makes me angry, and I can't use python because I need to run code inside the browser.

    *Makes indecent hand gestures at the screen*

    In conversation Monday, 24-Sep-2018 13:05:00 EDT from mastodon.xyz permalink
    1. Alex (avolkov@mastodon.xyz)'s status on Monday, 24-Sep-2018 13:14:26 EDT Alex Alex
      in reply to

      *more indecent hand gestures*

      I want to iterate over dictionary values.

      In python its done like this

      for v in mydict.values(): print(v)

      In ES6 it is supposed to be done like this

      for (let v in Object.entries(mydict)){console.log(v)}

      This is a bit verbose, but ok. There's even nice MDN article about it -- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries

      However this doesn't work because Node doesn't like it.

      https://github.com/rails/webpacker/issues/1021

      In conversation Monday, 24-Sep-2018 13:14:26 EDT from mastodon.xyz permalink
      1. Alex (avolkov@mastodon.xyz)'s status on Monday, 24-Sep-2018 13:14:58 EDT Alex Alex
        in reply to

        Apparently if I enable '--harmony' flag somewhere this will work

        In conversation Monday, 24-Sep-2018 13:14:58 EDT from mastodon.xyz permalink
      2. Alex (avolkov@mastodon.xyz)'s status on Monday, 24-Sep-2018 13:17:53 EDT Alex Alex
        in reply to

        Apparently if I enable '--harmony' flag somewhere this will work

        https://stackoverflow.com/questions/43858714/typeerror-object-entries-is-not-a-function

        However I'm using webpack to build the module and so far I have no idea how to do it, in webpack.config.js I have babel loader that should understand ES6 natively,

        {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'babel-loader',
        },

        But when it comes to running code, that doesn't work for some reason.

        *Makes indecent hand gestures at the screen*

        #js #es6 #webpack #babel

        In conversation Monday, 24-Sep-2018 13:17:53 EDT from mastodon.xyz permalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

Jonkman Microblog is a social network, courtesy of SOBAC Microcomputer Services. It runs on GNU social, version 1.2.0-beta5, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Jonkman Microblog content and data are available under the Creative Commons Attribution 3.0 license.

Switch to desktop site layout.