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

Incorrect syntax at object properties #108

Closed
bjarnef opened this issue Nov 10, 2021 · 5 comments
Closed

Incorrect syntax at object properties #108

bjarnef opened this issue Nov 10, 2021 · 5 comments
Labels
question Further information is requested

Comments

@bjarnef
Copy link

bjarnef commented Nov 10, 2021

It seems there's a syntax error at the properties here, and a tool like NUglify warns about this: https://github.com/trullock/NUglify/blob/master/src/NUglify/JavaScript/JSError.cs#L96

It seems in should be the following instead using : instead of = operator:

delay: 500,
clearButton: true,
howManyCharacters: 1,
selectFirst: false,
insertToInput: false,
showAllValues: false,
cache: false,
disableCloseOnSelect: false,

https://github.com/tomik23/autocomplete/blob/master/docs/js/autocomplete.js#L34-L54

like you have here: https://github.com/tomik23/autocomplete/blob/master/docs/js/autocomplete.js#L7-L10

@bjarnef
Copy link
Author

bjarnef commented Nov 10, 2021

It seems it is correct, so it may be issues with NUglify and ES6 syntax.
Maybe we could use the umd bundle instead or esm:
https://dev.to/iggredible/what-the-heck-are-cjs-amd-umd-and-esm-ikm

Many plugins oftens ships both format, e.g. Bootstrap: https://github.com/twbs/bootstrap/tree/main/js

@tomickigrzegorz
Copy link
Owner

If you go to the docs folder you will find the umd version of this library.
The uncompiled version autocomplete.js is the iife version and it only works in browsers, it is possible that in the next revision I will replace it with umd.
As for the esm version, I will consider it, but in this library it is unnecessary because it is one module. ESM deals with more complex framework libraries, the individual modules of which can function separately just like bootstrap.

Currently I am doing library refactoring and I want to add tests so I will think about esm by the way ;)

So fast, if you have a bug with this uncompiled library autocomplete.js then change the format to umd in rollup.config and compile in your own - rollup.config.js

I will close the problem for now.

@tomickigrzegorz tomickigrzegorz added the question Further information is requested label Nov 11, 2021
@bjarnef
Copy link
Author

bjarnef commented Nov 11, 2021

@Tomik23 we could try with the umd version instead. Is it possible to add a unminified umd version in docs folder as well?

@tomickigrzegorz
Copy link
Owner

tomickigrzegorz commented Nov 11, 2021

So I will change iife to umd, it will be more universal.

There should be a new build tomorrow. It will contain a minimized version of esm as well as an unminimized version of umd.

@tomickigrzegorz
Copy link
Owner

As of version 1.6.8, all the necessary files are in the dist directory.
There you will find iife, umd and esm files. Files with no additional extension are iife files.

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

No branches or pull requests

2 participants