Comments (4)
it is really not recommended for components to import internal files or self-refer to the package name. this may cause compilation issues down the line.
if you want Bit to stop complaining on some issues, you can add a similar config to your worksapce.jsonc
"teambit.component/issues": {
"ignoreIssues": [
"CircularDependencies",
"DuplicateComponentAndPackage"
]
},
all possible issues are here - https://github.com/teambit/bit/tree/master/components/component-issues
from bit.
In addition to what @itaymendel wrote.
It's not recommended to use aliases, as these imports are context aware. Aka needs a tsconfig to set these aliases which make the components not portable.
Any component is available to be consumed via its package name (even before export/publishing).
This is also more standard way for import as it's not tool specific.
So please use package names.
from bit.
Hello ! Sorry and thanks for the informations but in fact we were looking for a backend solution of monorepo workspace management, and found BIT on the pnpm docs
It's not very clear for us what our apps and packages can be related to BIT, but if we understood correctly anything can be a component.
A good way in dev to avoid relative import and help moving/maintain is to use TS path aliases.
So does that means Bit is not for backend typescript project ?
In fact we are using packages name
. but it's not very suitable when we are dealing in terme of dev-experience, we need to re-run bit link/bit compile
on every new file, and removed/renamed files are still visible, so TS alias in dev are more suitable, we just have TS path alias overriding the scope/name.
In fact to resume we just need Bit as a workspace dependencies management (and it shine wth bit status, bit show ...), not really for component compile .. (we will continue to compile our backend app via TSC etc ..)
from bit.
Bit doesn't support ts paths between components, as they are related to the specific file system structure of the workspace, and locks you to a specific FS structure.
In bit, each component is automatically linked via node-modules, and you are expected to use these module links.
the question is on your backend developer is mostly "what is a component", as in bit, if you need to share code between your backends the goal is to move it to it's own component/library, and not import from internal files.
from bit.
Related Issues (20)
- Importing bit vue component to a NUXT project gives error HOT 2
- Vuetify not working with bit component when I import and use it in NUXT project HOT 2
- docs issue on the introduction page in the section "Get started"
- The CJS build of Vite's Node API is deprecated for new workspace with custom react environment HOT 2
- Bit received an error loading teambit.vue/[email protected], due to the error: "Cannot find module '@teambit/legacy/dist/consumer/component/dependencies/files-dependency-builder/detectives/detective-es6'" HOT 3
- In self hoisted or remote scope, when I export the components, I get the message "Processing preview" in the Overview and Preview screen HOT 3
- ERROR [nuxt] [request error] [unhandled] [500] Unexpected token '<' HOT 8
- Best way to uninstall bvm and bit from my system HOT 1
- Using react-native-svg with bit fails on teambit.preview/preview:GeneratePreview HOT 2
- bit build failed: dev+vue.dev-services.linter.v_zh54tchgb56oqy7unumk5ggzty\node_modules\@bitdev\vue.dev-services.linter.vue-eslint-config\dist\index.js': Cannot find module '@typescript-esdev+vue.dev-services.linter.v_zlint/eslint-plugin' HOT 19
- Getting started; is bit 1 GiB large? HOT 3
- Components preview not loading/working while bit start HOT 2
- Bit build error: bitdev.vue/[email protected], task "teambit.preview/preview:GeneratePreview" threw an error You must supply options.input to rollup HOT 19
- Sveltekit app starter template/generator HOT 8
- Docs: Misspelled URL | Introduction
- Next.js Quickstart not working HOT 1
- Vue Vite Tailwind Preview HOT 3
- Can I use Harmony platform with Vue and Node? HOT 1
- Can't resolve 'react-dom/client' after setup new environment? HOT 5
- better docs would be awesome and please stop recursive mentions of what you try to explain HOT 1
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 bit.