Results 1 to 7 of 7

Thread: ExtJS as library or components

  1. #1
    Sencha Premium User
    Join Date
    Feb 2010
    Posts
    49
    Vote Rating
    22
      0  

    Default ExtJS as library or components

    Hi,

    We have an application with some REST API to do stuff... in front of that we offer an UI with ExtJS which is normally bundled in the same service.

    So far so good, but now we have two new use cases which we would like to add.

    The first, is that in some cases customers wants to make their own custom UI, for that there is no problem, they just use the REST API directly and that's that. But we have found out the some customers don't know what to do or how to do it. We have an internal package in ExtJS that integrates the calls with ease and we would like to provide them to the customer in a form of js library. So they can include in their app our js and just call, for example, MyAPP.util.getUsers(), we do all the internal work and then just return the users. I know we could make a new library just in js and give that to our customers but the work is already done with ExtJS and we would like to reuse the code.
    Is there any way we can build a package that includes the required clases and just build 1 js?

    The other use case is for UI "user components", for example a customer want to see a UI we designed with ExtJS for some function and they just want to show that component, same as in the previous case but with some UI components. The customer could call, for example, MyAPP.util.showServerStatus({renderTo: ''xxx}) and we would load that UI with the functionality.
    The question is the same as before.


    Is this possible with ExtJS?

    Thanks in advanced!

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,307
    Answers
    3992
    Vote Rating
    1477
      0  

    Default

    What you're wanting from Ext JS is a little heavy handed for the small usage you're talking about by having a component shown somewhere. The issue is Ext JS itself is a large framework so loading Ext JS by itself will yield over 1 MB of download by itself. This isn't worth it if you don't have a complex application, rendering a component here and there is simply not what Ext JS is built for. It's like using a train to haul a couple boxes of clothes, a train could do it but it's not the efficient way to do it. I'm not sure exactly what things are for your need but just sounds like Ext JS isn't the right tool here.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha Premium User dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,160
    Answers
    25
    Vote Rating
    45
      0  

    Default

    size isn't the main consideration here... especially on a dashboard that can cache javascript files... the second pull in all cases is 0kb as it's cached by the browser, and that's even if the page is reloaded at all. Some dashboards aren't ever reloaded and just stay loaded for months.

    1) by the time you load other libs in any framework even for widgets you'll be in the same ballpark of file size
    2) if they are loading the widgets to existing pages, what frameworks are already loaded?
    3) the other issue to note is version conflicts, running a separate library might make more sense.

    #3 is probably the most important as if the client moves versions it may break your widgets, meaning you'd have multiple versions of the same widget

    One of the apps we have has widgets embeded on client sites, and sometimes it's just easier to have a completely different framework, or work within an iframe to achieve uniform results without having to maintain multiple versions of your widgets.
    Cloud Application Architect

    Sencha Specialist / Sencha MVP
    ExtJs Developer + Contributor since 0.2.2 - Champion of the per developer license.

  4. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,307
    Answers
    3992
    Vote Rating
    1477
      0  

    Default

    Quote Originally Posted by dawesi View Post
    size isn't the main consideration here... especially on a dashboard that can cache javascript files.
    You are assuming this so you cannot say whether it's a main consideration or not. Also, yes the download is cached but it still has to pull from disk and evaluate it and since Ext JS is such a large file to be evaluated, that will take some time. Sure, less than if you had to download it, but still time never-the-less. Go ahead and profile the time till interactive.

    Your #1, not so. especially considering you know nothing of what they actually need. What if all they need is a list of things? A simple HTML list vs Ext JS' List? Making these types of statements without knowing much of the story is dangerous. It could be that he needs some of Ext JS' complex UI, we simply do not know.

    Your #3 isn't much of a concern outside of Ext JS as you can easily sandbox code that doesn't use the same global namespace like Ext JS does.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  5. #5
    Sencha Premium User
    Join Date
    Feb 2010
    Posts
    49
    Vote Rating
    22
      0  

    Default

    Thanks for all you coments.

    The idea is to reuse componen. We have dedicated a considerable amount of time in some components and some customers wants to reuse that component instead of developing.

    Bottom line. Customer can make their own UI, we can make a new UI with another framework, there can also be other options. But the questions is, if we can somehow build in a way that we can instantiate one of our components from outside ExtJS.

    I guess I can give the ExtJS js and the builded package....... but is not posible for licensing...
    I can maybe build with no launch and load a component...

    I know size is big, can be slow... but is just an additional option to offer to the customer without needed to develop in another framework.

    Any ideas are appreciated.

    Thanks

  6. #6
    Sencha Premium User dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,160
    Answers
    25
    Vote Rating
    45
      0  

    Default

    referring back to the original post:

    just using extjs as the data layer is possible, but would these kind of clients not just use the API with their chosen framework data layer? (if not sencha - which could be exjjs, ext-react and ext-angular (available soon)) What is the use case here?

    --

    one way you could do this is have a widget configurator that that adds components to an app (even if it's simply a requires string in the app.js), then in backend fires off a custom sencha cmd build to minimise it for that client. then you could UUID the script for that client, then present them with the script to embed.

    1) personally i'd look into sandboxing any ui with iframes, but that has it's own issues.
    2) you also need to look into how other frameworks are rendering code as the timing of renderTo being called may not be ideal.

    also can we get some screenshots of the types of widgets you are embedding (can be blury text to protect data if req)
    Cloud Application Architect

    Sencha Specialist / Sencha MVP
    ExtJs Developer + Contributor since 0.2.2 - Champion of the per developer license.

  7. #7
    Sencha Premium User
    Join Date
    Feb 2010
    Posts
    49
    Vote Rating
    22
      0  

    Default

    This is an example:

    finger.JPG

    And here is a demo for developer in simple html
    finger_simple.JPG

    Most developer see the first screen and want to use than one because is complete, has all the information, actions, errors, all details... But they get the API and an example with html, the API is really easy but it's hard for most of them to make a nice UI, some of them end up with a simple form.

    So the reason for this posts is: hey! we have a nice UI with all posible actions why can't they embed that in their app.

    Will keep trying different stuff and maybe I get a solution....

Similar Threads

  1. Replies: 30
    Last Post: 22 Feb 2018, 7:05 PM
  2. Replies: 1
    Last Post: 16 Sep 2013, 12:13 AM
  3. Replies: 0
    Last Post: 25 Nov 2009, 6:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •