Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you handle build of widgets when creating new widget ? #52

Closed
tlenclos opened this issue Dec 21, 2015 · 12 comments
Closed

How do you handle build of widgets when creating new widget ? #52

tlenclos opened this issue Dec 21, 2015 · 12 comments

Comments

@tlenclos
Copy link

Hi and thanks for your work on Mozaik !

Quick question, how do you handle the build of new widgets using ES6 syntax ?
For example I forked your github widget and used npm link, then I got an error when starting the app as the ES6 syntax if not valid:

/Users/.../mozaik-ext-github/src/client.js:1
(function (exports, require, module, __filename, __dirname) { import request f
                                                              ^^^^^^
SyntaxError: Unexpected reserved word
@plouc
Copy link
Owner

plouc commented Dec 21, 2015

You'll have to tell browserify to transpile your module, https://github.com/plouc/mozaik-ext-github/blob/master/package.json#L49

@tlenclos
Copy link
Author

I'm using gulp watch on my mozaik project, npm link with my fork of your github widget. So I got the same package.json that you linked.

@tlenclos
Copy link
Author

Maybe you can document your workflow when creating a new widget or forking an existing one ?

@plouc
Copy link
Owner

plouc commented Dec 21, 2015

You're right, I could :) Unfortunately, I were not able to make the link npm command works because of peer dependencies, I put the git repo directly into the node_modules directory

@tlenclos
Copy link
Author

And what command are you doing to compile the files in node_modules/mozaik-ext-github for example ?

@plouc
Copy link
Owner

plouc commented Dec 21, 2015

Don't have have my laptop right now, but I think it's:

gulp watch:dev

BTW, the actual workflow is annoying, I'm planning to move to webpack soon

@plouc
Copy link
Owner

plouc commented Jan 11, 2016

@tlenclos, I'm closing this issue, feel free to create one if it doesn't work

@plouc plouc closed this as completed Jan 11, 2016
@torarnv
Copy link

torarnv commented Feb 15, 2016

Any update on webpack? I'm looking into using mozaik for our dashboard, as it looks really shiny, but the process of creating a new widget seems a bit complicated, lots of react boilerplate, rebuilding between each code/style change. Is there a recommended workflow that perhaps looks more like the simplicity of dashing, e.g. https://gist.github.com/YuriKazakov/c85f8cbde7235105dd16 ?

@plouc
Copy link
Owner

plouc commented Feb 16, 2016

@torarnv, unfortunately, I don't have the time for now to work on my side projects

@plouc
Copy link
Owner

plouc commented Feb 16, 2016

You should have a look at the time widgets

@torarnv
Copy link

torarnv commented Feb 17, 2016

@plouc Sorry to hear that, but thanks for being honest! 👍

@plouc
Copy link
Owner

plouc commented Feb 18, 2016

but the time widget is light enough (with some react boilerplate) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants