[Refactor] Replace Browserify with Parcel
See original GitHub issueI’m currently experimenting with the idea of refactoring canvas-sketch and its CLI tools to use Parcel instead of Browserify under the hood. I’m happy to hear any thoughts about this.
Enhancements that will be part of this refactor:
- A more powerful bundler that can handle ES6, CSS, importing PNG assets, and other features that aren’t supported right now.
- An elegant API for using
canvas-sketchprogrammatically, whether as a pure bundler or as a development server. - Much easier to build an Electron-based wrapper on top of
canvas-sketch - True hot module replacement (this will have a different UX/flow than the current
--hotflag, but will be more robust) - Faster builds and reloads
It will be a major breaking change.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:15
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Developers - [Refactor] Replace Browserify with Parcel -
[Refactor] Replace Browserify with Parcel. ... I'm currently experimenting with the idea of refactoring canvas-sketch and its CLI tools to use Parcel ...
Read more >What are some alternatives to Browserify? - StackShare
Bower. Bower is a package manager for the web. · Webpack. A bundler for javascript and friends. · Babel · rollup · RequireJS...
Read more >Parcel – A fast, zero configuration web application bundler
Webpack actually does the same (it's module bundler), browserify ... to completely refactor it every time a new build tool is adapted ;-) ......
Read more >Comparison of Build Tools - SurviveJS
Browserify is one solution to the module problem. It allows CommonJS modules to be bundled together. You can hook it up with Gulp,...
Read more >browserify-ftw - npm Package Health Analysis - Snyk
Upgrade your app from requireJS AMD to commonJS module format via an automated refactor step in order to browserify it. For more information...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

So Im a little confused… Is it possible with the current canvas-sketch-cli to use es6 import/export syntax to include modules? And if so, how do i do it? I would like to include threejs jsm packages instead of appending them all manually to the global THREE variable… if i try that it tells me
ParseError: 'import' and 'export' may appear only with 'sourceType: module'@Greyvy Yes this will be a breaking change. In my own repo of sketches I use canvas-sketch-cli locally, so that each commit is locked to a specific version of canvas sketch CLI:
This way I can go back to a commit, delete node_modules and
npm installagain and I will be on the same version of the CLI that was used along with the sketches in that commit.Yes it would be able to handle
importsyntax, although I will probably stick withrequire()in the docs for parity with Node.js (Parcel supports that too).@ogrodnek Yup TypeScript will work as Parcel supports that out of the box. FWIW you can already use TypeScript with
canvas-sketchas in this gist, but you may need to update your dependencies oncanvas-sketchandcanvas-sketch-clifor it to work:https://gist.github.com/mattdesl/1e9ab019534838e8c870ae06371be469