Comments (5)
You can use babel-plugin, like this:
{
"plugins": ["effector-logger/babel-plugin"]
}
Enable plugin just for development
from logger.
hi - thanks for this note. I don't currently have a babel config file, I will create one, but can you explain just a bit? If we have this in the file, will it automatically only load it for non production usage (i.e. yarn start) ?
if I build a production version yarn build --production true
are you saying that even though I have the code importing from effector-logger
I shouldn't see the output in the console?
Sorry for the questions, but it just isn't clear to me (I'm new to this stuff)
thank you for the help
from logger.
In your case it's better to use imports from effector and enable logger in development rather than disable it in production. In babel this looks like that:
.babelrc
{
"env": {
"development": {
"plugins": ["effector-logger/babel-plugin"]
}
}
}
And your code will looks like that:
import { createEvent, createStore } from "effector"
from logger.
I'm using craco
with this project, because I am using TailwindCSS and it seems to be a requirement. It seems that .babelrc
won't work as-is without further configuration. I modified my craco.config.js to look like this (without environment specification to see if I can get it working at all) and it's not working:
craco.config.js
module.exports = {
style: {
postcss: {
plugins: [require("tailwindcss"), require("autoprefixer")],
},
},
babel: {
plugins: ["effector-logger/babel-plugin"],
},
};
I get:
./src/index.tsx
Error: Cannot find module 'effector-logger/babel-plugin'
My package.json has:
"effector": "^21.8.5",
"effector-logger": "^0.10.0",
"effector-react": "^21.2.1",
from logger.
Hello!
As of the recent '0.14.0' release, 'effector-logger' no longer includes 'effector-inspector' and integration with redux-devtools, so all related issues are gone.
With new update you can just use it conditionally
if (process.env.ENV === "development") {
attachLogger(...)
}
See the release notes for details
https://github.com/effector/logger/releases/tag/v0.14.0
from logger.
Related Issues (20)
- `effector-logger` breaks operations' priorities HOT 3
- logger throws errors on circular references HOT 1
- Debug domain with settings is not working HOT 1
- Logger shows some number instead of name HOT 3
- Cyclic object value error HOT 2
- Version 0.13.6 does not bundle typings for TypeScript HOT 2
- Upgrade effector version
- Move effector-inspector to peer dependencies HOT 2
- How to disable all Farfetched related logs
- Could not find a declaration file for module 'effector-logger' HOT 1
- CommonJS version tries to require() an ES Module and breaks
- Error: sample: expect clock to be a unit (store, event or effect) or array of units HOT 1
- "Unexpected token u in JSON at position 0" when call event without payload HOT 1
- Error: Error serializing `.initialState.bxdte["-2xkzew"].effect` returned from `getStaticProps` in "/catalog/[...slug]". HOT 6
- Error: combine expects a store in a field clock HOT 5
- RFC: Allow to configure effector-logger via babel-plugin settings HOT 3
- Error: guard: expect clock to be a unit (store, event or effect) or array of units HOT 10
- SyntaxError: Unexpected token u in JSON at position 0 when using chaining operator in store.map HOT 1
- Add option for non-babel users in readme HOT 3
- Can't resolve 'process/browser' in ...\node_modules\forest' HOT 4
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 logger.