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
Avoid CommonJS in Cycle DOM codebase #509
Comments
Can you provide some more context here? Maybe an instance of CommonJS usage that you want to get rid of... |
basicly replace any basicly just cloning the repo, grepping for require (i suggest |
Thanks, @jvanbruegge! I did a quick grep and it seems like there are more than 14k occurrences. I'll see if I can come up with a sed script or something and report back. |
btw, I don't know if github allows it, but... Can you assign this issue to me? |
you have to limit the search to |
Indeed: most occurrences of Maybe this issue is already solved? |
Can't find any occurrences of |
Did a git bisect and the last require statement went down with commit f459ada. This issue is probably stale. |
did a quick ag search, this is the result:
(I removed the ones that were bad matches (mostly markdown) |
Oh, right... I thought the issue was limited to cycle dom... Will take a look at that! |
So far I've tried changing
to
As I understand, this is the equivalent CommonJS/TS syntax for importing the default export from
I'm not sure what I'm supposed to do here. Judging from the Typescript docs it seems like one can add a
I'm still learning both ES6 and TS. Maybe I'll be able to come back to this once I level up some more. If anyone else wants to grab this, please do. |
To import a commonjs default export in typescript the format is actually neihter that you tired :) See the modules docs for TS
The error indicate the file cannot be found and as you did't prefix your file path with If the file is is plane js then yes, you will need to provide a .d.ts to give what they call "ambient declations" for the types. There are various approaches for doing that. but if it is a npm module try making |
In this specific case, 😞 |
Taking a step back, how can I test the use of tree shaking tools with Cycle.js? I've found the webpack guide, but I can't easily see how to use it. |
There is the bundleAnalyse plugin and the stats plugin. The stats can be used to see the module dependencies. See my polyfill WIP PR |
But tree shaking is broken ATM, also see the PR |
How can we demonstrate that tree shaking is broken? Can you give me a one-liner for that? (Remember I'm a JS/TS newbie) |
Import the time driver from |
So I guess this is done now? |
@staltz I don't think this is fixed. I'm having trouble with a very basic rollup project, even when using This stack overflow question provides a succinct description of the problem: https://stackoverflow.com/questions/47329214/rollup-js-typescript-and-require |
@micahscopes: I have made a PR that removes all usages of After that is merged hopefully Rollup will work. |
@micahscopes |
To better support tree-shaking tools that assume ES2015 modules.
The text was updated successfully, but these errors were encountered: