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

missing require jquery-ui/menu from jquery-ui/autocomplete.css #107

Open
znz opened this issue Nov 30, 2016 · 7 comments
Open

missing require jquery-ui/menu from jquery-ui/autocomplete.css #107

znz opened this issue Nov 30, 2016 · 7 comments

Comments

@znz
Copy link

znz commented Nov 30, 2016

I updated jquery-ui-rails from 5.0.5 to 6.0.0.
Then list-style-type: disc appeared in autocomplete.
So I think require jquery-ui/menu required in jquery-ui/autocomplete.css.
It removed at d504a40 .

@joliss
Copy link
Member

joliss commented Dec 1, 2016

It seems that menu.css, along with a bunch of other CSS files, dropped their dependency on core.css: d504a40#diff-e13c4204df2def1438189519e4727d38

@Borzik, do you have any idea what the intended behavior from the jQuery UI upstream is? We can rope in @ scottgonzalez if we need to (he removed the ui.menu.jquery.json-type manifest files in jquery/jquery-ui@b5f1ffd), but maybe there's an obvious thing I'm missing.

@tirdadc
Copy link

tirdadc commented Dec 2, 2016

I included menu, core and theme for the CSS and upgrading to 6.0.0 still break the default styling for the autocomplete. Not sure what else is required.

@Borzik
Copy link
Contributor

Borzik commented Dec 2, 2016

@joliss It looks like they've just stopped providing dependencies not only for JS, but for CSS as well. My update fixed that problem for JS, so we now require dependencies which we can find in define block of JS file. For CSS, we cannot do the same because there is no hint on CSS dependencies anymore. Autocomplete docs say it depends on Menu widget so yes, it won't work without that. What is possible to do to get this working as before is to rewrite Rakefile completely, and process assets not in file scope but in widget scope (e.g., if we see menu as JS widget dependency, we should check if there is a corresponding CSS for it and load that as well).

@tirdadc you need to require either (all 3 options are tested by me and should work well):

  1. jquery-ui/base (index file for all widgets) — seems to be the recommended way for now if you don't want to handle all dependencies manually,
  2. jquery-ui/all — same as 1, but includes theming,
  3. jquery-ui/menu and jquery-ui/autocomplete if you want to load only one widget.

ckruse referenced this issue in ckruse/cforum Dec 22, 2016
@joliss
Copy link
Member

joliss commented Feb 14, 2017

@scottgonzalez Hey Scott, for the jquery-ui-rails gem it would be very useful to be able to determine programmatically which CSS files depend on other CSS files, but this seems to have been removed in jquery/jquery-ui@b5f1ffd. Is there any chance that this will be re-added in the future?

@scottgonzalez
Copy link

Can you point to the specific code/files you were using before to determine this? I don't recall us ever providing full dependency graphs for CSS files, but perhaps we did and I just don't remember.

We do have comments that list metadata, including direct CSS dependencies, which we use these for our download builder. Because the JS components list all of their dependencies, we're able to properly build our themes because we just pull in the CSS for each of the dependencies.

Would that solution work for you?

@joliss
Copy link
Member

joliss commented Feb 14, 2017

Can you point to the specific code/files you were using before to determine this? I don't recall us ever providing full dependency graphs for CSS files, but perhaps we did and I just don't remember.

@scottgonzalez Yes, it seems I misspoke earlier. Rereading the code, I believe we have always just been going off the dependencies of the corresponding JS files.

@Borzik So looking at the diff of our autocomplete.css between v5.0.4 and v6.0.1, it seems that the dependencies on core.css and menu.css got lost.
Looking at the upstream autocomplete.js source, my thoughts are:

  • As for core.css: The autocomplete.js file dropped its dependency on core.js, but the CSS still depends on core.css, as recorded in css.structure like Scott mentioned. Perhaps we should be parsing the css.structure field?
  • As for menu.js: It seems that we are picking up on the JavaScript dependency, but the File.exists? call checks for the wrong CSS path (try p "#{css_dir}/#{dependent_stylesheet}"). So this seems to just be a bug in our Rakefile.

@scottgonzalez
Copy link

As for core.css: The autocomplete.js file dropped its dependency on core.js, but the CSS still depends on core.css, as recorded in css.structure like Scott mentioned. Perhaps we should be parsing the css.structure field?

We're phasing out core.js in favor of smaller modules, which is why it was removed from all of our widgets. The file still exists in case anyone was listing it as a dependency in their own code, but will eventually go away. core.css will stay around, but should be listed in the css.structure comments for the relevant widgets.

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

5 participants