Anyone using angular or react or vue within Matrix?

(Sang) #1

Matrix Version:


I am wondering if those javascript framework or library can be used within Matrix.

I tried react but it was hard to import module without server configuration. So I gave up react.

There is no specific reason for using those, but I hope I can use those instead of using plain javascrpit or jquery.


(Marcus Fong) #2

I’m not sure what you mean by server configuration - we’ve had projects that used React and Angular which worked just fine without needing anything special at the server level.

Are you trying to follow the guides on Those are aimed at people writing their entire webapp in React, not people using a CMS.

To use React with a CMS you’d do something more like this:

(Sang) #3

Are we able to use modules like axios?

(Marcus Fong) #4

I don’t see why not, if you use the “Using CDN” method from

As with the React example I linked above, though, that really doesn’t have anything to do with Matrix - you just call the JS library the same way you would from any Web page.


Is the Angular project you mentioned above using Angular 2+ or AngularJS? If it is Angular 2 or Angular 4, how did you make the Typescript compiled in Matrix?

(Marcus Fong) #6

It was AngularJS. ⁣

(Sang) #7

Then how could I use other module which does not provide CDN?

For example,


(Marcus Fong) #8

If you look at Axios’s CDN instructions, the CDN they’re using ( also mirrors all of npm.

So in the case of react-js-pagination, unpkg mirrors the latest version at:

(Note that this isn’t a specific endorsement of unpkg, just noting that there are options for this. There’s also which does the same thing, I believe.)

(Sang) #9

I’ve added below code in header

<script src=""></script>

It shows this error on chrome.
Pagination.js:1 Uncaught ReferenceError: exports is not defined

Did I miss anything on this?

(Marcus Fong) #10

Hmm, seems like that module depends on CommonJS then. I gather is one possible option in that case.

We’re really getting outside the scope of a Matrix discussion here, though.

(Matt ) #11

We’ve made widgets in Vue. An asset listing will generate the JS data required for the widget. Once you’ve developed the widget in your CLI, run build and upload the build js file to the matrix.

(Chris Horikx) #12

We’ve done this too. We also use to render vue components in render function format. We have a components file that exposes available components and call it with:

renderVueComponentToString(new Vue({
  components: {
    topNav: ExposedVueComponents.vNavComponent
  render: function (createElement) {
    return createElement('top-nav', {
        props: {
          // PROPS GO HERE
}), function(err, res) {
  if (err) {
  } else {

We are considering the possibility of encasing the entire body area in a wrapper so that we can call Vue components from the content such as those from BootstrapVue or Vuetify