-
Notifications
You must be signed in to change notification settings - Fork 0
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
Which framework to use? #1
Comments
Unfortunately, I have already run into quite an annoying problem with the first thing I tried. :/ I've wanted to import our styles from @datenanfragen/components. Fresh itself doesn't have SASS support, but I've managed to implement that myself fairly easily using the following in import { compileAsync as compileSass } from 'npm:sass@1';
const styles = await compileSass(new URL('styles/main.scss', import.meta.url).pathname);
await Deno.writeTextFile('static/styles.gen.css', styles.css); That works fine so far. However, now I want to import the stylesheet from our components package. Usually, we would do that like this: @import 'npm:@datenanfragen/components/dist/index.css'; That, perhaps unsurprisingly, doesn't work. The generated CSS is identical to the SCSS, the import statement is just copied over. That is understandable. With Node, that file is in Instead, the imported NPM modules end up—globally—in First problem: There is no install step. Modules aren't installed if you just add them to the import map. They are only installed when they are first used. But of course, that is built with JS in mind—as far as I can tell, you would have to I also tried importing the CSS file from JS (i.e. That failed because
I solved that problem by importing from But that still didn't help, because Deno cannot currently import non-JS files:
Next idea: The By name, Unfortunately, I didn't find any remotely clean method of getting the location of I also checked whether there are any examples for using Bootstrap from Fresh/Deno since that is also uses Sass. But everything I found either imported the transpiled CSS from a CDN (https://medium.com/frontendweb/how-to-use-bootstrap-with-a-fresh-framework-fc73b14ef7f9, https://github.com/Octo8080X/fresh-bootstrap/blob/main/src/plugins/plugin.ts) or vendored it (https://github.com/officialrajdeepsingh/fresh-bootstrap/blob/main/static/bootstrap.min.css). Footnotes
|
I'm not sure how to continue from here, to be honest. For one, I'm kind of out of ideas as for how to solve this issue. But that's not my main problem. Much more importantly, I am quite concerned that I ran into this annoying of a problem this quickly. We did of course expect some struggles using Deno in a project that has heavy prior Node.js baggage. But I've now wasted quite a lot of time unsuccessfully solving this problem and that was literally the very first non-trivial thing I tried to do at all. :( I do still very much like many of the ideas and decisions behind Deno and Fresh, especially after now having had a proper read of their documentation. But I am very worried that this is going to be a huge time sink if we continue using Fresh. And I'm afraid, we really can't afford that right now. |
If we did want to consider something else, I noticed that Astro also has islands: https://docs.astro.build/en/concepts/islands/ I haven't used that before and haven't evaluated it further, but I do think that is is quite mature and, well, Node-based… |
Yeah, lets go with Astro then. At a first glance it doesnt seem as convoluted as Qwick, but shares many concepts of fresh. But can we still use our preact-based Components with Astro? I am imagining there must be some slight API differences… |
Preact is officially supported: https://docs.astro.build/en/guides/framework-components/#official-ui-framework-integrations |
Well, getting the CSS to work was certainly a lot less painful in Astro. |
I'll unfortunately have to make TypeScript a little less strict that I would like to until edgedb/edgedb-js#1031 is fixed. |
No description provided.
The text was updated successfully, but these errors were encountered: