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

Minified version removes exposed methods. #16864

Closed
sronnlund opened this issue Mar 9, 2016 · 7 comments
Closed

Minified version removes exposed methods. #16864

sronnlund opened this issue Mar 9, 2016 · 7 comments
Milestone

Comments

@sronnlund
Copy link

The minified version removes Awesomplete.ITEM and Awesomplete.REPLACE.

awesomplete.js

configure(this, {
    minChars: 2,
    maxItems: 10,
    autoFirst: false,
    filter: _.FILTER_CONTAINS,
    sort: _.SORT_BYLENGTH,
    item: _.ITEM,
    replace: _.REPLACE
}, o);

awesomplete.min.js (beautified)

m.call(this, {
    minChars: 2,
    maxItems: 10,
    autoFirst: !1,
    filter: f.FILTER_CONTAINS,
    sort: f.SORT_BYLENGTH,
    item: function(a, b) {
        var c = "" === b ? a : a.replace(RegExp(d.regExpEscape(b.trim()), "gi"), "<mark>$&</mark>");
        return d.create("li", {
            innerHTML: c,
            "aria-selected": "false"
        })
    },
    replace: function(a) {
        this.input.value = a
    }
}, b);

...with Awesomplete.ITEM and Awesomplete.REPLACE no longer available. This is how we're using Awesomplete.ITEM, which won't work in the minified version:

var awesomplete = new Awesomplete(locationElement, {
    /* ... */
    item: function(station, input) {
        return Awesomplete.ITEM(station.name, input);
    }
});
@sronnlund sronnlund changed the title Minified version removes exposes methods. Minified version removes exposed methods. Mar 9, 2016
@vlazar
Copy link
Collaborator

vlazar commented Mar 9, 2016

The minified version is just 2 months old. You can build minified version of latest code with:

git clone https://github.com/LeaVerou/awesomplete.git
cd awesomplete
npm install
gulp

My personal view on this is that adding a minified version with each commit makes it harder to view diffs.

@LeaVerou Since minified version wasn't always updated with each commit before anyways, maybe doing it with each release instead would work better for us?

Maybe we waited long enough for feedback on new feature #16852. If so, I can get back working on 1.1 release and add minified version among other things when it's ready.

@vlazar vlazar added this to the v1.1 milestone Mar 9, 2016
@LeaVerou
Copy link
Owner

LeaVerou commented Mar 9, 2016

I think we should run gulp watch every time we work on this, so that the minified version is automatically generated. Having an out of sync minified version is definitely not something we should make a rule about.

@sronnlund
Copy link
Author

Ah, so there was a version discrepancy... Didn't know! Thanks for clarifying. I kind of expected them to be in sync, so +1 on what @LeaVerou said.

@vlazar
Copy link
Collaborator

vlazar commented Mar 10, 2016

We can't be sure people will actually run gulp watch. Like now we can't make them run gulp before sending a PR. Only a fully automated solution will always work. Probably Travis CI and git hooks can handle this. I'll explore this option.

And what about:

Maybe we waited long enough for feedback on new feature #16852. If so, I can get back working on 1.1 release and add minified version among other things when it's ready.

Is it time to merge this PR and start work on other tickets for 1.1?

@LeaVerou
Copy link
Owner

Obviously, an automated solution is better, but we should try to keep it in sync as much as possible, one way or another.

Yes, it is time to merge that change.

@vlazar
Copy link
Collaborator

vlazar commented Mar 12, 2016

Yes, it is time to merge that change.

Landed in cleaned up version #16866.

@vlazar
Copy link
Collaborator

vlazar commented Mar 16, 2016

Version 1.1 just published. Minified version is in sync https://github.com/LeaVerou/awesomplete/releases/tag/v1.1.0

@vlazar vlazar closed this as completed Mar 16, 2016
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

3 participants