Skip to content

Commit 1f0d77a

Browse files
committed
more
1 parent 46216c1 commit 1f0d77a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/blog/directives-the-new-framework-lock-in.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,31 @@ Why this matters:
9696

9797
So while a custom Babel plugin or macro can implement the same underlying feature, the import-based API keeps it clearly in framework space. Directives move that same behavior into what looks like language space, which is the core concern of this post.
9898

99+
### “Does namespacing fix it?” (e.g., "use next.js cache")
100+
101+
Namespacing helps human discoverability, but it doesn’t address the core problems:
102+
103+
- It still looks like the platform. A top-level string literal implies language, not library.
104+
- It still lacks provenance and versioning at the module level. Imports encode both; strings do not.
105+
- It still requires special-casing across the toolchain (bundlers, linters, IDEs), rather than leveraging normal import resolution.
106+
- It still encourages pseudo-standardization of syntax without a spec, just with vendor prefixes.
107+
- It still increases migration cost compared to swapping an imported API.
108+
109+
Examples:
110+
111+
```js
112+
'use next.js cache'
113+
const fn = () => 'value'
114+
```
115+
116+
```js
117+
// explicit, ownable API with provenance and versioning
118+
import { cache } from 'next/cache'
119+
export const fn = cache(() => 'value')
120+
```
121+
122+
If the goal is provenance, imports already solve that cleanly and work with today’s ecosystem. If the goal is a shared cross-framework primitive, that needs a real spec, not vendor strings that look like syntax.
123+
99124
---
100125

101126
### Directives Create an Ecosystem Arms Race

0 commit comments

Comments
 (0)