Skip to Content
avatar image
Former Member

Adding 3rd party libraries to SAP Design Studio

Hello,

I want to add a 3rd party library in SAP Design studio using the component "Rapid Prototyping" but I can't.

I tried to do it by the classic way:

But it throws an error. Then I've noticed that SAP Design studio uses "require.js", so I've wanted to add the library using "require.js":

But it throws this error:

Any ideas of how to add a 3rd party library without ending with a headache?

Regards,

Gerard Riera Puig.

capture.png (6.9 kB)
untitled.png (60.1 kB)
untitled.png (4.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jan 23, 2017 at 04:33 AM

    Hi Gerrard,

    What about contribution.xml ? You can include it there.

    And the error indicates that you have added .min version in require path. You don't have to do that, DS will automatically add .min in normal mode. you can try running it on debugger mode to avoid this.

    Let me know why you have not added it on contribution.xml. I am pretty sure that bootstrap can be included via contribution.xml.

    Thanks,

    Nithyanandam

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Oh and by the way,

      "And the error indicates that you have added .min version in require path. You don't have to do that, DS will automatically add .min in normal mode. you can try running it on debugger mode to avoid this."

      I've tried this and it throws the same error.

  • Jan 23, 2017 at 09:42 AM

    Hi Gerard,

    Can you clarify the end result of what you are trying to achieve? As the name suggests, the Rapid Prototyping component is intended just for that, rather than production scenarios. Ultimately you'll need to build your own SDK component (which includes a contribution.xml file), as described in the SDK Developer Guide.

    Regards,

    Mustafa.

    Add comment
    10|10000 characters needed characters exceeded

    • Gerard,

      You'd be better off in the long run in biting the bullet and learning the SDK. The rapid prototyping component was truly intended for rapid "prototyping" with the assumption you do some rapid exploratory JS tinkering and either decide it's a bad idea, or go the route of a real SDK component.

      The verson=123457678... I believe is a cache-busting technique employed by RequireJS, or how Design Studio has it configured. This should be harmless if you are loading from a CDN.

      I cannot warn you enough how brittle your solution may become if you do this with the Rapid Prototyping component. You will need to make sure that you:

      1) avoid placing the component inside of any sort of Container component with width/heights that change, or visibility changes.

      2) avoid placing it inside of a tabstrip or pagebook

      3) avoid bookmarking scenarios

      Why? Design Studio likes to destroy/re-render the UI5 container components which wreaks havoc with the HTML DOM, which may (or may not) cause bootstrap to lose any sort of DOM state/sync.

      You've been warned, but I wish you luck! I highly recommend going back to considering the SDK.