vitmalina / w2ui-starter-es6

Starting point for web apps based on w2ui and es6 modules.
MIT License
17 stars 7 forks source link

Server without the ability to do NPM/Gulp/React/Vue or any other helper library except flat .min.js files #3

Open pf-tech opened 2 years ago

pf-tech commented 2 years ago

Hi,

I see there is a way to use the W2UI library in a "legacy" mode, but all the examples are built in ES6 so translating into legacy is complicated.

My question is, is there a way to use the flat files as ES6 modules so that they don't have to be invoked as "legacy" when the host server doesn't have any other way to access the files other than as .min.js? I've encountered errors trying to use the more advanced features due to not knowing how to call them because of the "legacy" structure not matching the ES6 structure.

Thanks, PF-Tech

vitmalina commented 2 years ago

Not sure I am following the question. Yes, this repo has been updated to be es6 modules by default. However, you can link here regular w2ui.min.js and work with it in the same way as before. Please provide more details, as I am not following what your issues is.

pf-tech commented 1 year ago

Sure.

So, the server I am using is not allowed to call outside of itself. I downloaded https://raw.githubusercontent.com/vitmalina/w2ui/master/dist/w2ui-1.5.js and installed the file locally.

I have found that there is a difference in the way legacy utilizes and calls the built-in functions differently from the ES6 version. And I get errors on things such as the advanced search, despite having my columns declared in the search section. I haven't even tried more complex things like the forms yet, though I need to. I worry I'm doing something wrong in my syntax because the files are structured differently.

I also wondered if there was an "export" feature for the grid that I did not notice. The client would love an export-like feature, and though I'm sure I could build a plugin, I thought I'd ask if there is one already.

Anyway, I just wondered how to use the flat file above like ES6 since it throws errors with trying to do the ES6 import. The error says no export statement exists within the flat file. I tried adding export statements, and that throws errors as well.

pf-tech commented 1 year ago

~Another clarification, I cannot have direct access to the server. I cannot install via any server commands. So no NPM, or SSH, or anything. There's no React or Vue or anything either. It's a very "shared host" in that aspect even though it is not a shared host, just extremely restricted access.

vitmalina commented 1 year ago

Well, I am still not fully understand what is wrong. You might take a look at this repo, https://github.com/vitmalina/KickStart, which is the predecessor. It might give you some clues.

As for the files, you can link this file https://raw.githubusercontent.com/vitmalina/w2ui/master/dist/w2ui.js, which more like the old way. It does not use import and export but works from the global scope. It even registers jQuery plugins if jquery is loaded. You might link it instead of v1.5

I hope it helps.