Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Support for JS modules


I've bought Keen template for developing my app and I could check that JS code doesn't work using modules with webpack.

For example, if I try to import a KTCard and try to initialize it as it is on the docs, it raises a message saying that KTUtil must be present.

So, I would like to know if there are any plans of supporting JS modules.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (4)


Hi,

To use the core components such as KTCard you will need to include KTUtil before as it's the main lib that all our JS components use.

We will rewrite our core JS components in a more modular way in the near future.

Regards.



I've tried to do it but still not working. It seems to me this error is raising because KTUtil is not imported on KTCard. Import both together didn't make it work.



Hi,

Please note that modular JS components at the moment are not supported so you should use them as common js.

Regards.



If you need any further help please let us know your Keen version and the code you used to include the core components and import. Are you using Keen's default webpack build method or creating your own? The default webpack build should work fine if you just follow the documentation. If you are rebuilding Keen with modular core components then this will need major changes in the code since at the moment the modular js is not supported.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(