-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
GlobalStyles not working #481
Comments
I'll have to look deeper on how deno resolves the nested packages. |
I was just looking into deno package resolution.
Rules of thumb (for deno)
Fortunately, this isn't really an issue. Or more specifically, it's a question of whether or not the end-user is importing the development source-code (itself containing external imports that may not resolve) or the bundled production single-file module (with the minified code that includes a copy of all dependencies). Which is what's happening in the example by the original post: /* https://deno.land/x/[email protected]/global/src/index.js */ // Importing raw source file
import { css, styled } from 'goober'; // The node bare-specifier 'goober' can't be resolved by deno /* https://deno.land/x/[email protected]/global/package.json */
{
"devDependencies": {
"goober": "^2.0.29", // Here is how Node is resolving it.
}
} If the user is looking to use the (unminified) source code remotely then /* import from https://deno.land/x/[email protected]/global/global.d.ts */
import { Properties as CSSProperties } from 'csstype';
import { Theme, DefaultTheme } from 'goober';
/* import from https://esm.sh/[email protected]/global/global.d.ts */
import { Properties as CSSProperties } from 'https://esm.sh/v135/[email protected]/index.d.ts';
import { Theme, DefaultTheme } from 'https://esm.sh/v135/[email protected]/goober.d.ts'; Notice how the If the end-user is looking to use the unminified source code at all however, they should reasonably just clone the repository and have a local copy. I'm using a local copy of goober myself for server-side-rendering on Deno. Although, I did have to quickly update all the import statements to include file-extensions to get it to work. But if the end-user is looking to just use goober in production, they should be using a minified version: https://esm.sh/[email protected]/ https://unpkg.com/[email protected]?module npm:[email protected] // Deno also supports the npm prefix to import from, guess where? These are all self-contained minified versions, no trouble using them in deno at all. At some point, I'm assuming deno.land will figure out some standardized entry point so we don't have to keep digging through code to find which file to import, but at the moment it's hit-or-miss. At the very least, any developers releasing content on deno should list the full URL to their modules in the documentation. But it'll be a while before that becomes a convention, I expect. |
Does this package have any dependence?
I tried so mucho things, help me pls
The text was updated successfully, but these errors were encountered: