Comments (5)
Can confirm that everything is working. @morlay thank you!
from babel-plugin-pure-calls-annotation.
@cawabunga I upgrade to babel 7.15, but haven't seen this issue.
test case here: https://github.com/morlay/babel-plugin-pure-calls-annotation/blob/master/src/__tests__/index.spec.ts#L75-L77
Notice: the plugin will not process body in IIFE, which will be a hack to let people write logic with side effects.
from babel-plugin-pure-calls-annotation.
@morlay thanks for answer. I went through code, seems everything is fine. I run again, and it gave right results. However in my project it still doesn't work. I'll figure out what's going on and let you know if there is something important.
from babel-plugin-pure-calls-annotation.
I've written such test case:
{
title: "Annotated #__PURE__ for defined add(0, 1) called in IIFE",
src: `const add = (x, y) => x + y; export const one = (() => add(0, 1))();`,
dest: `const add = (x, y) => x + y; export const one = /*#__PURE__*/(() => add(0, 1))();`,
},
It is pretty similar to the last case, except expression is wrapped with IIFE. I was expecting that it would pass, but it wouldn't. Do you have any suggestions?
from babel-plugin-pure-calls-annotation.
@cawabunga 0.4.2 should fix this.
here a special case to ignore annotating #__PURE__
, old codes will wrong check for your case
const a = setInterval(() => {
console.log(a)
}, 1000)
Where #__PURE__
here, tools like uglify
will remove all statement.
from babel-plugin-pure-calls-annotation.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babel-plugin-pure-calls-annotation.