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

Restore sortable/Sortable.js #1929

Closed
JonathonChen opened this issue Sep 22, 2020 · 13 comments
Closed

Restore sortable/Sortable.js #1929

JonathonChen opened this issue Sep 22, 2020 · 13 comments

Comments

@JonathonChen
Copy link

version 1.12.0
image
version 1.10.2
image

@HopeMa
Copy link

HopeMa commented Sep 22, 2020

why?
There is a problem with the project,now
Module not found: Error: Cannot resolve module 'sortablejs/Sortable'

@yougene
Copy link

yougene commented Sep 22, 2020

hey!
just updated some modules and stumbled about this too.

I fixed it by adding the import as a module relative to your path:

  <script type="module">
    import Sortable from "/node_modules/sortablejs/modular/sortable.core.esm.js";

    window.Sortable = Sortable;
  </script>

Then you can use Sortable.create(whatever.... again.

Hope this helps!

@waynevanson
Copy link
Contributor

The change was intended.

@HopeMa Are you importing sortablejs/Sortable? Import sortablejs instead.

@yougene did import Sortable from 'sortablejs'not work for you?

@bytestream
Copy link

@waynevanson presumably dist/sortable.umd.js is the same as Sortable.min.js in 1.10.2?

What's the reason for not including an unminified file like before?

@yougene
Copy link

yougene commented Sep 22, 2020

The change was intended.

@HopeMa Are you importing sortablejs/Sortable? Import sortablejs instead.

@yougene did import Sortable from 'sortablejs'not work for you?

I tried that, but e.g. Firefox gives me:
Uncaught SyntaxError: import declarations may only appear at top level of a module

I'm currtently just doing some flat layouting with Bulma, so this was a quick workaround.

@UweKeim
Copy link

UweKeim commented Sep 22, 2020

Stumbled over this, too.

Using the node module only to get "sortable.js" into my ASP.NET Core project via gulpfile.js.

@UweKeim
Copy link

UweKeim commented Sep 22, 2020

The change was intended.

Can you please tell me, @waynevanson, what the intention was?

Not being a Nodejs developer, I still love to use npm to pull dependencies into my C# ASP.NET Core project. Your intended change makes life more difficult now.

@waynevanson
Copy link
Contributor

@bytestream theres no real reason. Do you have a reason for needing it? Files are minified for production, so I don't think it makes much of a difference leaving it out.

The reasoning behind some of these accidental changes are that were trying to get typescript compiling with tools that we can manage in the future. Before we had no typescript in the code base.

@UweKeim i didn't realise users would be importing it from sortablejs/Sortable.
I'll try add it back.

@bytestream
Copy link

I was using in gulpjs to concatenate and minify multiple library files.

@pomartel
Copy link

Hi @waynevanson ! I'm in the same boat! I use yarn for dependencies management but I'm not using a module bundler to pack my javascript, just Rails with the good old asset pipeline. So for all of us working on "legacy" projects, having a precompiled version of sortable.js is really useful. Would be great if you could add it back or else I'll just stick with version 1.10.2.

@waynevanson waynevanson changed the title version 1.12.0 remove Sortable.js file Restore sortable/Sortable.js Sep 25, 2020
@waynevanson
Copy link
Contributor

waynevanson commented Sep 25, 2020

So for all of us working on "legacy" projects, having a precompiled version of sortable.js

@pomartel Which file are you after? The non minified version that is sortablejs/Sortable.js?

@UweKeim
Copy link

UweKeim commented Sep 25, 2020

So for all of us working on "legacy" projects, having a precompiled version of sortable.js

@pomartel Which file are you after? The non minified version that is sortablejs/Sortable.js?

Usually both: using the non-minified in debug builds and the minified in release builds.

@pomartel
Copy link

@waynevanson The Rails asset pipeline has its own minifier so for my use case the non-minified sortablejs/Sortable.js would be enough. But it could be either one, as long as it doesn't require a module bundler such as Webpack to be usable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants