Coder Social home page Coder Social logo

Comments (8)

smnbbrv avatar smnbbrv commented on May 27, 2024 1

@wrummler thanks for the contribution! Check v2.0.6

from ngx-sortablejs.

smnbbrv avatar smnbbrv commented on May 27, 2024

@wrummler ahem, that sounds weird. AOT build usually cannot break a non-AOT one, from what I know. Could you, please, tell more about your environment?

  • Webpack or systemjs and the version of the one
  • angular version
  • angular-sortablejs version

It would also help to have a public repo where the issue could be reproduced

from ngx-sortablejs.

rummelsworth avatar rummelsworth commented on May 27, 2024

I applied the README instructions to the quickstart seed and got the same error as #44. Repo here.

I don't think this is a AoT/non-AoT issue at this point. I think these issues boil down to 6b7a969 introducing the requirement that the user's module loader understand ES2015 modules. For example, my non-AoT app is a very plain Electron/Angular setup (derived from electron-forge init's Angular template) that simply uses Node's require to load modules. When it sees export, it doesn't recognize the token because Node doesn't yet provide built-in support for ES2015 modules. Similarly, when SystemJS sees it in e.g. the quickstart repo linked above, apparently it's trying to grab traceur to transpile it on-the-fly. This is part of the quickstart behavior:

Unable to load transpiler to transpile http://localhost:3000/node_modules/angular-sortablejs/dist/index.js

I made another branch that attempts to work around the issue by including configuration for systemjs-plugin-traceur. It eliminates the error in that example repo, but the behavior of the simple example included from this project's README seems incorrect, since the "See the result" items are not updated when the dragged items are.

Also, this workaround isn't available for my actual project, since we're not using SystemJS (or Webpack etc), just Node's require in Electron.

from ngx-sortablejs.

rummelsworth avatar rummelsworth commented on May 27, 2024

I updated the issue title. Please consider this a suggestion to remove the requirement by including a CommonJS-compatible main entry in the distributed package.json and allowing ES2015 module users (e.g. those using AoT with Rollup) to configure their loader to point to a separate ES2015 build file also included with the distributed package. Thanks.

from ngx-sortablejs.

smnbbrv avatar smnbbrv commented on May 27, 2024

that could be then the same issue as this one #44. You are right

from ngx-sortablejs.

smnbbrv avatar smnbbrv commented on May 27, 2024

@wrummler could you please check if v2.0.5 fixes the issue?

from ngx-sortablejs.

smnbbrv avatar smnbbrv commented on May 27, 2024

fixed the second issue too. For some reason the change detection trigger was not done

from ngx-sortablejs.

rummelsworth avatar rummelsworth commented on May 27, 2024

@smnbbrv Thanks, 2.0.5 fixed it for me.

Also, I don't have an AoT setup handy to double-check, but I think that AoT/rollup users can still use this new/reverted build if they update their rollup-config.js appropriately in the object passed to the invocation of the commonjs plugin in the plugins array. (It's been a long time since I used AoT, so YMMV.)

from ngx-sortablejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.