-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f6a2b4
commit f303a0c
Showing
14 changed files
with
103 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
# Motion canvas hard to find items | ||
|
||
|
||
## How to spin an item infinitely | ||
|
||
```js | ||
yield loop( | ||
() => spinnerIconRef().rotation(0).rotation(360, 2, linear), | ||
); | ||
``` | ||
|
||
## How to count down a number | ||
`<Txt>` <- use a text ref | ||
|
||
`<Txt>` \<- use a text ref | ||
|
||
```js | ||
countDownRef().text("2s", 1).to("1s", 1), | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,32 @@ | ||
# Bundling best practices... | ||
# Bundling best practices... | ||
|
||
https://www.misha.wtf/blog/rollup-library-starter | ||
https://nodejs.org/api/packages.html#dual-package-hazard | ||
|
||
|
||
History reading: | ||
https://www.simplethread.com/javascript-modules-and-code-bundling-explained/ | ||
|
||
## Typescript lib | ||
|
||
## Typescript lib | ||
Winner: esbuild | ||
|
||
|
||
Reading: | ||
https://eisenbergeffect.medium.com/an-esbuild-setup-for-typescript-3b24852479fe <-- WONDERFUL | ||
https://eisenbergeffect.medium.com/an-esbuild-setup-for-typescript-3b24852479fe \<-- WONDERFUL | ||
https://janessagarrow.com/blog/typescript-and-esbuild/ | ||
|
||
|
||
|
||
https://tsdx.io/ -2 | ||
|
||
|
||
Rollup is great but pretty low level. | ||
|
||
For a higher abstraction, try esbuild, vite, or tsdx. | ||
|
||
For a higher abstraction, try esbuild, vite, or tsdx. | ||
|
||
## TS Bundling options for a package | ||
|
||
tsdx -1 (seems abandoned. Some things not working anymore w) | ||
tsup -1 but maybe tsup + tsc (will help fix the output extension issue I ran into...) | ||
tsup -1 but maybe tsup + tsc (will help fix the output extension issue I ran into...) | ||
vite | ||
custom rollup | ||
esbuild or esbuild + tsc | ||
https://jakeginnivan.medium.com/options-for-publishing-typescript-libraries-9c37bec28fe | ||
|
||
|
||
|
||
https://www.reddit.com/r/typescript/comments/pss7kx/compiling_ts_libraries_which_bundler_compiler/ |
9 changes: 5 additions & 4 deletions
9
fe-framework-nextjs/script-or-head-tags-in-next-13-app-router.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
# Should I use <script> or <head> tags in Next.js 13+ app router? | ||
# Should I use `<script>` or `<head>` tags in Next.js 13+ app router? | ||
|
||
tl;dr Don't add your own `<head>` and `<script>` tags in Next.js app router RSCs. Use `<Script>` instead. | ||
|
||
No. | ||
|
||
In basic terms, Next.js does a lot of magic with the `<head>` tag and `<script>` tags. You're far better off using the metadata api instead of adding your own `<head>` in `layout.tsx`. | ||
|
||
|
||
Use `<Script>` nextjs component and use the `strategy` attribute to control when & where the script is loaded (can do inline too). It won't give as much finegrained control over where exactly the script goes but it gets pretty close. | ||
|
||
When I used `<script>` tags they seemed to run fine, but I'd see hydration errors like `Extra attributes from the server: nonce`. | ||
When I used `<script>` tags they seemed to run fine, but I'd see hydration errors like `Extra attributes from the server: nonce`. | ||
|
||
## Open questions: | ||
* ?: Can you control the load order of specific scripts more finely when using <Script> tags in next.js? | ||
|
||
- \?: Can you control the load order of specific scripts more finely when using `<Script>` tags in next.js? | ||
|
||
## More reading | ||
|
||
https://github.com/vercel/next.js/discussions/50772#discussioncomment-7993642 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
# React / Next.js loading best practices with suspense... | ||
|
||
> <Suspense> lets you display a fallback until its children have finished loading. | ||
https://react.dev/reference/react/Suspense | ||
> `<Suspense>` lets you display a fallback until its children have finished loading. | ||
> https://react.dev/reference/react/Suspense | ||
```jsx | ||
<Suspense fallback={<Loading />}> | ||
<SomeComponent /> | ||
</Suspense> | ||
``` | ||
|
||
|
||
## Open questions | ||
|
||
Q: Is suspense a provider? | ||
Q: Can we hook into susense lifecycle hooks (or create our own) to capture timing data quickly and easily for suspense start, end etc...? | ||
|
||
## More reading | ||
|
||
https://react.dev/reference/react/Suspense | ||
https://demystifying-rsc.vercel.app/server-components/streaming/ <-- really good on RSC vs RCC suspense... | ||
https://demystifying-rsc.vercel.app/server-components/streaming/ \<-- really good on RSC vs RCC suspense... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,35 @@ | ||
# What is execution context and how can we pass it in? | ||
|
||
## What is execution scope | ||
|
||
It's the environment the code executes in, including local scope, local | ||
variables, closures etc, global vars etc... | ||
|
||
## Use case: | ||
|
||
You have a JS sandbox where you want to run some code. I want to be able to | ||
define what the execution context for the code i want to run is... | ||
|
||
## Options && Approaches: | ||
## Options && Approaches: | ||
|
||
1. I could use an iframe and inject the things I want defined into the global | ||
scope of the iframe | ||
|
||
2. Use `with` keyword (exactly what it is for haha). It extends the scope chain, | ||
though usage is not recommended. | ||
`with (myobj) var res = eval(c);` | ||
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with | ||
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with | ||
|
||
3. Inject eval into function top: | ||
Pass in a `scope` key-val obj, and iterate over those... | ||
`eval(`var ${k} = vegetableColors['${k}']`);` | ||
Pass in a `scope` key-val obj, and iterate over those... | ||
|
||
4. Inject temp var assignments / destructuring into function top | ||
```js | ||
eval(`var ${k} = vegetableColors['${k}']`); | ||
``` | ||
|
||
4. Inject temp var assignments / destructuring into function top | ||
|
||
Really interesting options here | ||
https://stackoverflow.com/questions/31907970/how-do-i-destructure-all-properties-into-the-current-scope-closure-in-es2015 | ||
|
||
|
||
https://stackoverflow.com/questions/43754035/javascript-convert-object-properties-to-variables-inside-function-scope?noredirect=1&lq=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
# Debugging rust programs with lldb | ||
|
||
|
||
`$ sudo rust-lldb target/debug/deps/mainMYGITHASH` | ||
|
||
https://bryce.fisher-fleig.org/debugging-rust-programs-with-lldb/ | ||
|
||
## lldb with node | ||
https://asciinema.org/a/29589 <-- great demo of how to use lldb | ||
https://github.com/nodejs/llnode | ||
|
||
https://asciinema.org/a/29589 \<-- great demo of how to use lldb | ||
https://github.com/nodejs/llnode | ||
|
||
## How to use lldb with vscode | ||
|
||
https://tauri.app/v1/guides/debugging/vs-code/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.